Description
If you run the CLI with the interactive debugger, and then attempt to display your utf-16 input data, you get an abort exception. Note that if you don't display the data and just continue through, the data will parse without issues. It seems that 'info data' specifically needs a byte order to work.
If you run the following command (note that I use an alias for the CLI, replace daffodil_cli with the path to the CLI):
echo -ne '\x00\x74\x24\x0A\x00\x65' > hextest && daffodil_cli -d parse -s daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section06/entities/utf16schema.dfdl.xsd --root e2 hextest
|
and then at the debug prompt enter
(debug) info data
|
You get the following error:
edu.illinois.ncsa.daffodil.exceptions.Abort: encoding does not specify byte order: UTF-16
|
edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:105)
|
edu.illinois.ncsa.daffodil.exceptions.Assert$.usageError(Assert.scala:93)
|
edu.illinois.ncsa.daffodil.io.Dump$.getTextParameters(Dump.scala:586)
|
edu.illinois.ncsa.daffodil.io.Dump$.dumpHexAndTextBytes(Dump.scala:202)
|
at edu.illinois.ncsa.daffodil.exceptions.Assert$.abort(Assert.scala:105)
|
at edu.illinois.ncsa.daffodil.exceptions.Assert$.usageError(Assert.scala:93)
|
at edu.illinois.ncsa.daffodil.io.Dump$.getTextParameters(Dump.scala:586)
|
at edu.illinois.ncsa.daffodil.io.Dump$.dumpHexAndTextBytes(Dump.scala:202)
|
at edu.illinois.ncsa.daffodil.io.Dump$.dump(Dump.scala:116)
|
at edu.illinois.ncsa.daffodil.processors.DataLoc.dumpStream(InStream.scala:706)
|
at edu.illinois.ncsa.daffodil.processors.DataLoc.dump(InStream.scala:668)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommandBase$Info$InfoData$.printData(InteractiveDebugger.scala:1180)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommandBase$Info$InfoData$.act(InteractiveDebugger.scala:1213)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommandBase$Info$$anonfun$act$9.apply(InteractiveDebugger.scala:1069)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommandBase$Info$$anonfun$act$9.apply(InteractiveDebugger.scala:1068)
|
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
|
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommandBase$Info$.act(InteractiveDebugger.scala:1068)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommandBase$.act(InteractiveDebugger.scala:576)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$DebugCommand.apply(InteractiveDebugger.scala:366)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger.edu$illinois$ncsa$daffodil$debugger$InteractiveDebugger$$runCommand(InteractiveDebugger.scala:318)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$$anonfun$debugStep$1.apply$mcV$sp(InteractiveDebugger.scala:192)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$$anonfun$debugStep$1.apply(InteractiveDebugger.scala:159)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger$$anonfun$debugStep$1.apply(InteractiveDebugger.scala:159)
|
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
|
at edu.illinois.ncsa.daffodil.ExecutionMode$$anonfun$usingUnrestrictedMode$1.apply(ExecutionMode.scala:81)
|
at edu.illinois.ncsa.daffodil.ExecutionMode$$anonfun$usingUnrestrictedMode$1.apply(ExecutionMode.scala:81)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger.debugStep(InteractiveDebugger.scala:159)
|
at edu.illinois.ncsa.daffodil.debugger.InteractiveDebugger.startElement(InteractiveDebugger.scala:212)
|
at edu.illinois.ncsa.daffodil.events.MultipleEventHandler$$anonfun$startElement$1.apply(ParseEventHandler.scala:100)
|
at edu.illinois.ncsa.daffodil.events.MultipleEventHandler$$anonfun$startElement$1.apply(ParseEventHandler.scala:100)
|
at scala.collection.immutable.List.foreach(List.scala:318)
|
at edu.illinois.ncsa.daffodil.events.MultipleEventHandler$class.startElement(ParseEventHandler.scala:100)
|
at edu.illinois.ncsa.daffodil.processors.DataProcessor.startElement(Runtime.scala:114)
|
at edu.illinois.ncsa.daffodil.processors.StatementElementParserBase.parse(ElementCombinator1.scala:132)
|
at edu.illinois.ncsa.daffodil.processors.Parser.parse1(Parser.scala:85)
|
at edu.illinois.ncsa.daffodil.processors.DataProcessor.edu$illinois$ncsa$daffodil$processors$DataProcessor$$doParse(Runtime.scala:250)
|
at edu.illinois.ncsa.daffodil.processors.DataProcessor$$anonfun$parse$3.apply(Runtime.scala:238)
|
at edu.illinois.ncsa.daffodil.processors.DataProcessor$$anonfun$parse$3.apply(Runtime.scala:231)
|
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
|
at edu.illinois.ncsa.daffodil.ExecutionMode$$anonfun$usingRuntimeMode$1.apply(ExecutionMode.scala:80)
|
at edu.illinois.ncsa.daffodil.ExecutionMode$$anonfun$usingRuntimeMode$1.apply(ExecutionMode.scala:80)
|
at edu.illinois.ncsa.daffodil.processors.DataProcessor.parse(Runtime.scala:230)
|
at edu.illinois.ncsa.daffodil.processors.DataProcessor.parse(Runtime.scala:202)
|
at edu.illinois.ncsa.daffodil.Main$$anonfun$69.apply(Main.scala:720)
|
at edu.illinois.ncsa.daffodil.Main$$anonfun$69.apply(Main.scala:718)
|
at edu.illinois.ncsa.daffodil.util.Timer$.getTimeResult(Timer.scala:91)
|
at edu.illinois.ncsa.daffodil.util.Timer$.getResult(Timer.scala:50)
|
at edu.illinois.ncsa.daffodil.Main$.run(Main.scala:717)
|
at edu.illinois.ncsa.daffodil.Main$.main(Main.scala:1126)
|
at edu.illinois.ncsa.daffodil.Main.main(Main.scala)
|
Note that this particular test is a negative test, so we are expecting an error in the end (just not this error).
This will soon be made into an automated test. Will update ticket with that test once it has been written.