use of org.infinispan.interceptors.InvocationStage in project infinispan by infinispan.
the class CacheMgmtInterceptorTest method testVisitGetKeyValueCommand.
public void testVisitGetKeyValueCommand() throws Throwable {
GetKeyValueCommand command = new GetKeyValueCommand(KEY, 0, 0);
InvocationStage stage = makeStage(interceptor.visitGetKeyValueCommand(ctx, command));
assertFalse(stage.isDone());
timeService.advance(1);
nextInterceptor.completeLastInvocation(null);
assertNull(stage.get());
assertEquals(1, interceptor.getAverageReadTime());
}
use of org.infinispan.interceptors.InvocationStage in project infinispan by infinispan.
the class CacheMgmtInterceptorTest method testVisitPutMapCommand.
public void testVisitPutMapCommand() throws Throwable {
PutMapCommand command = new PutMapCommand(Collections.singletonMap(KEY, VALUE), null, 0, null);
InvocationStage stage = makeStage(interceptor.visitPutMapCommand(ctx, command));
assertFalse(stage.isDone());
timeService.advance(1);
nextInterceptor.completeLastInvocation(null);
assertNull(stage.get());
assertEquals(1, interceptor.getAverageWriteTime());
}
use of org.infinispan.interceptors.InvocationStage in project infinispan by infinispan.
the class CacheMgmtInterceptorTest method testVisitPutKeyValueCommand.
public void testVisitPutKeyValueCommand() throws Throwable {
PutKeyValueCommand command = new PutKeyValueCommand(KEY, VALUE, false, null, 0, 0, null);
InvocationStage stage = makeStage(interceptor.visitPutKeyValueCommand(ctx, command));
assertFalse(stage.isDone());
timeService.advance(1);
nextInterceptor.completeLastInvocation(null);
assertNull(stage.get());
assertEquals(1, interceptor.getAverageWriteTime());
}
use of org.infinispan.interceptors.InvocationStage in project infinispan by infinispan.
the class CacheMgmtInterceptorTest method testVisitGetAllCommand.
public void testVisitGetAllCommand() throws Throwable {
GetAllCommand command = new GetAllCommand(Collections.singleton(KEY), 0, false);
InvocationStage stage = makeStage(interceptor.visitGetAllCommand(ctx, command));
assertFalse(stage.isDone());
timeService.advance(1);
nextInterceptor.completeLastInvocation(Collections.emptyMap());
assertEquals(Collections.emptyMap(), stage.get());
assertEquals(1, interceptor.getAverageReadTime());
}
use of org.infinispan.interceptors.InvocationStage in project infinispan by infinispan.
the class CacheMgmtInterceptorTest method testVisitReplaceCommandException.
public void testVisitReplaceCommandException() throws Throwable {
ReplaceCommand command = new ReplaceCommand(KEY, VALUE, false, null, 0, 0, null);
InvocationStage stage = makeStage(interceptor.visitReplaceCommand(ctx, command));
assertFalse(stage.isDone());
timeService.advance(1);
nextInterceptor.completeLastInvocationExceptionally(new TestException());
expectInvocationException(stage);
assertEquals(1, interceptor.getAverageWriteTime());
}
Aggregations