Methods Summary |
---|
public static void | main(java.lang.String[] args)
junit.textui.TestRunner.run (suite());
|
public static junit.framework.Test | suite()
return new TestSuite(AbstractQueueTest.class);
|
public void | testAddAll1()addAll(null) throws NPE
try {
Succeed q = new Succeed();
q.addAll(null);
shouldThrow();
}
catch (NullPointerException success) {}
|
public void | testAddAll2()addAll of a collection with null elements throws NPE
try {
Succeed q = new Succeed();
Integer[] ints = new Integer[SIZE];
q.addAll(Arrays.asList(ints));
shouldThrow();
}
catch (NullPointerException success) {}
|
public void | testAddAll3()addAll of a collection with any null elements throws NPE after
possibly adding some elements
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) {}
|
public void | testAddAll4()addAll throws ISE if an add fails
try {
Fail q = new Fail();
Integer[] ints = new Integer[SIZE];
for (int i = 0; i < SIZE; ++i)
ints[i] = new Integer(i);
q.addAll(Arrays.asList(ints));
shouldThrow();
}
catch (IllegalStateException success) {}
|
public void | testAddAllSelf()addAll(this) throws IAE
try {
Succeed q = new Succeed();
q.addAll(q);
shouldThrow();
}
catch (IllegalArgumentException success) {}
|
public void | testAddF()add throws ISE true if offer fails
Fail q = new Fail();
try {
q.add(one);
shouldThrow();
} catch (IllegalStateException success) {
}
|
public void | testAddNPE()add throws NPE if offer does
Succeed q = new Succeed();
try {
q.add(null);
shouldThrow();
} catch (NullPointerException success) {
}
|
public void | testAddS()add returns true if offer succeeds
Succeed q = new Succeed();
assertTrue(q.add(two));
|
public void | testElementF()element throws NSEE if peek returns null
Fail q = new Fail();
try {
q.element();
shouldThrow();
} catch (NoSuchElementException success) {
}
|
public void | testElementS()element returns normally if peek succeeds
Succeed q = new Succeed();
q.element();
|
public void | testRemoveF()remove throws NSEE if poll returns null
Fail q = new Fail();
try {
q.remove();
shouldThrow();
} catch (NoSuchElementException success) {
}
|
public void | testRemoveS()remove returns normally if poll succeeds
Succeed q = new Succeed();
q.remove();
|