Search in sources :

Example 21 with RequireAssertEnabled

use of com.hazelcast.test.RequireAssertEnabled 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)

Example 22 with RequireAssertEnabled

use of com.hazelcast.test.RequireAssertEnabled in project hazelcast by hazelcast.

the class HashSlotArray8byteKeyImplTest method testCursor_advance_afterAdvanceReturnsFalse.

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

Example 23 with RequireAssertEnabled

use of com.hazelcast.test.RequireAssertEnabled in project hazelcast by hazelcast.

the class HashSlotArray8byteKeyImplTest method testCursor_key_withoutAdvance.

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

use of com.hazelcast.test.RequireAssertEnabled 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

RequireAssertEnabled (com.hazelcast.test.RequireAssertEnabled)24 QuickTest (com.hazelcast.test.annotation.QuickTest)24 Test (org.junit.Test)24 HashSlotCursor16byteKey (com.hazelcast.internal.util.hashslot.HashSlotCursor16byteKey)11 HashSlotCursor8byteKey (com.hazelcast.internal.util.hashslot.HashSlotCursor8byteKey)6 HashSlotCursor12byteKey (com.hazelcast.internal.util.hashslot.HashSlotCursor12byteKey)4 ParallelTest (com.hazelcast.test.annotation.ParallelTest)3 DefaultOperationQueue (com.hazelcast.spi.impl.operationexecutor.impl.DefaultOperationQueue)2 OperationQueue (com.hazelcast.spi.impl.operationexecutor.impl.OperationQueue)2 PartitionOperationThread (com.hazelcast.spi.impl.operationexecutor.impl.PartitionOperationThread)2 NightlyTest (com.hazelcast.test.annotation.NightlyTest)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 MemberImpl (com.hazelcast.instance.MemberImpl)1 Address (com.hazelcast.nio.Address)1 UuidUtil.newUnsecureUuidString (com.hazelcast.util.UuidUtil.newUnsecureUuidString)1 InetAddress (java.net.InetAddress)1 HashMap (java.util.HashMap)1