Пример #1
0
 /** addAll(this) throws IAE */
 public void testAddAllSelf() {
   try {
     Succeed q = new Succeed();
     q.addAll(q);
     shouldThrow();
   } catch (IllegalArgumentException success) {
   }
 }
Пример #2
0
 /** add throws NPE if offer does */
 public void testAddNPE() {
   Succeed q = new Succeed();
   try {
     q.add(null);
     shouldThrow();
   } catch (NullPointerException success) {
   }
 }
Пример #3
0
 /** addAll(null) throws NPE */
 public void testAddAll1() {
   try {
     Succeed q = new Succeed();
     q.addAll(null);
     shouldThrow();
   } catch (NullPointerException success) {
   }
 }
Пример #4
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) {
   }
 }
Пример #5
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) {
   }
 }
Пример #6
0
 /** remove returns normally if poll succeeds */
 public void testRemoveS() {
   Succeed q = new Succeed();
   q.remove();
 }
Пример #7
0
 /** add returns true if offer succeeds */
 public void testAddS() {
   Succeed q = new Succeed();
   assertTrue(q.add(two));
 }
Пример #8
0
 /** element returns normally if peek succeeds */
 public void testElementS() {
   Succeed q = new Succeed();
   q.element();
 }