@Test public void writesTransformedContentToOutputStream() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); final String transformedContent = "<xml/>"; doAnswer(doTransformation(out, transformedContent)).when(transformer).transform(same(source), isA(StreamResult.class)); xsltStreamingOutput.write(out); assertEquals(transformedContent, out.toString()); }
@Override public void write(OutputStream output) throws IOException { try { Transformer transformer = templates.newTransformer(); transformer.transform(source, new StreamResult(output)); } catch (TransformerException tre) { throw new IOException(tre.getMessage(), tre); } }
XSLTStreamingOutput implements StreamingOutput { @Override public void write(OutputStream output) throws IOException { try { Transformer transformer = templates.newTransformer(); transformer.transform(source, new StreamResult(output)); } catch (TransformerException tre) { throw new IOException(tre.getMessage(), tre); } } }
XSLTStreamingOutput implements StreamingOutput { @Override public void write(OutputStream output) throws IOException { try { Transformer transformer = templates.newTransformer(); transformer.transform(source, new StreamResult(output)); } catch (TransformerException tre) { throw new IOException(tre.getMessage(), tre); } } XSLTStreamingOutput(Source source, Templates templates); }
XSLTStreamingOutput implements StreamingOutput { @Override public void write(OutputStream output) throws IOException { try { Transformer transformer = templates.newTransformer(); transformer.transform(source, new StreamResult(output)); } catch (TransformerException tre) { throw new IOException(tre.getMessage(), tre); } } XSLTStreamingOutput(Source source, Templates templates); @Override void write(OutputStream output); }
XSLTStreamingOutput implements StreamingOutput { @Override public void write(OutputStream output) throws IOException { try { Transformer transformer = templates.newTransformer(); transformer.transform(source, new StreamResult(output)); } catch (TransformerException tre) { throw new IOException(tre.getMessage(), tre); } } XSLTStreamingOutput(Source source, Templates templates); @Override void write(OutputStream output);  }