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

Comparing jsr166/src/test/tck/ConcurrentSkipListSetTest.java (file contents):
Revision 1.36 by jsr166, Sun Feb 22 04:34:44 2015 UTC vs.
Revision 1.39 by jsr166, Fri May 15 18:21:19 2015 UTC

# Line 21 | Line 21 | import junit.framework.TestSuite;
21  
22   public class ConcurrentSkipListSetTest extends JSR166TestCase {
23      public static void main(String[] args) {
24 <        junit.textui.TestRunner.run(suite());
24 >        main(suite(), args);
25      }
26      public static Test suite() {
27          return new TestSuite(ConcurrentSkipListSetTest.class);
# Line 87 | Line 87 | public class ConcurrentSkipListSetTest e
87       */
88      public void testConstructor4() {
89          try {
90 <            Integer[] ints = new Integer[SIZE];
91 <            new ConcurrentSkipListSet(Arrays.asList(ints));
90 >            new ConcurrentSkipListSet(Arrays.asList(new Integer[SIZE]));
91              shouldThrow();
92          } catch (NullPointerException success) {}
93      }
# Line 97 | Line 96 | public class ConcurrentSkipListSetTest e
96       * Initializing from Collection with some null elements throws NPE
97       */
98      public void testConstructor5() {
99 +        Integer[] ints = new Integer[SIZE];
100 +        for (int i = 0; i < SIZE-1; ++i)
101 +            ints[i] = new Integer(i);
102          try {
101            Integer[] ints = new Integer[SIZE];
102            for (int i = 0; i < SIZE-1; ++i)
103                ints[i] = new Integer(i);
103              new ConcurrentSkipListSet(Arrays.asList(ints));
104              shouldThrow();
105          } catch (NullPointerException success) {}
# Line 166 | Line 165 | public class ConcurrentSkipListSetTest e
165       * add(null) throws NPE
166       */
167      public void testAddNull() {
168 +        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
169          try {
170            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
170              q.add(null);
171              shouldThrow();
172          } catch (NullPointerException success) {}
# Line 195 | Line 194 | public class ConcurrentSkipListSetTest e
194       * Add of non-Comparable throws CCE
195       */
196      public void testAddNonComparable() {
197 +        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
198          try {
199            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
200            q.add(new Object());
199              q.add(new Object());
200              q.add(new Object());
201              shouldThrow();
# Line 208 | Line 206 | public class ConcurrentSkipListSetTest e
206       * addAll(null) throws NPE
207       */
208      public void testAddAll1() {
209 +        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
210          try {
212            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
211              q.addAll(null);
212              shouldThrow();
213          } catch (NullPointerException success) {}
# Line 219 | Line 217 | public class ConcurrentSkipListSetTest e
217       * addAll of a collection with null elements throws NPE
218       */
219      public void testAddAll2() {
220 +        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
221 +        Integer[] ints = new Integer[SIZE];
222          try {
223            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
224            Integer[] ints = new Integer[SIZE];
223              q.addAll(Arrays.asList(ints));
224              shouldThrow();
225          } catch (NullPointerException success) {}
# Line 232 | Line 230 | public class ConcurrentSkipListSetTest e
230       * possibly adding some elements
231       */
232      public void testAddAll3() {
233 +        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
234 +        Integer[] ints = new Integer[SIZE];
235 +        for (int i = 0; i < SIZE-1; ++i)
236 +            ints[i] = new Integer(i);
237          try {
236            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
237            Integer[] ints = new Integer[SIZE];
238            for (int i = 0; i < SIZE-1; ++i)
239                ints[i] = new Integer(i);
238              q.addAll(Arrays.asList(ints));
239              shouldThrow();
240          } catch (NullPointerException success) {}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines