Skip to content

Commit

Permalink
Adjust test for loop syntax position beyond last loop index
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeEdgar committed Jul 12, 2020
1 parent f77f27a commit 741cdc8
Show file tree
Hide file tree
Showing 3 changed files with 673 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,15 @@ void testEDIFACT_BothGroupAndTransactionUsed() throws EDIStreamException {
}

@Test
void testEDIFACT_NeitherGroupNorTransactionUsed() throws EDIStreamException {
void testEDIFACT_NeitherGroupNorTransactionUsed() throws EDIStreamException, EDISchemaException {
EDIInputFactory factory = EDIInputFactory.newFactory();
InputStream stream = new ByteArrayInputStream((""
+ "UNB+UNOA:4:::02+005435656:1+006415160:1+20060515:1434+00000000000001'"
+ "UNZ+0+00000000000001'").getBytes());

EDIStreamReader reader = factory.createEDIStreamReader(stream);
reader.next(); // Advance to interchange start
reader.setControlSchema(SchemaFactory.newFactory().createSchema(getClass().getResource("/EDIFACT/v4r02-bogus-syntax-position.xml")));
reader = factory.createFilteredReader(reader, errorFilter);

assertTrue(reader.hasNext(), "Expected errors not found");
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/EDIFACT/CONTRL-v4r02.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
</loop>
</sequence>
<syntax type="exclusion">
<position>2</position><!-- Loop L0001 -->
<position>3</position>
<position>2</position><!-- Loop SG1 -->
<position>3</position><!-- Loop SG3 -->
</syntax>
</transaction>
<elementType name="DE0004" number="4" base="string" maxLength="35" />
Expand Down
Loading

0 comments on commit 741cdc8

Please sign in to comment.