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

Comparing jsr166/src/test/tck/DelayQueueTest.java (file contents):
Revision 1.7 by dl, Sat Dec 27 19:26:43 2003 UTC vs.
Revision 1.10 by dl, Tue Jun 1 12:54:09 2004 UTC

# Line 22 | Line 22 | public class DelayQueueTest extends JSR1
22      private static final int NOCAP = Integer.MAX_VALUE;
23  
24      /**
25 <     * A delayed implmentation for testing.
25 >     * A delayed implementation for testing.
26       * Most  tests use Pseudodelays, where delays are all elapsed
27       * (so, no blocking solely for delays) but are still ordered
28       */
29      static class PDelay implements Delayed {
30          int pseudodelay;
31          PDelay(int i) { pseudodelay = Integer.MIN_VALUE + i; }
32 <        public int compareTo(Object y) {
32 >        public int compareTo(PDelay y) {
33              int i = pseudodelay;
34              int j = ((PDelay)y).pseudodelay;
35              if (i < j) return -1;
# Line 37 | Line 37 | public class DelayQueueTest extends JSR1
37              return 0;
38          }
39  
40 <        public int compareTo(PDelay y) {
40 >        public int compareTo(Delayed y) {
41              int i = pseudodelay;
42              int j = ((PDelay)y).pseudodelay;
43              if (i < j) return -1;
# Line 74 | Line 74 | public class DelayQueueTest extends JSR1
74          NanoDelay(long i) {
75              trigger = System.nanoTime() + i;
76          }
77 <        public int compareTo(Object y) {
77 >        public int compareTo(NanoDelay y) {
78              long i = trigger;
79              long j = ((NanoDelay)y).trigger;
80              if (i < j) return -1;
# Line 82 | Line 82 | public class DelayQueueTest extends JSR1
82              return 0;
83          }
84  
85 <        public int compareTo(NanoDelay y) {
85 >        public int compareTo(Delayed y) {
86              long i = trigger;
87              long j = ((NanoDelay)y).trigger;
88              if (i < j) return -1;
# Line 764 | Line 764 | public class DelayQueueTest extends JSR1
764      }
765  
766      /**
767 <     * toArray with incompatable array type throws CCE
767 >     * toArray with incompatible array type throws CCE
768       */
769      public void testToArray1_BadArg() {
770          try {
# Line 853 | Line 853 | public class DelayQueueTest extends JSR1
853  
854  
855      /**
856 <     * Dekayed actions do not occur until their delay elapses
856 >     * Delayed actions do not occur until their delay elapses
857       */
858      public void testDelay() {
859          DelayQueue q = new DelayQueue();
# Line 933 | Line 933 | public class DelayQueueTest extends JSR1
933              q.drainTo(l);
934              assertTrue(l.size() >= SIZE);
935              t.join();
936 <            assertTrue(q.size() + l.size() == SIZE+1);
936 >            assertTrue(q.size() + l.size() >= SIZE);
937          } catch(Exception e){
938              unexpectedException();
939          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines