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

Comparing jsr166/src/test/tck/AbstractExecutorServiceTest.java (file contents):
Revision 1.32 by jsr166, Sun May 29 07:01:17 2011 UTC vs.
Revision 1.34 by jsr166, Wed Sep 25 07:39:17 2013 UTC

# Line 46 | Line 46 | public class AbstractExecutorServiceTest
46      public void testExecuteRunnable() throws Exception {
47          ExecutorService e = new DirectExecutorService();
48          final AtomicBoolean done = new AtomicBoolean(false);
49 <        CheckedRunnable task = new CheckedRunnable() {
49 >        Future<?> future = e.submit(new CheckedRunnable() {
50              public void realRun() {
51                  done.set(true);
52 <            }};
53 <        Future<?> future = e.submit(task);
52 >            }});
53          assertNull(future.get());
54          assertNull(future.get(0, MILLISECONDS));
55          assertTrue(done.get());
# Line 213 | Line 212 | public class AbstractExecutorServiceTest
212                                     new ArrayBlockingQueue<Runnable>(10));
213  
214          Callable c = new Callable() {
215 <            public Object call() { return 5/0; }};
215 >            public Object call() { throw new ArithmeticException(); }};
216  
217          try {
218              p.submit(c).get();
# Line 257 | Line 256 | public class AbstractExecutorServiceTest
256       */
257      public void testInvokeAny3() throws Exception {
258          ExecutorService e = new DirectExecutorService();
259 <        List<Callable<Integer>> l = new ArrayList<Callable<Integer>>();
260 <        l.add(new Callable<Integer>() {
261 <                  public Integer call() { return 5/0; }});
259 >        List<Callable<Long>> l = new ArrayList<Callable<Long>>();
260 >        l.add(new Callable<Long>() {
261 >            public Long call() { throw new ArithmeticException(); }});
262          l.add(null);
263          try {
264              e.invokeAny(l);
# Line 435 | Line 434 | public class AbstractExecutorServiceTest
434       */
435      public void testTimedInvokeAny3() throws Exception {
436          ExecutorService e = new DirectExecutorService();
437 <        List<Callable<Integer>> l = new ArrayList<Callable<Integer>>();
438 <        l.add(new Callable<Integer>() {
439 <                  public Integer call() { return 5/0; }});
437 >        List<Callable<Long>> l = new ArrayList<Callable<Long>>();
438 >        l.add(new Callable<Long>() {
439 >            public Long call() { throw new ArithmeticException(); }});
440          l.add(null);
441          try {
442              e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines