use of com.yahoo.jdisc.TimeoutManager in project vespa by vespa-engine.
the class TimeoutManagerImplTestCase method requireThatNoEntryIsMadeIfTimeoutHandlerHasBeenSet.
@Test
public void requireThatNoEntryIsMadeIfTimeoutHandlerHasBeenSet() {
final Context ctx = new Context(MyRequestHandler.newInstance());
new RequestDispatch() {
@Override
protected Request newRequest() {
Request request = new Request(ctx.driver, URI.create(REQUEST_URI));
request.setTimeout(10, TimeUnit.MILLISECONDS);
request.setTimeoutManager(new TimeoutManager() {
@Override
public void scheduleTimeout(Request request) {
}
});
return request;
}
}.dispatch();
assertFalse(ctx.awaitQueueSize(1, 100, TimeUnit.MILLISECONDS));
assertTrue(ctx.awaitQueueSize(0, 600, TimeUnit.SECONDS));
ctx.requestHandler.respond();
assertTrue(ctx.close());
}
Aggregations