Search in sources :

Example 6 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_advance_afterAdvanceReturnsFalse.

@Test
@RequireAssertEnabled
public void testCursor_advance_afterAdvanceReturnsFalse() {
    insert(random.nextLong());
    HashSlotCursor8byteKey cursor = hsa.cursor();
    cursor.advance();
    cursor.advance();
    try {
        cursor.advance();
        fail("cursor.advance() returned false, but subsequent call did not throw AssertionError");
    } catch (AssertionError ignored) {
    }
}
Also used : HashSlotCursor8byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey) RequireAssertEnabled(com.hazelcast.test.RequireAssertEnabled) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_advance_whenEmpty.

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

Example 8 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_key_withoutAdvance.

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

Example 9 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_advance.

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

Example 10 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_key.

@Test
public void testCursor_key() {
    final long key = random.nextLong();
    insert(key);
    HashSlotCursor8byteKey cursor = hsa.cursor();
    cursor.advance();
    assertEquals(key, cursor.key());
}
Also used : HashSlotCursor8byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

HashSlotCursor8byteKey (com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey)11 QuickTest (com.hazelcast.test.annotation.QuickTest)11 Test (org.junit.Test)11 RequireAssertEnabled (com.hazelcast.test.RequireAssertEnabled)6