Skip to content

Commit

Permalink
Output test signatures under /target/out.
Browse files Browse the repository at this point in the history
  • Loading branch information
luisgoncalves committed Sep 11, 2014
1 parent 865aa04 commit a1d6de8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/test/java/xades4j/utils/SignatureServicesTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,18 @@ public static Document getNewDocument() throws Exception
protected static void outputDocument(Document doc, String fileName) throws Exception
{
TransformerFactory tf = TransformerFactory.newInstance();
String path = toPlatformSpecificXMLDirFilePath("out/" + fileName);
FileOutputStream out = new FileOutputStream(path);
File outDir = ensureOutputDir();
FileOutputStream out = new FileOutputStream(new File(outDir, fileName));
tf.newTransformer().transform(
new DOMSource(doc),
new StreamResult(out));
out.close();
}

private static File ensureOutputDir()
{
File dir = new File(toPlatformSpecificFilePath("./target/out/"));
dir.mkdir();
return dir;
}
}

0 comments on commit a1d6de8

Please sign in to comment.