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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.2 by dl, Sat Sep 20 00:31:57 2003 UTC vs.
Revision 1.3 by dl, Sat Sep 20 18:20:08 2003 UTC

# Line 134 | Line 134 | public class JSR166TestCase extends Test
134          }
135      }
136  
137 +    public void threadShouldThrow() {
138 +        threadFailed = true;
139 +        fail("should throw exception");
140 +    }
141 +
142 +    public void threadUnexpectedException() {
143 +        threadFailed = true;
144 +        fail("Unexpected exception");
145 +    }
146 +
147 +
148      /**
149       * Wait out termination of a thread pool or fail doing so
150       */
# Line 142 | Line 153 | public class JSR166TestCase extends Test
153              exec.shutdown();
154              assertTrue(exec.awaitTermination(LONG_DELAY_MS, TimeUnit.MILLISECONDS));
155          } catch(InterruptedException ie) {
156 <            fail("unexpected exception");
156 >            fail("Unexpected exception");
157          }
158      }
159  
160 +    
161 +    public void shouldThrow() {
162 +        fail("Should throw exception");
163 +    }
164 +
165 +    public void unexpectedException() {
166 +        fail("Unexpected exception");
167 +    }
168  
169  
170      /**
# Line 189 | Line 208 | public class JSR166TestCase extends Test
208                  Thread.sleep(SHORT_DELAY_MS);
209              }
210              catch(Exception e) {
211 <                threadFail("unexpectedException");
211 >                threadUnexpectedException();
212              }
213          }
214      }
# Line 198 | Line 217 | public class JSR166TestCase extends Test
217          public void run() {
218              try {
219                  Thread.sleep(SHORT_DELAY_MS);
220 <                threadFail("should throw IE");
220 >                threadShouldThrow();
221              }
222              catch(InterruptedException success) {
223              }
# Line 211 | Line 230 | public class JSR166TestCase extends Test
230                  Thread.sleep(SMALL_DELAY_MS);
231              }
232              catch(Exception e) {
233 <                threadFail("unexpectedException");
233 >                threadUnexpectedException();
234              }
235          }
236      }
# Line 222 | Line 241 | public class JSR166TestCase extends Test
241                  Thread.sleep(SMALL_DELAY_MS);
242              }
243              catch(Exception e) {
244 <                threadFail("unexpectedException");
244 >                threadUnexpectedException();
245              }
246              return Boolean.TRUE;
247          }
# Line 232 | Line 251 | public class JSR166TestCase extends Test
251          public void run() {
252              try {
253                  Thread.sleep(SMALL_DELAY_MS);
254 <                threadFail("should throw IE");
254 >                threadShouldThrow();
255              }
256              catch(InterruptedException success) {
257              }
# Line 246 | Line 265 | public class JSR166TestCase extends Test
265                  Thread.sleep(MEDIUM_DELAY_MS);
266              }
267              catch(Exception e) {
268 <                threadFail("unexpectedException");
268 >                threadUnexpectedException();
269              }
270          }
271      }
# Line 255 | Line 274 | public class JSR166TestCase extends Test
274          public void run() {
275              try {
276                  Thread.sleep(MEDIUM_DELAY_MS);
277 <                threadFail("should throw IE");
277 >                threadShouldThrow();
278              }
279              catch(InterruptedException success) {
280              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines