use of com.hazelcast.spi.impl.operationexecutor.impl.OperationQueue 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.spi.impl.operationexecutor.impl.OperationQueue 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();
}
Aggregations