This is an automated email from the ASF dual-hosted git repository.
olabusayo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git
The following commit(s) were added to refs/heads/main by this push:
new 7736d5fdd Verify no Abort when documentPart has no type
7736d5fdd is described below
commit 7736d5fddf784a6ec3b73321262ccdbc971acf9e
Author: olabusayoT <[email protected]>
AuthorDate: Mon Sep 23 16:00:45 2024 -0400
Verify no Abort when documentPart has no type
- add test to verify no abort when suite has invalid tdml
DAFFODIL-561
---
.../apache/daffodil/tdml/UnitTestTDMLRunner.scala | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git
a/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala
b/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala
index 987f9ca48..e4299c1a2 100644
---
a/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala
+++
b/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala
@@ -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'"))
+ }
+
}