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.2 by jsr166, Fri Jul 31 23:37:31 2009 UTC vs.
Revision 1.6 by jsr166, Tue Dec 1 06:47:14 2009 UTC

# Line 11 | Line 11 | import java.util.*;
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      /**
# Line 41 | Line 41 | public class ThreadLocalRandomTest exten
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      /**
# Line 118 | Line 118 | public class ThreadLocalRandomTest exten
118       */
119      public void testNextIntBoundedNeg() {
120          try {
121 <            int  f = ThreadLocalRandom.current().nextInt(-17);
122 <        } catch (IllegalArgumentException success) {
123 <        }
121 >            int f = ThreadLocalRandom.current().nextInt(-17);
122 >            shouldThrow();
123 >        } catch (IllegalArgumentException success) {}
124      }
125  
126      /**
# Line 128 | Line 128 | public class ThreadLocalRandomTest exten
128       */
129      public void testNextIntBadBounds() {
130          try {
131 <            int  f = ThreadLocalRandom.current().nextInt(17, 2);
132 <        } catch (IllegalArgumentException success) {
133 <        }
131 >            int f = ThreadLocalRandom.current().nextInt(17, 2);
132 >            shouldThrow();
133 >        } catch (IllegalArgumentException success) {}
134      }
135  
136  
# Line 181 | Line 181 | public class ThreadLocalRandomTest exten
181       */
182      public void testNextLongBoundedNeg() {
183          try {
184 <            long  f = ThreadLocalRandom.current().nextLong(-17);
185 <        } catch (IllegalArgumentException success) {
186 <        }
184 >            long f = ThreadLocalRandom.current().nextLong(-17);
185 >            shouldThrow();
186 >        } catch (IllegalArgumentException success) {}
187      }
188  
189      /**
# Line 191 | Line 191 | public class ThreadLocalRandomTest exten
191       */
192      public void testNextLongBadBounds() {
193          try {
194 <            long  f = ThreadLocalRandom.current().nextLong(17, 2);
195 <        } catch (IllegalArgumentException success) {
196 <        }
194 >            long f = ThreadLocalRandom.current().nextLong(17, 2);
195 >            shouldThrow();
196 >        } catch (IllegalArgumentException success) {}
197      }
198  
199      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines