Search in sources :

Example 1 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_key2.

@Test
public void testCursor_key2() {
    final long key1 = randomKey();
    final long key2 = randomKey();
    insert(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 2 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_key2_withoutAdvance.

@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_key2_withoutAdvance() {
    HashSlotCursor16byteKey cursor = hsa.cursor();
    cursor.key2();
}
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 3 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_key1_withoutAdvance.

// Cursor tests
@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_key1_withoutAdvance() {
    HashSlotCursor16byteKey cursor = hsa.cursor();
    cursor.key1();
}
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 4 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyImplTest method testCursor_advance.

@Test
public void testCursor_advance() {
    insert(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 5 with HashSlotCursor16byteKey

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

the class HashSlotArray16byteKeyNoValueTest method testCursor_valueAddress.

@Test
public void testCursor_valueAddress() {
    final long valueAddress = hsa.ensure(randomKey(), randomKey());
    HashSlotCursor16byteKey cursor = hsa.cursor();
    cursor.advance();
    assertEquals(valueAddress, 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