@Test(expected = IOException.class) public void throwsIoExceptionWhenTransformationFails() throws Exception { doThrow(TransformerException.class).when(transformer).transform(same(source), isA(StreamResult.class)); ByteArrayOutputStream out = new ByteArrayOutputStream(); xsltStreamingOutput.write(out); }
@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);  }