Search in sources :

Example 1 with HashSlotCursor12byteKey

use of com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey in project hazelcast by hazelcast.

the class HashSlotArray12byteKeyImplTest method testCursor_advance_whenEmpty.

@Test
public void testCursor_advance_whenEmpty() {
    HashSlotCursor12byteKey cursor = hsa.cursor();
    assertFalse(cursor.advance());
}
Also used : HashSlotCursor12byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with HashSlotCursor12byteKey

use of com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey in project hazelcast by hazelcast.

the class HashSlotArray12byteKeyImplTest method testCursor_advance.

@Test
public void testCursor_advance() {
    insert(randomKey(), randomKey());
    HashSlotCursor12byteKey cursor = hsa.cursor();
    assertTrue(cursor.advance());
    assertFalse(cursor.advance());
}
Also used : HashSlotCursor12byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 3 with HashSlotCursor12byteKey

use of com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey in project hazelcast by hazelcast.

the class HashSlotArray12byteKeyImplTest method testCursor_advance_whenDisposed.

@Test(expected = AssertionError.class)
public void testCursor_advance_whenDisposed() {
    HashSlotCursor12byteKey cursor = hsa.cursor();
    hsa.dispose();
    cursor.advance();
}
Also used : HashSlotCursor12byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 4 with HashSlotCursor12byteKey

use of com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey in project hazelcast by hazelcast.

the class HashSlotArray12byteKeyImplTest method testCursor_key1.

@Test
public void testCursor_key1() {
    final long key1 = randomKey();
    final int key2 = randomKey();
    insert(key1, key2);
    HashSlotCursor12byteKey cursor = hsa.cursor();
    cursor.advance();
    assertEquals(key1, cursor.key1());
}
Also used : HashSlotCursor12byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 5 with HashSlotCursor12byteKey

use of com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey in project hazelcast by hazelcast.

the class HashSlotArray12byteKeyImplTest method testCursor_key2_withoutAdvance.

@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_key2_withoutAdvance() {
    HashSlotCursor12byteKey cursor = hsa.cursor();
    cursor.key2();
}
Also used : HashSlotCursor12byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey) RequireAssertEnabled(com.hazelcast.test.RequireAssertEnabled) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

HashSlotCursor12byteKey (com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey)14 QuickTest (com.hazelcast.test.annotation.QuickTest)14 Test (org.junit.Test)14 RequireAssertEnabled (com.hazelcast.test.RequireAssertEnabled)4