Skip to content

Commit 833961a

Browse files
committed
test for #1133
1 parent 9f22ce3 commit 833961a

2 files changed

Lines changed: 485 additions & 0 deletions

File tree

validator/src/test/java/org/mustangproject/validator/XMLValidatorTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import javax.xml.transform.Source;
66

7+
import org.junit.Test;
78
import org.xmlunit.builder.Input;
89
import org.xmlunit.xpath.JAXPXPathEngine;
910
import org.xmlunit.xpath.XPathEngine;
@@ -459,6 +460,24 @@ public void testSubInvoiceLineHierarchy() {
459460
// ignore, will be in XML output anyway
460461
}
461462

463+
xv.context.clear();
464+
tempFile = getResourceAsFile("X03_01_Abschlagsrechnung_SubInvoiceLine_u_LV_Nr.xml");
465+
try {
466+
xv.setFilename(tempFile.getAbsolutePath());
467+
xv.validate();
468+
469+
String s = "<validation>" + xv.getXMLResult() + "</validation>";
470+
// hierarchy mismatch should produce at least one warning
471+
assertThat(s).valueByXPath("count(//warning)")
472+
.asInt()
473+
.isEqualTo(0);
474+
475+
} catch (final IrrecoverableValidationError e) {
476+
// ignore, will be in XML output anyway
477+
}
478+
479+
480+
462481
}
463482

464483
}

0 commit comments

Comments
 (0)