attenpt to test

This commit is contained in:
jstaerk
2025-06-03 12:02:02 +02:00
parent 0229ea710d
commit 3aca11d9e7

View File

@@ -32,6 +32,8 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.Date;
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class VisualizationTest extends ResourceCase { public class VisualizationTest extends ResourceCase {
@@ -47,6 +49,24 @@ public class VisualizationTest extends ResourceCase {
this.runZUGFeRDVisualization("factur-x-extended.xml", "factur-x-vis-extended.de.html", Language.DE); this.runZUGFeRDVisualization("factur-x-extended.xml", "factur-x-vis-extended.de.html", Language.DE);
} }
public void testCIIVisualizationExtended2() {
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
String result = null;
try {
result = zvi.visualize("C:\\Users\\jstaerk\\Desktop\\test.txt", Language.DE);
Files.write(Paths.get("c:\\Users\\jstaerk\\temp\\res.html"), result.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
} catch (TransformerException e) {
throw new RuntimeException(e);
} catch (ParserConfigurationException e) {
throw new RuntimeException(e);
}
}
public void testUBLCreditNoteVisualizationBasic() { public void testUBLCreditNoteVisualizationBasic() {
this.runZUGFeRDVisualization("ubl-creditnote.xml", "factur-x-vis-ubl-creditnote.en.html", Language.EN); this.runZUGFeRDVisualization("ubl-creditnote.xml", "factur-x-vis-ubl-creditnote.en.html", Language.EN);
} }
@@ -81,6 +101,14 @@ public class VisualizationTest extends ResourceCase {
fail("ParserConfigurationException should not happen: " + e.getMessage()); fail("ParserConfigurationException should not happen: " + e.getMessage());
} }
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy-HH_mm_ss");
try {
String datePart=formatter.format(new Date());
Files.write( Paths.get("c:\\Users\\jstaerk\\temp\\res"+datePart+".txt"), result.getBytes());
Files.write( Paths.get("c:\\Users\\jstaerk\\temp\\exp"+datePart+".txt"), expected.getBytes());
} catch (IOException e) {
throw new RuntimeException(e);
}
assertNotNull(result); assertNotNull(result);
/* remove file endings so that tests can also pass after checking /* remove file endings so that tests can also pass after checking
out from git with arbitrary options (which may include CSRF changes) out from git with arbitrary options (which may include CSRF changes)
@@ -94,6 +122,7 @@ public class VisualizationTest extends ResourceCase {
.replace(" ", "")); .replace(" ", ""));
} }
public void testPDFVisualizationCII() { public void testPDFVisualizationCII() {
File CIIinputFile = getResourceAsFile("cii/01.01a-INVOICE.cii.xml"); File CIIinputFile = getResourceAsFile("cii/01.01a-INVOICE.cii.xml");