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

Comparing jsr166/src/test/tck/ScheduledExecutorSubclassTest.java (file contents):
Revision 1.16 by jsr166, Mon Oct 11 15:46:40 2010 UTC vs.
Revision 1.20 by jsr166, Thu Apr 14 22:55:08 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   import junit.framework.*;
# Line 291 | Line 291 | public class ScheduledExecutorSubclassTe
291      /**
292       * schedule callable throws RejectedExecutionException if shutdown
293       */
294 <     public void testSchedule3_RejectedExecutionException() {
295 <         CustomExecutor se = new CustomExecutor(1);
296 <         try {
297 <             se.shutdown();
298 <             se.schedule(new NoOpCallable(),
299 <                         MEDIUM_DELAY_MS, MILLISECONDS);
300 <             shouldThrow();
301 <         } catch (RejectedExecutionException success) {
302 <         } catch (SecurityException ok) {
303 <         }
304 <         joinPool(se);
294 >    public void testSchedule3_RejectedExecutionException() {
295 >        CustomExecutor se = new CustomExecutor(1);
296 >        try {
297 >            se.shutdown();
298 >            se.schedule(new NoOpCallable(),
299 >                        MEDIUM_DELAY_MS, MILLISECONDS);
300 >            shouldThrow();
301 >        } catch (RejectedExecutionException success) {
302 >        } catch (SecurityException ok) {
303 >        }
304 >        joinPool(se);
305      }
306  
307      /**
# Line 535 | Line 535 | public class ScheduledExecutorSubclassTe
535          try {
536              p.execute(new CheckedRunnable() {
537                  public void realRun() throws InterruptedException {
538                    threadStarted.countDown();
538                      assertFalse(p.isTerminated());
539 +                    threadStarted.countDown();
540                      done.await();
541                  }});
542              assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS));
543 +            assertFalse(p.isTerminating());
544              done.countDown();
545          } finally {
546              try { p.shutdown(); } catch (SecurityException ok) { return; }
# Line 559 | Line 560 | public class ScheduledExecutorSubclassTe
560              assertFalse(p.isTerminating());
561              p.execute(new CheckedRunnable() {
562                  public void realRun() throws InterruptedException {
562                    threadStarted.countDown();
563                      assertFalse(p.isTerminating());
564 +                    threadStarted.countDown();
565                      done.await();
566                  }});
567              assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines