olabusayoT commented on code in PR #1367:
URL: https://github.com/apache/daffodil/pull/1367#discussion_r1872016463
##########
daffodil-tdml-processor/src/test/scala/org/apache/daffodil/processor/tdml/TestTDMLRunner2.scala:
##########
@@ -677,4 +676,80 @@ abc # a comment
runner.reset
}
+ // DFDL-2947
+ @Test def test_rootNSSpecifiesNoNamespaceRoot(): Unit = {
+ val tdmlTestSuite =
+ <tdml:testSuite suiteName="theSuiteName" xmlns:ex={example}
xmlns:tdml={tdml} xmlns:dfdl={
+ dfdl
+ } xmlns:xsd={xsd} xmlns:xs={xsd} xmlns:xsi={xsi}>
+ <tdml:parserTestCase name="test1" root="data" rootNS=""
model="/test/tdml/chameleon-schema1.dfdl.xsd">
+ <tdml:document>37</tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <data>37</data>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+ </tdml:testSuite>
+
+ val runner = new Runner(tdmlTestSuite)
+ runner.runOneTest("test1")
+ }
+
+ @Test def test_rootNSSpecifiesNamespaceRoot(): Unit = {
+ val tdmlTestSuite =
+ <tdml:testSuite suiteName="theSuiteName" xmlns:ex={example}
xmlns:tdml={tdml} xmlns:dfdl={
+ dfdl
+ } xmlns:xsd={xsd} xmlns:xs={xsd} xmlns:xsi={xsi}>
+ <tdml:parserTestCase name="test1" root="data"
rootNS="urn:schema:namespace" model="/test/tdml/chameleon-schema1.dfdl.xsd">
+ <tdml:document>boy</tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <data>boy</data>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+ </tdml:testSuite>
+
+ val runner = new Runner(tdmlTestSuite)
+ runner.runOneTest("test1")
+ }
+
+ @Test def test_noRootCandidates1(): Unit = {
+ val tdmlTestSuite =
+ <tdml:testSuite suiteName="theSuiteName" xmlns:ex={example}
xmlns:tdml={tdml} xmlns:dfdl={
+ dfdl
+ } xmlns:xsd={xsd} xmlns:xs={xsd} xmlns:xsi={xsi}>
+ <tdml:parserTestCase name="test1" root="data1"
model="/test/tdml/chameleon-schema1.dfdl.xsd">
+ <tdml:document>37</tdml:document>
+ <tdml:errors>
+ <tdml:error>Schema Definition Error</tdml:error>
+ <tdml:error>no root element found</tdml:error>
+ <tdml:error>data1</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+ </tdml:testSuite>
+
+ val runner = new Runner(tdmlTestSuite)
+ runner.runOneTest("test1")
+ }
+
+ @Test def test_noRootCandidates2(): Unit = {
+ val tdmlTestSuite =
+ <tdml:testSuite suiteName="theSuiteName" xmlns:ex={example}
xmlns:tdml={tdml} xmlns:dfdl={
+ dfdl
+ } xmlns:xsd={xsd} xmlns:xs={xsd} xmlns:xsi={xsi}>
+ <tdml:parserTestCase name="test1" root="data" rootNS="doesNotExist"
model="/test/tdml/chameleon-schema1.dfdl.xsd">
+ <tdml:document>37</tdml:document>
+ <tdml:errors>
+ <tdml:error>Schema Definition Error</tdml:error>
+ <tdml:error>no global element found</tdml:error>
+ <tdml:error>{"{doesNotExist}"}data</tdml:error>
Review Comment:
Oh that was done that way because we are in a scala file, and the braces in
scalaxml mean interpolation, so it was done the way it was to sort of escape
the braces, but I'll update to the official way to escape which is {{ and }}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]