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

Error Message for setVariable Seems Incorrect

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • s11
    • None
    • Back End
    • None

      I created a test where the specified value of a variable does not match its specified type. The specified type is xs:int, and the variable is set to a string. I get the following error ("BEEEP" is my string):

      [info] Schema Definition Error: Cannot convert BEEEP to Long. Error java.lang.NumberFormatException: For input string: "BEEEP". Schema context: element.r3::complexType::sequence::element.one. Location line 375 column 121 in file:/home/jchab/NGF/dfdl/daffodil-test/target/scala-2.9.2/test-classes/daffodil/section07/variables/variables.tdml
      [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.variables.TestVariables.test_setVarTypeMismatch(TestVariables.scala:29)

      I'm not sure why it's saying it's trying to convert to a Long, as there are no longs defined anywhere in the schema.

      Test is setVarTypeMismatch in the following files:

      daffodil-test/src/test/resources/daffodil/section07/variables/variables.tdml
      daffodil-test/src/test/scala-debug/daffodil/section07/variables/TestVariablesDebug.scala
      daffodil-test/src/test/scala/daffodil/section07/variables/TestVariables.scala

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

                Created:
                Updated:
                Resolved: