tuxji commented on a change in pull request #485:
URL: https://github.com/apache/incubator-daffodil/pull/485#discussion_r568631104



##########
File path: 
daffodil-cli/src/it/scala/org/apache/daffodil/parsing/TestCLIParsing.scala
##########
@@ -206,27 +206,19 @@ class TestCLIparsing {
   }
 
   @Test def test_1593_CLI_Parsing_MultifileSchema_noGlobalElem(): Unit = {
-    val tmp_filename: String = (System.currentTimeMillis / 1000).toString()
-    val file = new File(tmp_filename)
-    val schemaFile = 
Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/TopLevel.dfdl.xsd")
-    val inputFile = 
Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/02nine_headers.txt")
-    val (testSchemaFile, testInputFile) = if (Util.isWindows) 
(Util.cmdConvert(schemaFile), Util.cmdConvert(inputFile)) else (schemaFile, 
inputFile)
-
-    val shell = Util.start("")
+    val schemaFile = 
Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/multi_base_21.dfdl.xsd")
+    val testSchemaFile = if (Util.isWindows) Util.cmdConvert(schemaFile) else 
schemaFile
+    val shell = Util.startIncludeErrors("")
 
     try {
-      val cmd = String.format("%s parse -s %s -o %s %s", Util.binPath, 
testSchemaFile, tmp_filename, testInputFile)
+      val cmd = String.format(Util.echoN("does not matter") + " | %s parse -s 
%s", Util.binPath, testSchemaFile)

Review comment:
       Nice use of echo to avoid creating/deleting a temporary input file.

##########
File path: 
daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/namespaces.tdml
##########
@@ -2415,4 +2417,23 @@
     </tdml:infoset>
   </tdml:parserTestCase>
 
+  <!--
+    Test name: schemaNoGlobalElems_03
+    Schema: multi_base_21.dfdl.xsd
+    Root: base2
+    Purpose: This test demonstrates that you can have a schema if there are
+             no global elements in the primary schema, as long as the root 
element is
+             specified (the TDML Runner always specifies the root)

Review comment:
       I searched TDMLRunner.scala for "root" to understand what you meant by 
"the TDML Runner always specifies the root".  What seems to happen is if a TDML 
test has an infoset, the TDML Runner uses that infoset's root element (XML 
documents have a single root element) as the root.  The root="name" attribute 
is not even needed and in fact the TDML Runner throws an exception if the 
root="name" attribute does not match the name of the root element of the 
infoset.

##########
File path: 
daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/namespaces.tdml
##########
@@ -2415,4 +2417,23 @@
     </tdml:infoset>
   </tdml:parserTestCase>
 
+  <!--
+    Test name: schemaNoGlobalElems_03
+    Schema: multi_base_21.dfdl.xsd
+    Root: base2
+    Purpose: This test demonstrates that you can have a schema if there are
+             no global elements in the primary schema, as long as the root 
element is
+             specified (the TDML Runner always specifies the root)
+  -->
+
+  <tdml:parserTestCase name="schemaNoGlobalElems_03"
+    root="distant_element" model="multi_base_21.dfdl.xsd" description="">

Review comment:
       Therefore, the root="distant_element" attribute here is redundant since 
the test case has an infoset with the distant_element as well.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to