michael-hoke commented on code in PR #1057:
URL: https://github.com/apache/daffodil/pull/1057#discussion_r1484667731


##########
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:
   > 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.
   
   Agreed that we should, but the immediate use case is for generated files. 
The hope is that people with custom non-generated files that don't work out of 
the box create an issue and we can deal with the edge cases that way. I think 
having some sort of message/warning if comments (or anything else that we can't 
currently handle) are detected is a really good starting point that we're not 
currently doing - a ticket to track this would probably be useful.
   
   > We currently launch the daffodil debugger to create and append TDML files
   
   This isn't quite as true as it was before. With the GUI implemented, we've 
integrated the TDML generate/append more into the actual DFDL parse. By 
default, a TDML file is generated for every parse - it's not a separate action 
anymore. The generate/append actions work off of the last parse that was ran 
instead of requiring the user to do another parse.
   
   So, when the user hits the generate/append button, it's all handled on the 
typescript side now. Even though that's not the complete picture, it's a step 
towards decoupling the TDML from the backend if that's a direction we 
eventually move to... Although, I don't see how we can do that as a TDML test 
case (or at least for how we're using it) is implicitly tied to a DFDL parse. 
Maybe there's a path to take if we add a way to have the backend send 
information back to the frontend after a parse?



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