use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testAddFirstNull.
/**
* addFirst(null) throws NPE
*/
public void testAddFirstNull() {
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
try {
q.addFirst(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testFirstElement.
/**
* getFirst() returns first element, or throws NSEE if empty
*/
public void testFirstElement() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.getFirst());
assertEquals(i, q.pollFirst());
}
try {
q.getFirst();
shouldThrow();
} catch (NoSuchElementException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testPoll.
/**
* poll() succeeds unless empty
*/
public void testPoll() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.poll());
}
assertNull(q.poll());
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testOfferFirstNull.
/**
* offerFirst(null) throws NPE
*/
public void testOfferFirstNull() {
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
try {
q.offerFirst(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testPop.
/**
* pop() removes first element, or throws NSEE if empty
*/
public void testPop() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.pop());
}
try {
q.pop();
shouldThrow();
} catch (NoSuchElementException success) {
}
}
Aggregations