use of java.util.NavigableSet in project mapdb by jankotek.
the class TreeSubSetTest method testToArray.
/**
* toArray contains all elements in sorted order
*/
public void testToArray() {
NavigableSet q = populatedSet(SIZE);
Object[] o = q.toArray();
for (int i = 0; i < o.length; i++) assertSame(o[i], q.pollFirst());
}
use of java.util.NavigableSet in project mapdb by jankotek.
the class TreeSetTest method testSerialization.
/**
* A deserialized serialized set has same elements
*/
public void testSerialization() throws Exception {
NavigableSet x = populatedSet(SIZE);
NavigableSet y = serialClone(x);
assertNotSame(x, y);
assertEquals(x.size(), y.size());
assertEquals(x, y);
assertEquals(y, x);
while (!x.isEmpty()) {
assertFalse(y.isEmpty());
assertEquals(x.pollFirst(), y.pollFirst());
}
assertTrue(y.isEmpty());
}
use of java.util.NavigableSet in project mapdb by jankotek.
the class TreeSubSetTest method testDescendingToString.
/**
* toString contains toStrings of elements
*/
public void testDescendingToString() {
NavigableSet q = populatedSet(SIZE);
String s = q.toString();
for (int i = 0; i < SIZE; ++i) {
assertTrue(s.contains(String.valueOf(i)));
}
}
use of java.util.NavigableSet in project mapdb by jankotek.
the class TreeSubSetTest method testAddAll1.
/**
* addAll(null) throws NPE
*/
public void testAddAll1() {
NavigableSet q = set0();
try {
q.addAll(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.NavigableSet in project mapdb by jankotek.
the class TreeSubSetTest method testPoll.
/**
* poll succeeds unless empty
*/
public void testPoll() {
NavigableSet q = populatedSet(SIZE);
for (int i = 0; i < SIZE; ++i) {
assertEquals(i, q.pollFirst());
}
assertNull(q.pollFirst());
}
Aggregations