11 |
|
public class ThreadLocalRandomTest extends JSR166TestCase { |
12 |
|
|
13 |
|
public static void main(String[] args) { |
14 |
< |
junit.textui.TestRunner.run (suite()); |
14 |
> |
junit.textui.TestRunner.run (suite()); |
15 |
|
} |
16 |
|
public static Test suite() { |
17 |
< |
return new TestSuite(ThreadLocalRandomTest.class); |
17 |
> |
return new TestSuite(ThreadLocalRandomTest.class); |
18 |
|
} |
19 |
|
|
20 |
|
/** |
41 |
|
public void testSetSeed() { |
42 |
|
try { |
43 |
|
ThreadLocalRandom.current().setSeed(17); |
44 |
< |
} catch (UnsupportedOperationException success) { |
45 |
< |
} |
44 |
> |
shouldThrow(); |
45 |
> |
} catch (UnsupportedOperationException success) {} |
46 |
|
} |
47 |
|
|
48 |
|
/** |
119 |
|
public void testNextIntBoundedNeg() { |
120 |
|
try { |
121 |
|
int f = ThreadLocalRandom.current().nextInt(-17); |
122 |
< |
} catch (IllegalArgumentException success) { |
123 |
< |
} |
122 |
> |
shouldThrow(); |
123 |
> |
} catch (IllegalArgumentException success) {} |
124 |
|
} |
125 |
|
|
126 |
|
/** |
129 |
|
public void testNextIntBadBounds() { |
130 |
|
try { |
131 |
|
int f = ThreadLocalRandom.current().nextInt(17, 2); |
132 |
< |
} catch (IllegalArgumentException success) { |
133 |
< |
} |
132 |
> |
shouldThrow(); |
133 |
> |
} catch (IllegalArgumentException success) {} |
134 |
|
} |
135 |
|
|
136 |
|
|
182 |
|
public void testNextLongBoundedNeg() { |
183 |
|
try { |
184 |
|
long f = ThreadLocalRandom.current().nextLong(-17); |
185 |
< |
} catch (IllegalArgumentException success) { |
186 |
< |
} |
185 |
> |
shouldThrow(); |
186 |
> |
} catch (IllegalArgumentException success) {} |
187 |
|
} |
188 |
|
|
189 |
|
/** |
192 |
|
public void testNextLongBadBounds() { |
193 |
|
try { |
194 |
|
long f = ThreadLocalRandom.current().nextLong(17, 2); |
195 |
< |
} catch (IllegalArgumentException success) { |
196 |
< |
} |
195 |
> |
shouldThrow(); |
196 |
> |
} catch (IllegalArgumentException success) {} |
197 |
|
} |
198 |
|
|
199 |
|
/** |