Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-474

Empty 'test' property causes entire schema to fail, even with TDML validation off

XMLWordPrintableJSON

      When running a test that checks requirement DFDL-7-056R (It is a schema definition error if dfdl:test is the empty string) I get a variant of the following error on nearly all of my existing tests:

      [info] - test_assertExpressionRefFail *** FAILED ***
      [info] java.lang.Exception: Did not find diagnostic message "Assertion" in any of the actual diagnostic messages:
      [info] Schema Definition Error: Error loading schema(org.xml.sax.SAXParseException; lineNumber: 74; columnNumber: 66; cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '({[^\{].*})|({})' for type 'DFDLExpression'.) Schema context: SchemaSet.
      [info] Schema Definition Error: Error loading schema(org.xml.sax.SAXParseException; lineNumber: 74; columnNumber: 66; cvc-attribute.3: The value '' of attribute 'test' on element 'dfdl:assert' is not valid with respect to its type, 'DFDLExpression'.) Schema context: SchemaSet.
      [info] at daffodil.tdml.TestCase$$anonfun$verifyAllDiagnosticsFound$2.apply(TDMLRunner.scala:316)
      [info] at daffodil.tdml.TestCase$$anonfun$verifyAllDiagnosticsFound$2.apply(TDMLRunner.scala:310)
      [info] at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      [info] at scala.collection.immutable.List.foreach(List.scala:76)
      [info] at daffodil.tdml.TestCase.verifyAllDiagnosticsFound(TDMLRunner.scala:309)
      [info] at daffodil.tdml.ParserTestCase.runParseExpectErrors(TDMLRunner.scala:425)
      [info] at daffodil.tdml.ParserTestCase.runProcessor(TDMLRunner.scala:340)
      [info] at daffodil.tdml.TestCase.run(TDMLRunner.scala:293)
      [info] at daffodil.tdml.DFDLTestSuite.runOneTest(TDMLRunner.scala:165)
      [info] at daffodil.section07.assertions.TestAssertions.test_assertExpressionRefFail(TestAssertions.scala:47)

      this is the error I get on the test that is expecting a Schema Definition Error:

      [info] - test_assertExpressionEmpty *** FAILED ***
      [info] java.util.NoSuchElementException: None.get
      [info] at scala.None$.get(Option.scala:274)
      [info] at scala.None$.get(Option.scala:272)
      [info] at daffodil.dsom.DFDLAssertionBase.testTxt(DFDLAnnotation.scala:586)
      [info] at daffodil.processors.AssertBooleanPrimBase.<init>(Primitives.scala:2629)
      [info] at daffodil.processors.AssertBooleanPrim.<init>(Primitives.scala:2631)
      [info] at daffodil.dsom.DFDLAssert$$anonfun$gram_$1.apply(DFDLAnnotation.scala:611)
      [info] at daffodil.dsom.DFDLAssert$$anonfun$gram_$1.apply(DFDLAnnotation.scala:609)
      [info] at daffodil.dsom.OOLAG$LV.lazyBody(OOLAG.scala:250)
      [info] at daffodil.dsom.OOLAG$OOLAGValue$$anonfun$1.apply(OOLAG.scala:154)
      [info] at daffodil.dsom.OOLAG$OOLAGHost$class.circularityDetector(OOLAG.scala:70)

      Currently, TDML validation is turned off but this is still an issue. I've commented out this section of the schema so the existing tests still pass.
      The test is assertExpressionEmpty in
      daffodil-test/src/test/resources/daffodil/section07/assertions/assert.tdml

              Unassigned Unassigned
              jchab Jessie Chab
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: