use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testEmptyIterator.
/**
* iterator of empty collection has no elements
*/
public void testEmptyIterator() {
Deque c = new ConcurrentLinkedDeque();
assertIteratorExhausted(c.iterator());
assertIteratorExhausted(c.descendingIterator());
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testAddAll2.
/**
* addAll of a collection with null elements throws NPE
*/
public void testAddAll2() {
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
try {
q.addAll(Arrays.asList(new Integer[SIZE]));
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testOfferNull.
/**
* offer(null) throws NPE
*/
public void testOfferNull() {
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
try {
q.offer(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testPushNull.
/**
* push(null) throws NPE
*/
public void testPushNull() {
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
try {
q.push(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testPeekFirst.
/**
* peekFirst() returns next element, or null if empty
*/
public void testPeekFirst() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.peekFirst());
assertEquals(i, q.pollFirst());
assertTrue(q.peekFirst() == null || !q.peekFirst().equals(i));
}
assertNull(q.peekFirst());
}
Aggregations