Search in sources :

Example 11 with HashSlotCursor12byteKey

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

the class HashSlotArray12byteKeyImplTest method testCursor_key2_whenDisposed.

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

Example 12 with HashSlotCursor12byteKey

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

the class HashSlotArray12byteKeyImplTest method testCursor_valueAddress.

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

Example 13 with HashSlotCursor12byteKey

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

the class HashSlotArray12byteKeyImplTest method testCursor_valueAddress_whenDisposed.

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

Example 14 with HashSlotCursor12byteKey

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

the class HashSlotArray12byteKeyImplTest method testCursor_advance_afterAdvanceReturnsFalse.

@Test
@RequireAssertEnabled
public void testCursor_advance_afterAdvanceReturnsFalse() {
    insert(randomKey(), randomKey());
    HashSlotCursor12byteKey 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 : 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