Skip to content

Commit

Permalink
Verify no Abort when documentPart has no type
Browse files Browse the repository at this point in the history
- add test to verify no abort when suite has invalid tdml

DAFFODIL-561
  • Loading branch information
olabusayoT committed Sep 30, 2024
1 parent e02ae7f commit d93c213
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -835,4 +835,26 @@ class UnitTestTDMLRunner {
assertEquals(doc2bits, doc1bits)
}

@Test def testDocumentPartNoType(): Unit = {
val xml = <testSuite xmlns={
tdml
} ID="suite identifier" suiteName="theSuiteName" description="Some Test Suite Description">
<parserTestCase name="test1" root="byte1" model="test-suite/ibm-contributed/dpanum.dfdl.xsd" description="Some test case description.">
<document>
<documentPart>test/tdml/test.txt</documentPart>
</document>
<infoset>
<dfdlInfoset xmlns:xs={xsd} xmlns:xsi={xsi}>
<byte1 xsi:type="xs:byte">123</byte1>
</dfdlInfoset>
</infoset>
</parserTestCase>
</testSuite>
val runner = new Runner(xml)
val e = intercept[TDMLException] {
runner.runOneTest("test1")
}
assertTrue(e.getMessage().contains("'type' must appear on element 'documentPart'"))
}

}

0 comments on commit d93c213

Please sign in to comment.