use of com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey in project hazelcast by hazelcast.
the class HashSlotArray8byteKeyImplTest method testCursor_valueAddress_withoutAdvance.
@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_valueAddress_withoutAdvance() {
HashSlotCursor8byteKey cursor = hsa.cursor();
cursor.valueAddress();
}
use of com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey in project hazelcast by hazelcast.
the class HashSlotArray8byteKeyImplTest method testCursor_valueAddress_whenDisposed.
@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_valueAddress_whenDisposed() {
HashSlotCursor8byteKey cursor = hsa.cursor();
hsa.dispose();
cursor.valueAddress();
}
use of com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey in project hazelcast by hazelcast.
the class HashSlotArray8byteKeyImplTest method testCursor_withManyValues.
@Test
public void testCursor_withManyValues() {
final int k = 1000;
for (int i = 1; i <= k; i++) {
long key = (long) i;
insert(key);
}
boolean[] verifiedKeys = new boolean[k];
HashSlotCursor8byteKey cursor = hsa.cursor();
while (cursor.advance()) {
long key = cursor.key();
long valueAddress = cursor.valueAddress();
verifyValue(key, valueAddress);
verifiedKeys[((int) key) - 1] = true;
}
for (int i = 0; i < k; i++) {
assertTrue("Failed to encounter key " + i, verifiedKeys[i]);
}
}
use of com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey in project hazelcast by hazelcast.
the class HashSlotArray8byteKeyImplTest method testCursor_key_whenDisposed.
@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_key_whenDisposed() {
HashSlotCursor8byteKey cursor = hsa.cursor();
hsa.dispose();
cursor.key();
}
use of com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey in project hazelcast by hazelcast.
the class HashSlotArray8byteKeyImplTest method testCursor_advance_whenDisposed.
@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_advance_whenDisposed() {
HashSlotCursor8byteKey cursor = hsa.cursor();
hsa.dispose();
cursor.advance();
}
Aggregations