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.1 by dl, Sun Sep 14 20:42:40 2003 UTC vs.
Revision 1.2 by dl, Sat Sep 20 00:31:57 2003 UTC

# Line 41 | Line 41 | import java.io.*;
41   * methods, etc) needed to reach a timeout point. Similarly, a SMALL
42   * is always discriminable as larger than SHORT and smaller than
43   * MEDIUM.  And so on. These constants are set to conservative values,
44 < * (100, 500, 1000, 5000 MS) but even so, if there is ever any doubt,
45 < * they can all be increased in one spot to rerun tests on slower
46 < * platforms</li>
44 > * but even so, if there is ever any doubt, they can all be increased
45 > * in one spot to rerun tests on slower platforms</li>
46   *
47   * <li> All threads generated must be joined inside each test case
48   * method (or <tt>fail</tt> to do so) before returning from the
# Line 54 | Line 53 | import java.io.*;
53   */
54   public class JSR166TestCase extends TestCase {
55  
56 +    public static long SHORT_DELAY_MS;
57 +    public static long SMALL_DELAY_MS;
58 +    public static long MEDIUM_DELAY_MS;
59 +    public static long LONG_DELAY_MS;
60 +
61 +
62 +    /**
63 +     * Return the shortest timed delay. This could
64 +     * be reimplmented to use for example a Property.
65 +     */
66 +    protected long getShortDelay() {
67 +        return 50;
68 +    }
69 +
70 +
71 +    /**
72 +     * Set delays as multiples fo SHORT_DELAY.
73 +     */
74 +    protected  void setDelays() {
75 +        SHORT_DELAY_MS = getShortDelay();
76 +        SMALL_DELAY_MS = SHORT_DELAY_MS * 5;
77 +        MEDIUM_DELAY_MS = SHORT_DELAY_MS * 10;
78 +        LONG_DELAY_MS = SHORT_DELAY_MS * 50;
79 +    }
80 +
81      /**
82       * Flag set true if any threadAssert methods fail
83       */
# Line 63 | Line 87 | public class JSR166TestCase extends Test
87       * Initialize test to indicat that no thread assertions have failed
88       */
89      public void setUp() {
90 +        setDelays();
91          threadFailed = false;  
92      }
93  
# Line 121 | Line 146 | public class JSR166TestCase extends Test
146          }
147      }
148  
124    public static final long SHORT_DELAY_MS =   100;
125    public static final long SMALL_DELAY_MS =   500;
126    public static final long MEDIUM_DELAY_MS = 1000;
127    public static final long LONG_DELAY_MS =   5000;
149  
150  
151      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines