use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testAddAllSelf.
/**
* addAll(this) throws IAE
*/
public void testAddAllSelf() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
try {
q.addAll(q);
shouldThrow();
} catch (IllegalArgumentException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testPush.
/**
* peekFirst() returns element inserted with push
*/
public void testPush() {
ConcurrentLinkedDeque q = populatedDeque(3);
q.pollLast();
q.push(four);
assertSame(four, q.peekFirst());
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testPollLast.
/**
* pollLast() succeeds unless empty
*/
public void testPollLast() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
for (int i = SIZE - 1; i >= 0; --i) {
assertEquals(i, q.pollLast());
}
assertNull(q.pollLast());
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testRemove.
/**
* remove() removes next element, or throws NSEE if empty
*/
public void testRemove() {
ConcurrentLinkedDeque q = populatedDeque(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.remove());
}
try {
q.remove();
shouldThrow();
} catch (NoSuchElementException success) {
}
}
use of java.util.concurrent.ConcurrentLinkedDeque in project mapdb by jankotek.
the class ConcurrentLinkedDequeTest method testAdd.
/**
* add(x) succeeds
*/
public void testAdd() {
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque();
assertTrue(q.add(zero));
assertTrue(q.add(one));
assertSame(zero, q.peekFirst());
assertSame(one, q.peekLast());
}
Aggregations