use of com.yahoo.jdisc.handler.ContentChannel in project vespa by vespa-engine.
the class ContainerShutdownTestCase method requireThatNullRequestContentWithEagerCloseResponseBlocksTermination.
@Test
public void requireThatNullRequestContentWithEagerCloseResponseBlocksTermination() {
MyRequestHandler requestHandler = MyRequestHandler.newNulContentWithEagerCloseResponse();
Context ctx = Context.newPendingRequest(requestHandler);
ContentChannel requestContent = ctx.request.connect(MyResponseHandler.newEagerCompletion());
ctx.request.release();
assertFalse(ctx.shutdown());
requestContent.close(null);
assertTrue(ctx.terminated);
assertTrue(ctx.driver.close());
}
use of com.yahoo.jdisc.handler.ContentChannel in project vespa by vespa-engine.
the class ContainerShutdownTestCase method requireThatOpenResponseBlocksTermination.
@Test
public void requireThatOpenResponseBlocksTermination() {
MyRequestHandler requestHandler = MyRequestHandler.newEagerCompletion();
Context ctx = Context.newPendingRequest(requestHandler);
ctx.request.connect(MyResponseHandler.newEagerCompletion()).close(null);
ctx.request.release();
ContentChannel responseContent = requestHandler.respond();
assertFalse(ctx.shutdown());
responseContent.close(null);
assertTrue(ctx.terminated);
assertTrue(ctx.driver.close());
}
use of com.yahoo.jdisc.handler.ContentChannel in project vespa by vespa-engine.
the class ContainerShutdownTestCase method requireThatOpenRequestBlocksTermination.
@Test
public void requireThatOpenRequestBlocksTermination() {
MyRequestHandler requestHandler = MyRequestHandler.newEagerCompletion();
Context ctx = Context.newPendingRequest(requestHandler);
ContentChannel requestContent = ctx.request.connect(MyResponseHandler.newEagerCompletion());
ctx.request.release();
requestHandler.respond().close(null);
assertFalse(ctx.shutdown());
requestContent.close(null);
assertTrue(ctx.terminated);
assertTrue(ctx.driver.close());
}
use of com.yahoo.jdisc.handler.ContentChannel in project vespa by vespa-engine.
the class ContainerShutdownTestCase method requireThatRequestCloseCompletionBlocksTermination.
@Test
public void requireThatRequestCloseCompletionBlocksTermination() {
MyRequestHandler requestHandler = MyRequestHandler.newEagerCloseResponse();
Context ctx = Context.newPendingRequest(requestHandler);
ContentChannel requestContent = ctx.request.connect(MyResponseHandler.newEagerCompletion());
ctx.request.release();
requestContent.close(MyCompletion.newInstance());
assertFalse(ctx.shutdown());
requestHandler.requestContent.closeCompletion.completed();
assertTrue(ctx.terminated);
assertTrue(ctx.driver.close());
}
use of com.yahoo.jdisc.handler.ContentChannel in project vespa by vespa-engine.
the class ContainerShutdownTestCase method requireThatRequestContentWriteExceptionDoesNotForceTermination.
@Test
public void requireThatRequestContentWriteExceptionDoesNotForceTermination() {
MyRequestHandler requestHandler = MyRequestHandler.newContentWriteExceptionWithEagerCompletion();
Context ctx = Context.newPendingRequest(requestHandler);
ContentChannel requestContent = ctx.request.connect(MyResponseHandler.newEagerCompletion());
try {
requestContent.write(ByteBuffer.allocate(69), null);
fail();
} catch (MyException e) {
// ignore
}
ctx.request.release();
requestHandler.respond().close(null);
assertFalse(ctx.shutdown());
requestContent.close(null);
assertTrue(ctx.terminated);
assertTrue(ctx.driver.close());
}
Aggregations