arosien commented on code in PR #1057:
URL: https://github.com/apache/daffodil/pull/1057#discussion_r1484639668


##########
daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/ScalaxbTests.scala:
##########
@@ -0,0 +1,23 @@
+package org.apache.daffodil.tdml
+
+import org.apache.daffodil.tdml.scalaxb.TestSuite
+
+import org.junit.Assert._
+import org.junit.Test
+
+class ScalaxbTests {
+
+  @Test def testReading(): Unit = {
+    val testSuite =
+      _root_.scalaxb.fromXML[TestSuite](
+        scala.xml.XML.load(
+          getClass
+            .getClassLoader()
+            .getResourceAsStream("test-suite/ibm-contributed/dpaext1-2.tdml"),
+        ),
+      )
+
+    assertNotNull(testSuite)
+    assertEquals(Some("dpaext"), testSuite.suiteName)
+  }
+}

Review Comment:
   > The use case for the extension is to enable reading and writing of 
generated TDML files, so the comments aren't an immediate issue for us. We 
don't expect users to have or use non-generated TDML files in order to use the 
features in the extension.
   
   I don't quite think this is true. We happen to most often handle completely 
generated TDML files, but it should be the case that someone with a 
pre-existing non-generated TDML file would want to add a generated test case to 
the file, in which case the app using this lib should either raise an error if 
there are comments, or warn that we're going to trash them.
   
   > @arosien what is the use case here. I had thought the purpose of this 
scalaxb stuff was to enable adding TDML support to the VSCode extension, and 
that would mean both reading and writing out TDML.
   
   It's both reading and writing in the daffodil-vscode project, but I don't 
think that matters for the changes in daffodil proper. We can document the 
limitation with comments somewhere and downstream projects can choose to raise 
an error when encountering comments, filter them out, etc.



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

Reply via email to