@Test public void processStringLiteral() throws DriverException, IOException { final String input = "{\"content\":\"class String_Test { String s = \\\"b\\\\nc\\\\41\\\"; \\r\\n }\"}"; final Driver driver = process(input); driver.processOne(); String json = driver.writer.out.toString(); final ObjectNode node = new ObjectMapper().readValue(json, ObjectNode.class); JsonNode newNode = node.findPath("unescapedValue"); assertThat(newNode.isMissingNode()).isFalse(); assertThat(newNode.asText()).isEqualTo("b\nc!"); }
public void processOne() throws DriverException, CloseException { Request request; try { request = this.reader.read(); } catch (CloseException ex) { throw ex; } catch (Exception ex) { final Response response = createFatalResponse(ex); try { this.writer.write(response); } catch (IOException ex2) { throw new DriverException("exception while writing fatal response", ex2); } return; } final Response response = this.processRequest(request); this.writer.setContent(request.content); try { this.writer.write(response); } catch (IOException ex) { throw new DriverException("exception writing response", ex); } }
Driver { public void processOne() throws DriverException, CloseException { Request request; try { request = this.reader.read(); } catch (CloseException ex) { throw ex; } catch (Exception ex) { final Response response = createFatalResponse(ex); try { this.writer.write(response); } catch (IOException ex2) { throw new DriverException("exception while writing fatal response", ex2); } return; } final Response response = this.processRequest(request); this.writer.setContent(request.content); try { this.writer.write(response); } catch (IOException ex) { throw new DriverException("exception writing response", ex); } } }
Driver { public void processOne() throws DriverException, CloseException { Request request; try { request = this.reader.read(); } catch (CloseException ex) { throw ex; } catch (Exception ex) { final Response response = createFatalResponse(ex); try { this.writer.write(response); } catch (IOException ex2) { throw new DriverException("exception while writing fatal response", ex2); } return; } final Response response = this.processRequest(request); this.writer.setContent(request.content); try { this.writer.write(response); } catch (IOException ex) { throw new DriverException("exception writing response", ex); } } Driver(final RequestReader reader, final ResponseWriter writer); }
Driver { public void processOne() throws DriverException, CloseException { Request request; try { request = this.reader.read(); } catch (CloseException ex) { throw ex; } catch (Exception ex) { final Response response = createFatalResponse(ex); try { this.writer.write(response); } catch (IOException ex2) { throw new DriverException("exception while writing fatal response", ex2); } return; } final Response response = this.processRequest(request); this.writer.setContent(request.content); try { this.writer.write(response); } catch (IOException ex) { throw new DriverException("exception writing response", ex); } } Driver(final RequestReader reader, final ResponseWriter writer); void run(); void processOne(); }
Driver { public void processOne() throws DriverException, CloseException { Request request; try { request = this.reader.read(); } catch (CloseException ex) { throw ex; } catch (Exception ex) { final Response response = createFatalResponse(ex); try { this.writer.write(response); } catch (IOException ex2) { throw new DriverException("exception while writing fatal response", ex2); } return; } final Response response = this.processRequest(request); this.writer.setContent(request.content); try { this.writer.write(response); } catch (IOException ex) { throw new DriverException("exception writing response", ex); } } Driver(final RequestReader reader, final ResponseWriter writer); void run(); void processOne();  }