use of com.hazelcast.test.RequireAssertEnabled 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();
}
use of com.hazelcast.test.RequireAssertEnabled in project hazelcast by hazelcast.
the class InterceptorRegistryTest method testDeregister_fromPartitionOperationThread.
@Test
@RequireAssertEnabled
public void testDeregister_fromPartitionOperationThread() throws Exception {
OperationQueue queue = new DefaultOperationQueue();
PartitionOperationThread thread = getPartitionOperationThread(queue);
thread.start();
registry.register(interceptor.id, interceptor);
final CountDownLatch latch = new CountDownLatch(1);
Object task = new Runnable() {
@Override
public void run() {
try {
registry.deregister(interceptor.id);
} catch (AssertionError e) {
e.printStackTrace();
latch.countDown();
}
}
};
queue.add(task, false);
latch.await();
thread.shutdown();
thread.join();
assertInterceptorRegistryContainsInterceptor();
}
use of com.hazelcast.test.RequireAssertEnabled in project hazelcast by hazelcast.
the class InterceptorRegistryTest method testRegister_fromPartitionOperationThread.
@Test
@RequireAssertEnabled
public void testRegister_fromPartitionOperationThread() throws Exception {
OperationQueue queue = new DefaultOperationQueue();
PartitionOperationThread thread = getPartitionOperationThread(queue);
thread.start();
final CountDownLatch latch = new CountDownLatch(1);
Object task = new Runnable() {
@Override
public void run() {
try {
registry.register(interceptor.id, interceptor);
} catch (AssertionError e) {
e.printStackTrace();
latch.countDown();
}
}
};
queue.add(task, false);
latch.await();
thread.shutdown();
thread.join();
assertInterceptorRegistryContainsNotInterceptor();
}
use of com.hazelcast.test.RequireAssertEnabled in project hazelcast by hazelcast.
the class HashSlotArray12byteKeyImplTest method testCursor_valueAddress_withoutAdvance.
@Test(expected = AssertionError.class)
@RequireAssertEnabled
public void testCursor_valueAddress_withoutAdvance() {
HashSlotCursor12byteKey cursor = hsa.cursor();
cursor.valueAddress();
}
use of com.hazelcast.test.RequireAssertEnabled 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) {
}
}
Aggregations