Search in sources :

Example 1 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_valueAddress_withoutAdvance.

@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_valueAddress_withoutAdvance() {
    HashSlotCursor8byteKey cursor = hsa.cursor();
    cursor.valueAddress();
}
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 2 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_valueAddress_whenDisposed.

@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_valueAddress_whenDisposed() {
    HashSlotCursor8byteKey cursor = hsa.cursor();
    hsa.dispose();
    cursor.valueAddress();
}
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 3 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_withManyValues.

@Test
public void testCursor_withManyValues() {
    final int k = 1000;
    for (int i = 1; i <= k; i++) {
        long key = (long) i;
        insert(key);
    }
    boolean[] verifiedKeys = new boolean[k];
    HashSlotCursor8byteKey cursor = hsa.cursor();
    while (cursor.advance()) {
        long key = cursor.key();
        long valueAddress = cursor.valueAddress();
        verifyValue(key, valueAddress);
        verifiedKeys[((int) key) - 1] = true;
    }
    for (int i = 0; i < k; i++) {
        assertTrue("Failed to encounter key " + i, verifiedKeys[i]);
    }
}
Also used : HashSlotCursor8byteKey(com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 4 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_key_whenDisposed.

@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_key_whenDisposed() {
    HashSlotCursor8byteKey cursor = hsa.cursor();
    hsa.dispose();
    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 5 with HashSlotCursor8byteKey

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

the class HashSlotArray8byteKeyImplTest method testCursor_advance_whenDisposed.

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