コード例 #1
0
 /** addAll(this) throws IAE */
 public void testAddAllSelf() {
   try {
     Succeed q = new Succeed();
     q.addAll(q);
     shouldThrow();
   } catch (IllegalArgumentException success) {
   }
 }
コード例 #2
0
 /** addAll(null) throws NPE */
 public void testAddAll1() {
   try {
     Succeed q = new Succeed();
     q.addAll(null);
     shouldThrow();
   } catch (NullPointerException success) {
   }
 }
コード例 #3
0
 /** addAll of a collection with null elements throws NPE */
 public void testAddAll2() {
   try {
     Succeed q = new Succeed();
     Integer[] ints = new Integer[SIZE];
     q.addAll(Arrays.asList(ints));
     shouldThrow();
   } catch (NullPointerException success) {
   }
 }
コード例 #4
0
 /**
  * addAll of a collection with any null elements throws NPE after possibly adding some elements
  */
 public void testAddAll3() {
   try {
     Succeed q = new Succeed();
     Integer[] ints = new Integer[SIZE];
     for (int i = 0; i < SIZE - 1; ++i) ints[i] = new Integer(i);
     q.addAll(Arrays.asList(ints));
     shouldThrow();
   } catch (NullPointerException success) {
   }
 }