HtmlRenderer { public final void render(final File xslFile, final File xmlFile, final File htmlFile) throws CommanderException { TransformerFactory tfactory = TransformerFactory.newInstance(); try { FileOutputStream fos = new FileOutputStream(htmlFile); Transformer transformer; transformer = tfactory.newTransformer(new StreamSource(xslFile)); transformer.transform(new StreamSource(xmlFile), new StreamResult(fos)); fos.close(); } catch (TransformerConfigurationException e) { throw new CommanderException("Could not configure transformer " + xslFile.getAbsolutePath(), e); } catch (TransformerException e) { throw new CommanderException( "Could not transform file " + xmlFile.getAbsolutePath(), e); } catch (FileNotFoundException e) { throw new CommanderException( "Could not create new file " + htmlFile.getAbsolutePath() + ". another blocked file or folder might already exist.", e); } catch (IOException e) { throw new CommanderException( "Could not save file " + htmlFile.getAbsolutePath(), e); } } HtmlRenderer(String aSystemName, String aRenderPath); void generateOutput(); final void render(final File xslFile, final File xmlFile,
            final File htmlFile); void mergeFiles(String entity, File sourceFolder); void generateFileList(final String entity, final File sourceFolder,
            final File targetFolder);  }
@Test public void renderTest() throws CommanderException { File indexTransformer = new File("config/transformer/index.xsl"); File indexSource = new File("src/test/resources/lists.xml"); File indexOutput = new File("src/test/resources/index.html"); indexOutput.delete(); HtmlRenderer renderer = new HtmlRenderer("", ""); renderer.render(indexTransformer, indexSource, indexOutput); Assert.assertTrue(indexOutput.isFile()); }