BuildFileGenerator { public String getBuildFileContent() throws ServerException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { this.doc = dbf.newDocumentBuilder().newDocument(); createRoot(); createProperty(); createBuild(); createClean(); return documentToString(doc); } catch (ParserConfigurationException | TransformerException e) { throw new ServerException(e.getMessage(), e); } } BuildFileGenerator(String projectName); String getBuildFileContent();  }
@Test public void testGenerateBuildFile() throws Exception { String genBuildFile = new BuildFileGenerator("test").getBuildFileContent(); String testBuildFile = getTestBuildFileContent(); assertEquals(genBuildFile, testBuildFile); }