Skip to content

Commit

Permalink
Rewrite functional TDML tests to use new JUnit API
Browse files Browse the repository at this point in the history
The changes neccessary to use the new API are:

1. Modify imports
2. Extend the new TdmlSuite/TdmlTests traits
3. Split test suites with multiple runners into separate test
   suites--this API only supports a single runner per suite
4. Override createRunner() for suites that need tweaks to the runner,
   usually disabling validate
5. Change names of all test to match the TDML test name
6. Change tests to run by calling the "test" function
7. Change TDML test names that contain characger that are not valid in
   Scala function names, needed since function names are now used to
   find the TDML name
8. Switch to using @ignore to disable tests that are known to fail

Additionally, a few very old tests uses TDML XML embedded in the Scala
source. These were moved into TDML files.

DAFFODIL-2958
  • Loading branch information
stevedlawrence committed Jan 13, 2025
1 parent 435acc0 commit 3e0e65b
Show file tree
Hide file tree
Showing 157 changed files with 7,645 additions and 11,626 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
c/daffodil unparse -o c/nested.struct.dat infosets/nested.struct.dat.xml
-->

<tdml:parserTestCase model="nested.dfdl.xsd" name="nested.struct">
<tdml:parserTestCase model="nested.dfdl.xsd" name="nested_struct">
<tdml:document>
<tdml:documentPart type="file">data/nested.struct.dat</tdml:documentPart>
</tdml:document>
Expand All @@ -48,7 +48,7 @@
</tdml:infoset>
</tdml:parserTestCase>

<tdml:parserTestCase model="nested.dfdl.xsd" name="nested.struct.diag1">
<tdml:parserTestCase model="nested.dfdl.xsd" name="nested_struct_diag1">
<tdml:document>
<tdml:documentPart type="file">data/nested.struct.diag1.dat</tdml:documentPart>
</tdml:document>
Expand All @@ -62,7 +62,7 @@
</tdml:validationErrors>
</tdml:parserTestCase>

<tdml:parserTestCase model="nested.dfdl.xsd" name="nested.struct.diag2">
<tdml:parserTestCase model="nested.dfdl.xsd" name="nested_struct_diag2">
<tdml:document>
<tdml:documentPart type="file">data/nested.struct.diag2.dat</tdml:documentPart>
</tdml:document>
Expand All @@ -77,7 +77,7 @@
</tdml:parserTestCase>

<tdml:parserTestCase model="nested.dfdl.xsd"
name="nested.struct.err1"
name="nested_struct_err1"
root="NestedStruct">
<tdml:document>
<tdml:documentPart type="file">data/nested.struct.err1.dat</tdml:documentPart>
Expand All @@ -90,7 +90,7 @@
</tdml:parserTestCase>

<tdml:parserTestCase model="nested.dfdl.xsd"
name="nested.struct.err2"
name="nested_struct_err2"
root="NestedStruct">
<tdml:document>
<tdml:documentPart type="file">data/nested.struct.err2.dat</tdml:documentPart>
Expand All @@ -102,7 +102,7 @@
</tdml:errors>
</tdml:parserTestCase>

<tdml:parserTestCase model="nested.dfdl.xsd" name="nested.union.bar">
<tdml:parserTestCase model="nested.dfdl.xsd" name="nested_union_bar">
<tdml:document>
<tdml:documentPart type="file">data/nested.union.bar.dat</tdml:documentPart>
</tdml:document>
Expand All @@ -111,7 +111,7 @@
</tdml:infoset>
</tdml:parserTestCase>

<tdml:parserTestCase model="nested.dfdl.xsd" name="nested.union.foo">
<tdml:parserTestCase model="nested.dfdl.xsd" name="nested_union_foo">
<tdml:document>
<tdml:documentPart type="file">data/nested.union.foo.dat</tdml:documentPart>
</tdml:document>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-boolean"
name="simple_boolean"
root="simple-boolean">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -48,7 +48,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-byte"
name="simple_byte"
root="simple-byte">
<tdml:document>
<tdml:documentPart type="byte">00</tdml:documentPart>
Expand All @@ -65,7 +65,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-double"
name="simple_double"
root="simple-double">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00 00 00 00 00</tdml:documentPart>
Expand All @@ -82,7 +82,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-float"
name="simple_float"
root="simple-float">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -99,7 +99,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-hexBinary"
name="simple_hexBinary"
root="simple-hexBinary">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -116,7 +116,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-hexBinaryPrefixed"
name="simple_hexBinaryPrefixed"
root="simple-hexBinaryPrefixed">
<tdml:document>
<tdml:documentPart type="byte">00 04 00 00 00 00</tdml:documentPart>
Expand All @@ -133,7 +133,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-int"
name="simple_int"
root="simple-int">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -150,7 +150,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-integer"
name="simple_integer"
root="simple-integer">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -167,7 +167,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-long"
name="simple_long"
root="simple-long">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00 00 00 00 00</tdml:documentPart>
Expand All @@ -184,7 +184,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-nonNegativeInteger"
name="simple_nonNegativeInteger"
root="simple-nonNegativeInteger">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -201,7 +201,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-short"
name="simple_short"
root="simple-short">
<tdml:document>
<tdml:documentPart type="byte">00 00</tdml:documentPart>
Expand All @@ -218,7 +218,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-unsignedByte"
name="simple_unsignedByte"
root="simple-unsignedByte">
<tdml:document>
<tdml:documentPart type="byte">00</tdml:documentPart>
Expand All @@ -235,7 +235,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-unsignedInt"
name="simple_unsignedInt"
root="simple-unsignedInt">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00</tdml:documentPart>
Expand All @@ -252,7 +252,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-unsignedLong"
name="simple_unsignedLong"
root="simple-unsignedLong">
<tdml:document>
<tdml:documentPart type="byte">00 00 00 00 00 00 00 00</tdml:documentPart>
Expand All @@ -269,7 +269,7 @@
-->
<tdml:parserTestCase
model="simple.dfdl.xsd"
name="simple-unsignedShort"
name="simple_unsignedShort"
root="simple-unsignedShort">
<tdml:document>
<tdml:documentPart type="byte">00 00</tdml:documentPart>
Expand Down
Loading

0 comments on commit 3e0e65b

Please sign in to comment.