Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Jochen Stärk authored and Jochen Stärk committed May 24, 2020
1 parent 5d2cdf2 commit b8fa899
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
3 changes: 2 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<validation>" + res + "</validation>";

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 {

Expand Down
4 changes: 2 additions & 2 deletions validator/src/test/resources/validV2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<rsm:CrossIndustryInvoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:en16931</ram:ID>
<ram:ID>urn:cen.eu:en16931:2017#compliant:factur-x.eu:1p0:en16931</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
Expand Down Expand Up @@ -183,4 +183,4 @@
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
</rsm:CrossIndustryInvoice>

0 comments on commit b8fa899

Please sign in to comment.