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.17 by jsr166, Mon Nov 16 04:57:09 2009 UTC vs.
Revision 1.18 by jsr166, Mon Nov 16 05:30:07 2009 UTC

# Line 13 | Line 13 | import java.util.concurrent.*;
13   import java.math.BigInteger;
14   import java.security.*;
15  
16 < public class AbstractExecutorServiceTest extends JSR166TestCase{
16 > public class AbstractExecutorServiceTest extends JSR166TestCase {
17      public static void main(String[] args) {
18          junit.textui.TestRunner.run (suite());
19      }
# Line 265 | Line 265 | public class AbstractExecutorServiceTest
265          ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(1));
266          try {
267  
268 <            for (int i = 0; i < 5; ++i){
268 >            for (int i = 0; i < 5; ++i) {
269                  p.submit(new MediumRunnable());
270              }
271              shouldThrow();
272 <        } catch (RejectedExecutionException success){}
272 >        } catch (RejectedExecutionException success) {}
273          joinPool(p);
274      }
275  
# Line 284 | Line 284 | public class AbstractExecutorServiceTest
284                  p.submit(new SmallCallable());
285              }
286              shouldThrow();
287 <        } catch (RejectedExecutionException e){}
287 >        } catch (RejectedExecutionException e) {}
288          joinPool(p);
289      }
290  
# Line 303 | Line 303 | public class AbstractExecutorServiceTest
303                                      try {
304                                          Thread.sleep(MEDIUM_DELAY_MS);
305                                          shouldThrow();
306 <                                    } catch (InterruptedException e){
306 >                                    } catch (InterruptedException e) {
307                                      }
308                                      return null;
309                                  }
310                              }).get();
311 <                    } catch (InterruptedException success){
311 >                    } catch (InterruptedException success) {
312                      } catch (Exception e) {
313                          unexpectedException();
314                      }
# Line 319 | Line 319 | public class AbstractExecutorServiceTest
319              t.start();
320              Thread.sleep(SHORT_DELAY_MS);
321              t.interrupt();
322 <        } catch (Exception e){
322 >        } catch (Exception e) {
323              unexpectedException();
324          }
325          joinPool(p);
# Line 337 | Line 337 | public class AbstractExecutorServiceTest
337                      try {
338                          p.submit(new SmallCallable()).get();
339                          shouldThrow();
340 <                    } catch (InterruptedException e){}
341 <                    catch (RejectedExecutionException e2){}
342 <                    catch (ExecutionException e3){}
340 >                    } catch (InterruptedException e) {}
341 >                    catch (RejectedExecutionException e2) {}
342 >                    catch (ExecutionException e3) {}
343                      return Boolean.TRUE;
344                  }
345              };
# Line 350 | Line 350 | public class AbstractExecutorServiceTest
350                  public void run() {
351                      try {
352                          c.call();
353 <                    } catch (Exception e){}
353 >                    } catch (Exception e) {}
354                  }
355            });
356          try {
# Line 358 | Line 358 | public class AbstractExecutorServiceTest
358              Thread.sleep(SHORT_DELAY_MS);
359              t.interrupt();
360              t.join();
361 <        } catch (InterruptedException e){
361 >        } catch (InterruptedException e) {
362              unexpectedException();
363          }
364  
# Line 380 | Line 380 | public class AbstractExecutorServiceTest
380                      }
381                  };
382  
383 <            for (int i =0; i < 5; i++){
383 >            for (int i =0; i < 5; i++) {
384                  p.submit(c).get();
385              }
386  
387              shouldThrow();
388          }
389 <        catch (ExecutionException success){
389 >        catch (ExecutionException success) {
390          } catch (Exception e) {
391              unexpectedException();
392          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines