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

Comparing jsr166/src/test/tck/ThreadLocalRandomTest.java (file contents):
Revision 1.5 by jsr166, Sat Nov 21 21:02:14 2009 UTC vs.
Revision 1.9 by jsr166, Fri May 27 19:44:03 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   import junit.framework.*;
7   import java.util.concurrent.*;
8   import java.util.*;
9  
10
10   public class ThreadLocalRandomTest extends JSR166TestCase {
11  
12      public static void main(String[] args) {
13 <        junit.textui.TestRunner.run (suite());
13 >        junit.textui.TestRunner.run(suite());
14      }
15      public static Test suite() {
16          return new TestSuite(ThreadLocalRandomTest.class);
# Line 67 | Line 66 | public class ThreadLocalRandomTest exten
66          assertTrue(i < NCALLS);
67      }
68  
70
69      /**
70       * Repeated calls to nextBoolean produce at least one different result
71       */
# Line 112 | Line 110 | public class ThreadLocalRandomTest exten
110          assertTrue(i < NCALLS);
111      }
112  
115
113      /**
114       * nextInt(negative) throws IllegalArgumentException;
115       */
116      public void testNextIntBoundedNeg() {
117          try {
118 <            int  f = ThreadLocalRandom.current().nextInt(-17);
118 >            int f = ThreadLocalRandom.current().nextInt(-17);
119              shouldThrow();
120          } catch (IllegalArgumentException success) {}
121      }
# Line 128 | Line 125 | public class ThreadLocalRandomTest exten
125       */
126      public void testNextIntBadBounds() {
127          try {
128 <            int  f = ThreadLocalRandom.current().nextInt(17, 2);
128 >            int f = ThreadLocalRandom.current().nextInt(17, 2);
129              shouldThrow();
130          } catch (IllegalArgumentException success) {}
131      }
132  
136
133      /**
134       * nextInt(bound) returns 0 <= value < bound;
135       * repeated calls produce at least one different result
# Line 154 | Line 150 | public class ThreadLocalRandomTest exten
150          }
151      }
152  
157
153      /**
154       * nextInt(least, bound) returns least <= value < bound;
155       * repeated calls produce at least one different result
# Line 181 | Line 176 | public class ThreadLocalRandomTest exten
176       */
177      public void testNextLongBoundedNeg() {
178          try {
179 <            long  f = ThreadLocalRandom.current().nextLong(-17);
179 >            long f = ThreadLocalRandom.current().nextLong(-17);
180              shouldThrow();
181          } catch (IllegalArgumentException success) {}
182      }
# Line 191 | Line 186 | public class ThreadLocalRandomTest exten
186       */
187      public void testNextLongBadBounds() {
188          try {
189 <            long  f = ThreadLocalRandom.current().nextLong(17, 2);
189 >            long f = ThreadLocalRandom.current().nextLong(17, 2);
190              shouldThrow();
191          } catch (IllegalArgumentException success) {}
192      }
# Line 236 | Line 231 | public class ThreadLocalRandomTest exten
231          }
232      }
233  
239
234      /**
235       * nextDouble(least, bound) returns least <= value < bound;
236       * repeated calls produce at least one different result
# Line 258 | Line 252 | public class ThreadLocalRandomTest exten
252          }
253      }
254  
261
255   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines