Search in sources :

Example 6 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyNoValueTest method testCursor_key2.

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

Example 7 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyNoValueTest method testCursor_advance.

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

Example 8 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_advance_whenEmpty.

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

Example 9 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_key1_whenDisposed.

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

Example 10 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_valueAddress_whenDisposed.

@Test(expected = AssertionError.class)
public void testCursor_valueAddress_whenDisposed() {
    HashSlotCursor16byteKey cursor = hsa.cursor();
    hsa.dispose();
    cursor.valueAddress();
}
Also used : HashSlotCursor16byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor16byteKey) 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