8 |
|
import java.util.*; |
9 |
|
import java.util.concurrent.*; |
10 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
11 |
< |
import java.util.concurrent.atomic.*; |
11 |
> |
import java.util.concurrent.atomic.AtomicInteger; |
12 |
|
|
13 |
|
public class ScheduledExecutorSubclassTest extends JSR166TestCase { |
14 |
|
public static void main(String[] args) { |
36 |
|
} |
37 |
|
public boolean isCancelled() { return task.isCancelled(); } |
38 |
|
public boolean isDone() { return task.isDone(); } |
39 |
< |
public V get() throws InterruptedException, ExecutionException { |
39 |
> |
public V get() throws InterruptedException, ExecutionException { |
40 |
|
V v = task.get(); |
41 |
|
assertTrue(ran); |
42 |
|
return v; |
43 |
|
} |
44 |
< |
public V get(long time, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { |
44 |
> |
public V get(long time, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { |
45 |
|
V v = task.get(time, unit); |
46 |
|
assertTrue(ran); |
47 |
|
return v; |
57 |
|
protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> c, RunnableScheduledFuture<V> task) { |
58 |
|
return new CustomTask<V>(task); |
59 |
|
} |
60 |
< |
CustomExecutor(int corePoolSize) { super(corePoolSize);} |
60 |
> |
CustomExecutor(int corePoolSize) { super(corePoolSize); } |
61 |
|
CustomExecutor(int corePoolSize, RejectedExecutionHandler handler) { |
62 |
|
super(corePoolSize, handler); |
63 |
|
} |