[cvs] / jsr166 / src / test / tck / AbstractExecutorServiceTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AbstractExecutorServiceTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8