26 |
|
* <li> All assertions in code running in generated threads must use |
27 |
|
* the forms {@link #threadFail}, {@link #threadAssertTrue}, {@link |
28 |
|
* #threadAssertEquals}, or {@link #threadAssertNull}, (not |
29 |
< |
* <tt>fail</tt>, <tt>assertTrue</tt>, etc.) It is OK (but not |
29 |
> |
* {@code fail}, {@code assertTrue}, etc.) It is OK (but not |
30 |
|
* particularly recommended) for other code to use these forms too. |
31 |
|
* Only the most typically used JUnit assertion methods are defined |
32 |
|
* this way, but enough to live with.</li> |
33 |
|
* |
34 |
|
* <li> If you override {@link #setUp} or {@link #tearDown}, make sure |
35 |
< |
* to invoke <tt>super.setUp</tt> and <tt>super.tearDown</tt> within |
35 |
> |
* to invoke {@code super.setUp} and {@code super.tearDown} within |
36 |
|
* them. These methods are used to clear and check for thread |
37 |
|
* assertion failures.</li> |
38 |
|
* |
39 |
< |
* <li>All delays and timeouts must use one of the constants <tt> |
40 |
< |
* SHORT_DELAY_MS</tt>, <tt> SMALL_DELAY_MS</tt>, <tt> MEDIUM_DELAY_MS</tt>, |
41 |
< |
* <tt> LONG_DELAY_MS</tt>. The idea here is that a SHORT is always |
39 |
> |
* <li>All delays and timeouts must use one of the constants {@code |
40 |
> |
* SHORT_DELAY_MS}, {@code SMALL_DELAY_MS}, {@code MEDIUM_DELAY_MS}, |
41 |
> |
* {@code LONG_DELAY_MS}. The idea here is that a SHORT is always |
42 |
|
* discriminable from zero time, and always allows enough time for the |
43 |
|
* small amounts of computation (creating a thread, calling a few |
44 |
|
* methods, etc) needed to reach a timeout point. Similarly, a SMALL |
48 |
|
* in one spot to rerun tests on slower platforms.</li> |
49 |
|
* |
50 |
|
* <li> All threads generated must be joined inside each test case |
51 |
< |
* method (or <tt>fail</tt> to do so) before returning from the |
52 |
< |
* method. The <tt> joinPool</tt> method can be used to do this when |
51 |
> |
* method (or {@code fail} to do so) before returning from the |
52 |
> |
* method. The {@code joinPool} method can be used to do this when |
53 |
|
* using Executors.</li> |
54 |
|
* |
55 |
|
* </ol> |
81 |
|
* any particular package to simplify things for people integrating |
82 |
|
* them in TCK test suites.</li> |
83 |
|
* |
84 |
< |
* <li> As a convenience, the <tt>main</tt> of this class (JSR166TestCase) |
84 |
> |
* <li> As a convenience, the {@code main} of this class (JSR166TestCase) |
85 |
|
* runs all JSR166 unit tests.</li> |
86 |
|
* |
87 |
|
* </ul> |
143 |
|
suite.addTest(new TestSuite(AtomicReferenceTest.class)); |
144 |
|
suite.addTest(new TestSuite(AtomicStampedReferenceTest.class)); |
145 |
|
suite.addTest(new TestSuite(ConcurrentHashMapTest.class)); |
146 |
+ |
suite.addTest(new TestSuite(ConcurrentLinkedDequeTest.class)); |
147 |
|
suite.addTest(new TestSuite(ConcurrentLinkedQueueTest.class)); |
148 |
|
suite.addTest(new TestSuite(ConcurrentSkipListMapTest.class)); |
149 |
|
suite.addTest(new TestSuite(ConcurrentSkipListSubMapTest.class)); |
294 |
|
} |
295 |
|
} |
296 |
|
|
297 |
+ |
/** |
298 |
+ |
* If arguments not identical, set status to indicate current testcase |
299 |
+ |
* should fail |
300 |
+ |
*/ |
301 |
+ |
public void threadAssertSame(Object x, Object y) { |
302 |
+ |
if (x != y) { |
303 |
+ |
threadFailed = true; |
304 |
+ |
assertSame(x, y); |
305 |
+ |
} |
306 |
+ |
} |
307 |
+ |
|
308 |
|
/** |
309 |
|
* threadFail with message "should throw exception" |
310 |
|
*/ |