@Test public void testProcessingRenderingWithStackTraces() throws IOException, InterruptedException { Exception exception=null; try { throw new RuntimeException("Thrown"); } catch (RuntimeException e) { exception=e; } StringDataList dataList = createDataList(); dataList.request().errors().add(new ErrorMessage("m1","d1",exception)); dataList.request().errors().add(new ErrorMessage("m2","d2")); assertEquals( "{\"errors\":[" + "{" + "\"error\":\"m1: d1: Thrown\"," + "\"stacktrace\":\"java.lang.RuntimeException: Thrown\\n\\tat com.yahoo.processing.rendering.AsynchronousSectionedRendererTest.", render(dataList).substring(0,157)); }
@Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } AsynchronousSectionedRenderer();  AsynchronousSectionedRenderer(Executor executor); }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } AsynchronousSectionedRenderer();  AsynchronousSectionedRenderer(Executor executor); abstract void beginResponse(OutputStream stream); abstract void beginList(DataList<?> list); abstract void data(Data data); abstract void endList(DataList<?> list); abstract void endResponse(); @Override final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response,
                                                  Execution execution, Request request); @Override void deconstruct(); final ListenableFuture<Boolean> renderBeforeHandover(OutputStream stream, RESPONSE response,
                                                                Execution execution, Request request); Execution getExecution(); Response getResponse(); int getRecursionLevel(); @Override final void setNetworkWiring(ContentChannel channel, CompletionHandler completionHandler); @Override void init(); }
AsynchronousSectionedRenderer extends AsynchronousRenderer<RESPONSE> { @Override public final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response, Execution execution, Request request) { if (beforeHandoverMode) { beforeHandoverMode = false; if ( ! dataListListenerStack.isEmpty() && dataListListenerStack.getFirst().list.incoming().isComplete()) { getExecutor().execute(dataListListenerStack.getFirst()); } return success; } else { return startRender(stream, response, execution, request); } } AsynchronousSectionedRenderer();  AsynchronousSectionedRenderer(Executor executor); abstract void beginResponse(OutputStream stream); abstract void beginList(DataList<?> list); abstract void data(Data data); abstract void endList(DataList<?> list); abstract void endResponse(); @Override final ListenableFuture<Boolean> render(OutputStream stream, RESPONSE response,
                                                  Execution execution, Request request); @Override void deconstruct(); final ListenableFuture<Boolean> renderBeforeHandover(OutputStream stream, RESPONSE response,
                                                                Execution execution, Request request); Execution getExecution(); Response getResponse(); int getRecursionLevel(); @Override final void setNetworkWiring(ContentChannel channel, CompletionHandler completionHandler); @Override void init();  }