You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/03/11 14:45:29 UTC

[GitHub] [daffodil] tuxji commented on a change in pull request #771: Fix saveParser CLI with config having tunables.

tuxji commented on a change in pull request #771:
URL: https://github.com/apache/daffodil/pull/771#discussion_r824772747



##########
File path: daffodil-core/src/test/scala/org/apache/daffodil/general/TestTunables.scala
##########
@@ -97,4 +102,15 @@ class TestTunables {
     assertEquals(true, w4.contains("escapeSchemeRefUndefined"))
   }
 
+  @Test def testConfigFileLoadingTunables(): Unit = {
+    val resource: URI = Misc.getRequiredResource("test/configExample.cfg")
+    val loader = new DaffodilXMLLoader()
+    val node = loader.load(URISchemaSource(resource), Some(XMLUtils.dafextURI))
+    val tunablesMap = DaffodilTunables.tunablesMap(node)
+    val tunables = DaffodilTunables(tunablesMap)
+    val warnIDStrings = tunables.suppressSchemaDefinitionWarnings.map{ _.toString }
+    assertEquals(2, warnIDStrings.length)
+    assertTrue(warnIDStrings.contains("facetExplicitLengthOutOfRange"))
+    assertTrue(warnIDStrings.contains("encodingErrorPolicyError"))
+  }

Review comment:
       I am not certain that `testConfigFileLoadingTunables` tests anything different than what `testTunables1` tests in daffodil-cli/src/test/scala/org/apache/daffodil/TestTunables.scala.  The purpose of `testTunables1` is to confirm that `Main.retrieveTunables` now does the same thing as `DaffodilTunables.tunablesMap(node)`, even though that's because `Main.retrieveTunables` was changed to call `DaffodilTunables.tunablesMap(node)` itself.  Why do we need `testConfigFileLoadingTunables` when it tests a subset of the same code as `testTunables1`?  Actually, maybe we simply need to move `Main.retrieveTunables` to `DaffodilTunables.retrieveTunables` and make `testConfigFileLoadingTunables` call it; then we can get rid of `testTunables1`.




-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org