jadams-tresys commented on a change in pull request #168: Keep line/column info 
for Daffodil tests
URL: https://github.com/apache/incubator-daffodil/pull/168#discussion_r250242945
 
 

 ##########
 File path: 
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
 ##########
 @@ -603,7 +619,19 @@ abstract class TestCase(testCaseXML: NodeSeq, val parent: 
DFDLTestSuite)
       }
       case (None, Some(defSchema), None) => {
         Assert.invariant(model != "") // validation of the TDML should prevent 
this
-        EmbeddedSchemaSource(defSchema.xsdSchema, defSchema.name)
+
+        /* The file, line, and column attributes we add for tracking purposes
+         * cause issues with the IBM DFDL processor as it doesn't allow
+         * attributes that it doesn't understand, so we must remove them */
+        val processedSchema = {
+          if (isCrossTest(this.tdmlDFDLProcessorFactory.implementationName)) {
+            stripLineColInfo(defSchema.xsdSchema)
+          } else {
+            defSchema.xsdSchema
+          }
+        }
+
+        EmbeddedSchemaSource(processedSchema, defSchema.name)
 
 Review comment:
   Talked with you earlier about relying on the test in your most recent commit 
instead.  Looked into adding a unit test to the TDMLRunner side of things, but 
I didn't see a straightforward way of hitting the right code path to remove the 
line/col attributes within the daffodil implementation.
   
   I could add a test to the ibmDFDLCrossTester, but given that any embedded 
test (or unparser test for that matter) will fail if the line/col attributes 
aren't removed I was thinking that would be a bit redundant.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to