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

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

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

revision 1.47, Wed Aug 16 17:18:34 2017 UTC revision 1.51, Sun Jan 7 22:59:18 2018 UTC
# Line 838  Line 838 
838       * toString indicates current completion state       * toString indicates current completion state
839       */       */
840      public void testToString_incomplete() {      public void testToString_incomplete() {
841          FutureTask<String> f = new FutureTask<String>(() -> "");          FutureTask<String> f = new FutureTask<>(() -> "");
842          assertTrue(f.toString().matches(".*\\[.*Not completed.*\\]"));          assertTrue(f.toString().matches(".*\\[.*Not completed.*\\]"));
843          if (testImplementationDetails)          if (testImplementationDetails)
844              assertTrue(f.toString().startsWith(              assertTrue(f.toString().startsWith(
# Line 846  Line 846 
846      }      }
847    
848      public void testToString_normal() {      public void testToString_normal() {
849          FutureTask<String> f = new FutureTask<String>(() -> "");          FutureTask<String> f = new FutureTask<>(() -> "");
850          f.run();          f.run();
851          assertTrue(f.toString().matches(".*\\[.*Completed normally.*\\]"));          assertTrue(f.toString().matches(".*\\[.*Completed normally.*\\]"));
852          if (testImplementationDetails)          if (testImplementationDetails)
# Line 855  Line 855 
855      }      }
856    
857      public void testToString_exception() {      public void testToString_exception() {
858          FutureTask<String> f = new FutureTask<String>(          FutureTask<String> f = new FutureTask<>(
859                  () -> { throw new ArithmeticException(); });                  () -> { throw new ArithmeticException(); });
860          f.run();          f.run();
861          assertTrue(f.toString().matches(".*\\[.*Completed exceptionally.*\\]"));          assertTrue(f.toString().matches(".*\\[.*Completed exceptionally.*\\]"));
# Line 866  Line 866 
866    
867      public void testToString_cancelled() {      public void testToString_cancelled() {
868          for (boolean mayInterruptIfRunning : new boolean[] { true, false }) {          for (boolean mayInterruptIfRunning : new boolean[] { true, false }) {
869              FutureTask<String> f = new FutureTask<String>(() -> "");              FutureTask<String> f = new FutureTask<>(() -> "");
870              assertTrue(f.cancel(mayInterruptIfRunning));              assertTrue(f.cancel(mayInterruptIfRunning));
871              assertTrue(f.toString().matches(".*\\[.*Cancelled.*\\]"));              assertTrue(f.toString().matches(".*\\[.*Cancelled.*\\]"));
872              if (testImplementationDetails)              if (testImplementationDetails)

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.51

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8