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

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.189 by jsr166, Sat Oct 21 06:51:52 2017 UTC vs.
Revision 1.191 by jsr166, Sun Jan 7 22:59:17 2018 UTC

# Line 62 | Line 62 | public class CompletableFutureTest exten
62          assertTrue(f.toString().matches(".*\\[.*Not completed.*\\]"));
63          try {
64              assertNull(f.getNow(null));
65 <        } catch (Exception fail) { threadUnexpectedException(fail); }
65 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
66          try {
67              f.get(randomExpiredTimeout(), randomTimeUnit());
68              shouldThrow();
# Line 78 | Line 78 | public class CompletableFutureTest exten
78              assertEquals(value, f.join());
79              assertEquals(value, f.getNow(null));
80              assertEquals(value, f.get());
81 <        } catch (Exception fail) { threadUnexpectedException(fail); }
81 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
82          assertTrue(f.isDone());
83          assertFalse(f.isCancelled());
84          assertFalse(f.isCompletedExceptionally());
# Line 330 | Line 330 | public class CompletableFutureTest exten
330       * toString indicates current completion state
331       */
332      public void testToString_incomplete() {
333 <        CompletableFuture<String> f = new CompletableFuture<String>();
333 >        CompletableFuture<String> f = new CompletableFuture<>();
334          assertTrue(f.toString().matches(".*\\[.*Not completed.*\\]"));
335          if (testImplementationDetails)
336              assertEquals(identityString(f) + "[Not completed]",
# Line 338 | Line 338 | public class CompletableFutureTest exten
338      }
339  
340      public void testToString_normal() {
341 <        CompletableFuture<String> f = new CompletableFuture<String>();
341 >        CompletableFuture<String> f = new CompletableFuture<>();
342          assertTrue(f.complete("foo"));
343          assertTrue(f.toString().matches(".*\\[.*Completed normally.*\\]"));
344          if (testImplementationDetails)
# Line 347 | Line 347 | public class CompletableFutureTest exten
347      }
348  
349      public void testToString_exception() {
350 <        CompletableFuture<String> f = new CompletableFuture<String>();
350 >        CompletableFuture<String> f = new CompletableFuture<>();
351          assertTrue(f.completeExceptionally(new IndexOutOfBoundsException()));
352          assertTrue(f.toString().matches(".*\\[.*Completed exceptionally.*\\]"));
353          if (testImplementationDetails)
# Line 357 | Line 357 | public class CompletableFutureTest exten
357  
358      public void testToString_cancelled() {
359          for (boolean mayInterruptIfRunning : new boolean[] { true, false }) {
360 <            CompletableFuture<String> f = new CompletableFuture<String>();
360 >            CompletableFuture<String> f = new CompletableFuture<>();
361              assertTrue(f.cancel(mayInterruptIfRunning));
362              assertTrue(f.toString().matches(".*\\[.*Completed exceptionally.*\\]"));
363              if (testImplementationDetails)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines