1 |
|
/* |
2 |
< |
* Written by members of JCP JSR-166 Expert Group and released to the |
3 |
< |
* public domain. Use, modify, and redistribute this code in any way |
4 |
< |
* without acknowledgement. Other contributors include Andrew Wright, |
5 |
< |
* Jeffrey Hayes, Pat Fischer, Mike Judd. |
2 |
> |
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
> |
* Expert Group and released to the public domain, as explained at |
4 |
> |
* http://creativecommons.org/licenses/publicdomain |
5 |
> |
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
> |
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
|
import junit.framework.*; |
99 |
|
public static Test suite ( ) { |
100 |
|
TestSuite suite = new TestSuite("JSR166 Unit Tests"); |
101 |
|
|
102 |
+ |
suite.addTest(new TestSuite(AbstractExecutorServiceTest.class)); |
103 |
+ |
suite.addTest(new TestSuite(AbstractQueuedSynchronizerTest.class)); |
104 |
|
suite.addTest(new TestSuite(ArrayBlockingQueueTest.class)); |
105 |
|
suite.addTest(new TestSuite(AtomicBooleanTest.class)); |
106 |
|
suite.addTest(new TestSuite(AtomicIntegerArrayTest.class)); |
123 |
|
suite.addTest(new TestSuite(DelayQueueTest.class)); |
124 |
|
suite.addTest(new TestSuite(ExchangerTest.class)); |
125 |
|
suite.addTest(new TestSuite(ExecutorsTest.class)); |
126 |
+ |
suite.addTest(new TestSuite(ExecutorCompletionServiceTest.class)); |
127 |
|
suite.addTest(new TestSuite(FutureTaskTest.class)); |
128 |
|
suite.addTest(new TestSuite(LinkedBlockingQueueTest.class)); |
129 |
|
suite.addTest(new TestSuite(LinkedListTest.class)); |
130 |
|
suite.addTest(new TestSuite(LockSupportTest.class)); |
131 |
|
suite.addTest(new TestSuite(PriorityBlockingQueueTest.class)); |
132 |
|
suite.addTest(new TestSuite(PriorityQueueTest.class)); |
129 |
– |
suite.addTest(new TestSuite(PrivilegedFutureTaskTest.class)); |
133 |
|
suite.addTest(new TestSuite(ReentrantLockTest.class)); |
134 |
|
suite.addTest(new TestSuite(ReentrantReadWriteLockTest.class)); |
135 |
|
suite.addTest(new TestSuite(ScheduledExecutorTest.class)); |
153 |
|
|
154 |
|
/** |
155 |
|
* Return the shortest timed delay. This could |
156 |
< |
* be reimplmented to use for example a Property. |
156 |
> |
* be reimplemented to use for example a Property. |
157 |
|
*/ |
158 |
|
protected long getShortDelay() { |
159 |
|
return 100; |
355 |
|
public Object call() { return Boolean.TRUE; } |
356 |
|
} |
357 |
|
|
358 |
+ |
static final String TEST_STRING = "a test string"; |
359 |
+ |
|
360 |
+ |
static class StringTask implements Callable<String> { |
361 |
+ |
public String call() { return TEST_STRING; } |
362 |
+ |
} |
363 |
+ |
|
364 |
+ |
static class NPETask implements Callable<String> { |
365 |
+ |
public String call() { throw new NullPointerException(); } |
366 |
+ |
} |
367 |
+ |
|
368 |
+ |
static class CallableOne implements Callable<Integer> { |
369 |
+ |
public Integer call() { return one; } |
370 |
+ |
} |
371 |
+ |
|
372 |
|
class ShortRunnable implements Runnable { |
373 |
|
public void run() { |
374 |
|
try { |
468 |
|
} |
469 |
|
} |
470 |
|
|
471 |
+ |
class LongPossiblyInterruptedRunnable implements Runnable { |
472 |
+ |
public void run() { |
473 |
+ |
try { |
474 |
+ |
Thread.sleep(LONG_DELAY_MS); |
475 |
+ |
} |
476 |
+ |
catch(InterruptedException success) { |
477 |
+ |
} |
478 |
+ |
} |
479 |
+ |
} |
480 |
+ |
|
481 |
|
/** |
482 |
|
* For use as ThreadFactory in constructors |
483 |
|
*/ |
539 |
|
} |
540 |
|
} |
541 |
|
|
542 |
+ |
|
543 |
|
/** |
544 |
|
* For use as RejectedExecutionHandler in constructors |
545 |
|
*/ |