[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.45, Sun May 14 00:56:43 2017 UTC revision 1.46, Mon May 29 19:15:02 2017 UTC
# Line 8  Line 8 
8    
9  import static java.util.concurrent.TimeUnit.MILLISECONDS;  import static java.util.concurrent.TimeUnit.MILLISECONDS;
10  import static java.util.concurrent.TimeUnit.NANOSECONDS;  import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;  
11    
12  import java.util.ArrayList;  import java.util.ArrayList;
13  import java.util.List;  import java.util.List;
# Line 108  Line 107 
107    
108          try {          try {
109              assertSame(expected, f.get());              assertSame(expected, f.get());
110          } catch (Throwable fail) { threadUnexpectedException(fail); }              assertSame(expected, f.get(randomTimeout(), randomTimeUnit()));
         try {  
             assertSame(expected, f.get(5L, SECONDS));  
111          } catch (Throwable fail) { threadUnexpectedException(fail); }          } catch (Throwable fail) { threadUnexpectedException(fail); }
112      }      }
113    
# Line 125  Line 122 
122          } catch (Throwable fail) { threadUnexpectedException(fail); }          } catch (Throwable fail) { threadUnexpectedException(fail); }
123    
124          try {          try {
125              f.get(5L, SECONDS);              f.get(randomTimeout(), randomTimeUnit());
126              shouldThrow();              shouldThrow();
127          } catch (CancellationException success) {          } catch (CancellationException success) {
128          } catch (Throwable fail) { threadUnexpectedException(fail); }          } catch (Throwable fail) { threadUnexpectedException(fail); }
# Line 151  Line 148 
148          } catch (Throwable fail) { threadUnexpectedException(fail); }          } catch (Throwable fail) { threadUnexpectedException(fail); }
149    
150          try {          try {
151              f.get(5L, SECONDS);              f.get(randomTimeout(), randomTimeUnit());
152              shouldThrow();              shouldThrow();
153          } catch (ExecutionException success) {          } catch (ExecutionException success) {
154              assertSame(t, success.getCause());              assertSame(t, success.getCause());

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8