Search in sources :

Example 16 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyNoValueTest method testCursor_advance_whenDisposed.

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

Example 17 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyNoValueTest method testCursor_key1.

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

Example 18 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_key1.

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

Example 19 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_advance_afterAdvanceReturnsFalse.

@Test
@RequireAssertEnabled
public void testCursor_advance_afterAdvanceReturnsFalse() {
    insert(randomKey(), randomKey());
    HashSlotCursor16byteKey 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 : HashSlotCursor16byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor16byteKey) RequireAssertEnabled(com.hazelcast.test.RequireAssertEnabled) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 20 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_valueAddress_withoutAdvance.

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

Aggregations

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