/** addAll(this) throws IAE */ public void testAddAllSelf() { try { Succeed q = new Succeed(); q.addAll(q); shouldThrow(); } catch (IllegalArgumentException success) { } }
/** add throws NPE if offer does */ public void testAddNPE() { Succeed q = new Succeed(); try { q.add(null); shouldThrow(); } catch (NullPointerException success) { } }
/** addAll(null) throws NPE */ public void testAddAll1() { try { Succeed q = new Succeed(); q.addAll(null); shouldThrow(); } catch (NullPointerException success) { } }
/** 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) { } }
/** * 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) { } }
/** remove returns normally if poll succeeds */ public void testRemoveS() { Succeed q = new Succeed(); q.remove(); }
/** add returns true if offer succeeds */ public void testAddS() { Succeed q = new Succeed(); assertTrue(q.add(two)); }
/** element returns normally if peek succeeds */ public void testElementS() { Succeed q = new Succeed(); q.element(); }