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.44 by jsr166, Thu Oct 8 03:08:37 2015 UTC vs.
Revision 1.45 by jsr166, Wed Jan 4 06:09:58 2017 UTC

# Line 267 | Line 267 | public class AbstractExecutorServiceTest
267      public void testInvokeAny3() throws Exception {
268          final ExecutorService e = new DirectExecutorService();
269          try (PoolCleaner cleaner = cleaner(e)) {
270 <            List<Callable<Long>> l = new ArrayList<Callable<Long>>();
270 >            List<Callable<Long>> l = new ArrayList<>();
271              l.add(new Callable<Long>() {
272                        public Long call() { throw new ArithmeticException(); }});
273              l.add(null);
# Line 284 | Line 284 | public class AbstractExecutorServiceTest
284      public void testInvokeAny4() throws InterruptedException {
285          final ExecutorService e = new DirectExecutorService();
286          try (PoolCleaner cleaner = cleaner(e)) {
287 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
287 >            List<Callable<String>> l = new ArrayList<>();
288              l.add(new NPETask());
289              try {
290                  e.invokeAny(l);
# Line 301 | Line 301 | public class AbstractExecutorServiceTest
301      public void testInvokeAny5() throws Exception {
302          final ExecutorService e = new DirectExecutorService();
303          try (PoolCleaner cleaner = cleaner(e)) {
304 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
304 >            List<Callable<String>> l = new ArrayList<>();
305              l.add(new StringTask());
306              l.add(new StringTask());
307              String result = e.invokeAny(l);
# Line 339 | Line 339 | public class AbstractExecutorServiceTest
339      public void testInvokeAll3() throws InterruptedException {
340          final ExecutorService e = new DirectExecutorService();
341          try (PoolCleaner cleaner = cleaner(e)) {
342 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
342 >            List<Callable<String>> l = new ArrayList<>();
343              l.add(new StringTask());
344              l.add(null);
345              try {
# Line 355 | Line 355 | public class AbstractExecutorServiceTest
355      public void testInvokeAll4() throws Exception {
356          final ExecutorService e = new DirectExecutorService();
357          try (PoolCleaner cleaner = cleaner(e)) {
358 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
358 >            List<Callable<String>> l = new ArrayList<>();
359              l.add(new NPETask());
360              List<Future<String>> futures = e.invokeAll(l);
361              assertEquals(1, futures.size());
# Line 374 | Line 374 | public class AbstractExecutorServiceTest
374      public void testInvokeAll5() throws Exception {
375          final ExecutorService e = new DirectExecutorService();
376          try (PoolCleaner cleaner = cleaner(e)) {
377 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
377 >            List<Callable<String>> l = new ArrayList<>();
378              l.add(new StringTask());
379              l.add(new StringTask());
380              List<Future<String>> futures = e.invokeAll(l);
# Line 403 | Line 403 | public class AbstractExecutorServiceTest
403      public void testTimedInvokeAnyNullTimeUnit() throws Exception {
404          final ExecutorService e = new DirectExecutorService();
405          try (PoolCleaner cleaner = cleaner(e)) {
406 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
406 >            List<Callable<String>> l = new ArrayList<>();
407              l.add(new StringTask());
408              try {
409                  e.invokeAny(l, MEDIUM_DELAY_MS, null);
# Line 432 | Line 432 | public class AbstractExecutorServiceTest
432      public void testTimedInvokeAny3() throws Exception {
433          final ExecutorService e = new DirectExecutorService();
434          try (PoolCleaner cleaner = cleaner(e)) {
435 <            List<Callable<Long>> l = new ArrayList<Callable<Long>>();
435 >            List<Callable<Long>> l = new ArrayList<>();
436              l.add(new Callable<Long>() {
437                        public Long call() { throw new ArithmeticException(); }});
438              l.add(null);
# Line 450 | Line 450 | public class AbstractExecutorServiceTest
450          final ExecutorService e = new DirectExecutorService();
451          try (PoolCleaner cleaner = cleaner(e)) {
452              long startTime = System.nanoTime();
453 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
453 >            List<Callable<String>> l = new ArrayList<>();
454              l.add(new NPETask());
455              try {
456                  e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
# Line 469 | Line 469 | public class AbstractExecutorServiceTest
469          final ExecutorService e = new DirectExecutorService();
470          try (PoolCleaner cleaner = cleaner(e)) {
471              long startTime = System.nanoTime();
472 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
472 >            List<Callable<String>> l = new ArrayList<>();
473              l.add(new StringTask());
474              l.add(new StringTask());
475              String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
# Line 497 | Line 497 | public class AbstractExecutorServiceTest
497      public void testTimedInvokeAllNullTimeUnit() throws InterruptedException {
498          final ExecutorService e = new DirectExecutorService();
499          try (PoolCleaner cleaner = cleaner(e)) {
500 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
500 >            List<Callable<String>> l = new ArrayList<>();
501              l.add(new StringTask());
502              try {
503                  e.invokeAll(l, MEDIUM_DELAY_MS, null);
# Line 523 | Line 523 | public class AbstractExecutorServiceTest
523      public void testTimedInvokeAll3() throws InterruptedException {
524          final ExecutorService e = new DirectExecutorService();
525          try (PoolCleaner cleaner = cleaner(e)) {
526 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
526 >            List<Callable<String>> l = new ArrayList<>();
527              l.add(new StringTask());
528              l.add(null);
529              try {
# Line 539 | Line 539 | public class AbstractExecutorServiceTest
539      public void testTimedInvokeAll4() throws Exception {
540          final ExecutorService e = new DirectExecutorService();
541          try (PoolCleaner cleaner = cleaner(e)) {
542 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
542 >            List<Callable<String>> l = new ArrayList<>();
543              l.add(new NPETask());
544              List<Future<String>> futures =
545                  e.invokeAll(l, LONG_DELAY_MS, MILLISECONDS);
# Line 559 | Line 559 | public class AbstractExecutorServiceTest
559      public void testTimedInvokeAll5() throws Exception {
560          final ExecutorService e = new DirectExecutorService();
561          try (PoolCleaner cleaner = cleaner(e)) {
562 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
562 >            List<Callable<String>> l = new ArrayList<>();
563              l.add(new StringTask());
564              l.add(new StringTask());
565              List<Future<String>> futures =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines