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



##########
File path: 
daffodil-tdml-processor/src/test/scala/org/apache/daffodil/tdml/TestTDMLRunner2.scala
##########
@@ -424,11 +424,26 @@ abc # a comment
   }
 
   @Test def testTDMLWithInvalidDFDLSchemaEmbedded() = {
+    val testSuite =
+      <tdml:testSuite suiteName="theSuiteName" xmlns:tns={ tns } xmlns:tdml={ 
tdml } xmlns:dfdl={ dfdl } xmlns:xs={ xsd }>
+        <!-- This embedded schema has validation errors. -->
+        <tdml:defineSchema name="mySchema">
+          <xs:include 
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+          <xs:format ref="tns:GeneralFormat" />
+          <xs:element name="data" type="fn:string" dfdl:lengthKind="delimited" 
/>
+        </tdml:defineSchema>
+        <tdml:parserTestCase name="test1" root="data" model="mySchema">
+          <tdml:document>
+            <tdml:documentPart 
type="text"><![CDATA[abcdef]]></tdml:documentPart>
+          </tdml:document>
+          <tdml:errors>
+            <tdml:error>Cannot resolve 'fn:string' as a QName</tdml:error>
+          </tdml:errors>
+        </tdml:parserTestCase>
+      </tdml:testSuite>
 
-    val testDir = ""
-    val aa = testDir + "tdml-with-embedded-schema-errors.tdml"
-    lazy val runner = new DFDLTestSuite(Misc.getRequiredResource(aa), 
validateTDMLFile = false, validateDFDLSchemas = true)
-    runner.runOneTest("test1")
+    lazy val ts = new DFDLTestSuite(testSuite, validateTDMLFile = false, 
validateDFDLSchemas = true)

Review comment:
       IntelliJ didn't warn me, but when I ran sbt compile, I found out you 
can't add default arguments to two overloaded apply methods:
   
   `in object Runner, multiple overloaded alternatives of method apply define 
default arguments`
   
   I will work around by adding a new apply method that passes both 
scala.xml.Elem and validateTDMLFile as required arguments.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to