From b8fa899f60c0a1ff34773f9036b56f685e053125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20Sta=CC=88rk?= Date: Sun, 24 May 2020 18:57:02 +0200 Subject: [PATCH] no message --- History.md | 3 +- .../library/extended/XMLValidatorTest.java | 29 +++++++++++++++++++ validator/src/test/resources/validV2.xml | 4 +-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/History.md b/History.md index 393decf74..0df62d91a 100644 --- a/History.md +++ b/History.md @@ -8,7 +8,8 @@ - complete or discard read into push provider - validate as library doc - javadoc export - +- prompt for source file for validation has to be pdf +- be able to disable "source pdf set to timeout" done - 2.1 now default - pushprovider diff --git a/validator/src/test/java/org/mustangproject/library/extended/XMLValidatorTest.java b/validator/src/test/java/org/mustangproject/library/extended/XMLValidatorTest.java index 707f5f6f3..36e755663 100644 --- a/validator/src/test/java/org/mustangproject/library/extended/XMLValidatorTest.java +++ b/validator/src/test/java/org/mustangproject/library/extended/XMLValidatorTest.java @@ -113,6 +113,35 @@ public void testZF2XMLValidation() { ctx.clear(); + try { + + tempFile = getResourceAsFile("validv2.xml"); + + xv.setFilename(tempFile.getAbsolutePath()); + + xv.validate(); + } catch (IrrecoverableValidationError e) { + // ignore, will be in XML output anyway + } + res = xv.getXMLResult(); + + content = "" + res + ""; + + assertThat(content).valueByXPath("count(//error)") + .asInt() + .isEqualTo(0); + + assertThat(content).valueByXPath("count(//notice)") + .asInt() + .isEqualTo(3); // 3 notices RE XRechnung + assertThat(content).valueByXPath("/validation/summary/@status") + .asString() + .isEqualTo("valid");// expect to be valid because XR notices are, well, only notices + assertThat(content).valueByXPath("/validation/xml/@status") + .asString() + .isEqualTo("valid"); + + ctx.clear(); tempFile = getResourceAsFile("validV2Basic.xml"); try { diff --git a/validator/src/test/resources/validV2.xml b/validator/src/test/resources/validV2.xml index 1ae1601a1..3381bee2e 100644 --- a/validator/src/test/resources/validV2.xml +++ b/validator/src/test/resources/validV2.xml @@ -2,7 +2,7 @@ - urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:en16931 + urn:cen.eu:en16931:2017#compliant:factur-x.eu:1p0:en16931 @@ -183,4 +183,4 @@ - \ No newline at end of file +