ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CyclicBarrierTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CyclicBarrierTest.java (file contents):
Revision 1.1 by dl, Sun Aug 31 19:24:54 2003 UTC vs.
Revision 1.2 by dl, Sun Sep 14 20:42:40 2003 UTC

# Line 9 | Line 9 | import junit.framework.*;
9   import java.util.*;
10   import java.util.concurrent.*;
11  
12 < public class CyclicBarrierTest extends TestCase{
12 > public class CyclicBarrierTest extends JSR166TestCase{
13      
14      public static void main(String[] args) {
15          junit.textui.TestRunner.run (suite());  
# Line 20 | Line 20 | public class CyclicBarrierTest extends T
20          return new TestSuite(CyclicBarrierTest.class);
21      }
22      
23    private static long SHORT_DELAY_MS = 100;
24    private static long MEDIUM_DELAY_MS = 1000;
25    private static long LONG_DELAY_MS = 10000;
26
23      public void testConstructor1(){
24          try{
25              new CyclicBarrier(-1, (Runnable)null);
# Line 90 | Line 86 | public class CyclicBarrierTest extends T
86                          b.await();
87                          b.await();
88                      } catch(Exception e){
89 <                        fail("unexpected exception");
89 >                        threadFail("unexpected exception");
90                      }}});
91  
92          try {
# Line 112 | Line 108 | public class CyclicBarrierTest extends T
108                  public void run(){
109                      try{
110                          c.await();
111 <                        fail("should throw");
111 >                        threadFail("should throw");
112                      } catch(InterruptedException success){}                
113                      catch(Exception b){
114 <                        fail("should throw IE");
114 >                        threadFail("should throw IE");
115                      }
116                  }
117              });
# Line 123 | Line 119 | public class CyclicBarrierTest extends T
119                  public void run(){
120                      try{
121                          c.await();
122 <                        fail("should throw");                        
122 >                        threadFail("should throw");                        
123                      } catch(BrokenBarrierException success){
124                      } catch(Exception i){
125 <                        fail("should throw BBE");
125 >                        threadFail("should throw BBE");
126                      }
127                  }
128              });
# Line 148 | Line 144 | public class CyclicBarrierTest extends T
144                  public void run(){
145                      try{
146                          c.await(MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
147 <                        fail("should throw");
147 >                        threadFail("should throw");
148                      } catch(InterruptedException success){
149                      } catch(Exception b){
150 <                        fail("should throw IE");
150 >                        threadFail("should throw IE");
151                      }
152                  }
153              });
# Line 159 | Line 155 | public class CyclicBarrierTest extends T
155                  public void run(){
156                      try{
157                          c.await(MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
158 <                        fail("should throw");                        
158 >                        threadFail("should throw");                        
159                      } catch(BrokenBarrierException success){
160                      } catch(Exception i){
161 <                        fail("should throw BBE");
161 >                        threadFail("should throw BBE");
162                      }
163                  }
164              });
# Line 184 | Line 180 | public class CyclicBarrierTest extends T
180                  public void run(){
181                      try{
182                          c.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
183 <                        fail("should throw");
183 >                        threadFail("should throw");
184                      } catch(TimeoutException success){
185                      } catch(Exception b){
186 <                        fail("should throw TOE");
186 >                        threadFail("should throw TOE");
187                          
188                      }
189                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines