public Response.Content index() throws IOException {
final Request request = Request.getCurrent();
final ScopeController controller = request.getScopeController();
AbstractRunnableAsyncTestCase.requestURL = "" + A_.index();
AbstractRunnableAsyncTestCase.requestDestroyed = AbstractRunnableAsyncTestCase.destroyed.get();
final ChunkBuffer content = new ChunkBuffer();
Runnable task = new Runnable() {
public void run() {
ContextLifeCycle lf = request.suspend();
try {
Thread.sleep(500);
AbstractRunnableAsyncTestCase.runnableURL = "" + A_.index();
AbstractRunnableAsyncTestCase.runnableDestroyed = AbstractRunnableAsyncTestCase.destroyed.get();
AbstractRunnableAsyncTestCase.runnableActive = controller.isActive();
content.append(Chunk.create("pass"));
}
catch (Exception e) {
e.printStackTrace();
} finally {
lf.resume();
content.close();
}
}
};
context.getExecutor().execute(task);
return Response.content(200, content);