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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.32 by dl, Fri Jul 31 23:02:49 2009 UTC vs.
Revision 1.33 by jsr166, Fri Jul 31 23:37:31 2009 UTC

# Line 286 | Line 286 | public class JSR166TestCase extends Test
286  
287      /**
288       * threadFail with message "should throw exception"
289 <     */
289 >     */
290      public void threadShouldThrow() {
291         try {
292             threadFailed = true;
# Line 321 | Line 321 | public class JSR166TestCase extends Test
321          try {
322              exec.shutdown();
323              assertTrue(exec.awaitTermination(LONG_DELAY_MS, TimeUnit.MILLISECONDS));
324 <        } catch(SecurityException ok) {
324 >        } catch (SecurityException ok) {
325              // Allowed in case test doesn't have privs
326 <        } catch(InterruptedException ie) {
326 >        } catch (InterruptedException ie) {
327              fail("Unexpected exception");
328          }
329      }
# Line 421 | Line 421 | public class JSR166TestCase extends Test
421              try {
422                  Thread.sleep(SHORT_DELAY_MS);
423              }
424 <            catch(Exception e) {
424 >            catch (Exception e) {
425                  threadUnexpectedException(e);
426              }
427          }
# Line 433 | Line 433 | public class JSR166TestCase extends Test
433                  Thread.sleep(SHORT_DELAY_MS);
434                  threadShouldThrow();
435              }
436 <            catch(InterruptedException success) {
436 >            catch (InterruptedException success) {
437              }
438          }
439      }
# Line 443 | Line 443 | public class JSR166TestCase extends Test
443              try {
444                  Thread.sleep(SMALL_DELAY_MS);
445              }
446 <            catch(Exception e) {
446 >            catch (Exception e) {
447                  threadUnexpectedException(e);
448              }
449          }
# Line 454 | Line 454 | public class JSR166TestCase extends Test
454              try {
455                  Thread.sleep(SMALL_DELAY_MS);
456              }
457 <            catch(Exception e) {
457 >            catch (Exception e) {
458              }
459          }
460      }
# Line 464 | Line 464 | public class JSR166TestCase extends Test
464              try {
465                  Thread.sleep(SMALL_DELAY_MS);
466              }
467 <            catch(Exception e) {
467 >            catch (Exception e) {
468                  threadUnexpectedException(e);
469              }
470              return Boolean.TRUE;
# Line 477 | Line 477 | public class JSR166TestCase extends Test
477                  Thread.sleep(SMALL_DELAY_MS);
478                  threadShouldThrow();
479              }
480 <            catch(InterruptedException success) {
480 >            catch (InterruptedException success) {
481              }
482          }
483      }
# Line 488 | Line 488 | public class JSR166TestCase extends Test
488              try {
489                  Thread.sleep(MEDIUM_DELAY_MS);
490              }
491 <            catch(Exception e) {
491 >            catch (Exception e) {
492                  threadUnexpectedException(e);
493              }
494          }
# Line 500 | Line 500 | public class JSR166TestCase extends Test
500                  Thread.sleep(MEDIUM_DELAY_MS);
501                  threadShouldThrow();
502              }
503 <            catch(InterruptedException success) {
503 >            catch (InterruptedException success) {
504              }
505          }
506      }
# Line 510 | Line 510 | public class JSR166TestCase extends Test
510              try {
511                  Thread.sleep(MEDIUM_DELAY_MS);
512              }
513 <            catch(InterruptedException success) {
513 >            catch (InterruptedException success) {
514              }
515          }
516      }
# Line 520 | Line 520 | public class JSR166TestCase extends Test
520              try {
521                  Thread.sleep(LONG_DELAY_MS);
522              }
523 <            catch(InterruptedException success) {
523 >            catch (InterruptedException success) {
524              }
525          }
526      }
# Line 528 | Line 528 | public class JSR166TestCase extends Test
528      /**
529       * For use as ThreadFactory in constructors
530       */
531 <    static class SimpleThreadFactory implements ThreadFactory{
532 <        public Thread newThread(Runnable r){
531 >    static class SimpleThreadFactory implements ThreadFactory {
532 >        public Thread newThread(Runnable r) {
533              return new Thread(r);
534          }
535      }
# Line 540 | Line 540 | public class JSR166TestCase extends Test
540              try {
541                  Thread.sleep(SMALL_DELAY_MS);
542                  done = true;
543 <            } catch(Exception e){
543 >            } catch (Exception e) {
544              }
545          }
546      }
# Line 551 | Line 551 | public class JSR166TestCase extends Test
551              try {
552                  Thread.sleep(MEDIUM_DELAY_MS);
553                  done = true;
554 <            } catch(Exception e){
554 >            } catch (Exception e) {
555              }
556          }
557      }
# Line 562 | Line 562 | public class JSR166TestCase extends Test
562              try {
563                  Thread.sleep(LONG_DELAY_MS);
564                  done = true;
565 <            } catch(Exception e){
565 >            } catch (Exception e) {
566              }
567          }
568      }
# Line 580 | Line 580 | public class JSR166TestCase extends Test
580              try {
581                  Thread.sleep(SMALL_DELAY_MS);
582                  done = true;
583 <            } catch(Exception e){
583 >            } catch (Exception e) {
584              }
585              return Boolean.TRUE;
586          }
# Line 590 | Line 590 | public class JSR166TestCase extends Test
590      /**
591       * For use as RejectedExecutionHandler in constructors
592       */
593 <    static class NoOpREHandler implements RejectedExecutionHandler{
593 >    static class NoOpREHandler implements RejectedExecutionHandler {
594          public void rejectedExecution(Runnable r, ThreadPoolExecutor executor){}
595      }
596  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines