You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

 

If you are having a problem with Daffodil, and think that perhaps you have found a bug, then we suggest you:

  • check JIRA (to see if the bug is already reported)
  • create a TDML file for reproducing the bug/issue
  • create a JIRA ticket and attach your TDML
    OR
  • email the issue to daffodil-users@oss.tresys.com

A TDML file is often useful just to ask a question about how something in DFDL works, for example, to get a clarification.

Check JIRA

First you should give a search of our JIRA tickets to see if the problem is already recorded.

Here's the front page: https://opensource.ncsa.illinois.edu/jira/browse/DFDL

Here's a list of all tickets about bugs, new features, and improvements. In reverse chronological order (most recent first). You may want to change the issue type, or status specifications to narrow down the list, but most commonly you would just put some search keywords into the search box.

Don't go crazy with this searching however, because if you can't find it with reasonable effort (a few good guesses at search terms), then whatever is there isn't tagged sufficiently anyway.

If you do find a bug or a closely related issue that is open status, then you can add your information to it as a comment if you prefer, rather than creating a new issue. Just knowing that another person has run into the issue is helpful at assigning fix priorites.

Create a TDML File that Illustrates the Issue

The absolutely best way to report a bug is by creating a TDML test file that demonstrates the problem.

TDML stands for "Test Data Markup Language". It is a way of specifying a DFDL schema, the test data, the expected result or expected error/diagnostic messages, and it is all in a single self-contained XML file.

By convention, a TDML file uses file extension ".tdml".

Below is an annotated TDML file:

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
Example of a self-contained test described in a TDML file

Note that in the XML slug line above, we're using UTF-8.

That will allow you to put any unicode character into your test
data or expected result.
 -->

 <tdml:testSuite 
  suiteName="Suspected Bugs" 
  description="Illustrates issues found 2013-04-01"
  xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:ex="http://example.com">

  <!--
    Use defineSchema to include a DFDL schema directly inside the TDML file.
    You can alternatively put the DFDL schema in a separate file if you prefer.

    Each defineSchema has a name, so that one TDML file can contain tests which reference
    different DFDL schemas. 

    To embed a schema inside the TDML you don't include the <xs:schema...> element from
    the schema file, nor do you need to wrap the top-level DFDL annotation objects with
    xs:annotation and xs:appinfo.

    In other words, inside a defineSchema you can directly put: 
    dfdl:defineFormat, dfdl:defineEscapeSchema,
    dfdl:format (for the default format), xs:element, xs:simpleType, xs:complexType, xs:group.
   -->

  <tdml:defineSchema name="s1">

    <dfdl:defineFormat name="myDefaults">
      <dfdl:format lengthKind="implicit" representation="text"
        lengthUnits="bytes" encoding="US-ASCII" initiator="" terminator=""
        separator="" ignoreCase="no" textNumberRep="standard" />
    </dfdl:defineFormat>

    <dfdl:format ref="myDefaults" />

    <!-- 
      imagine we are reporting a bug with date/time functionality.

      Note that since the whole file is utf-8, we can freely put unicode 
      characters in here. These are Japanese.
     -->
     
 <xs:element name="dateTimeText" type="xs:dateTime" 
      dfdl:calendarPattern="yyyy年MM月dd日のHH:mm:ss ZZZZ" dfdl:calendarPatternKind="explicit"
	  dfdl:lengthKind="explicit" dfdl:length="{ 35 }" />

  </tdml:defineSchema>

<!-- 
   Here is a test case that exercises the above schema

   You must give the name of the model (aka the schema), that can be the name of a
   schema defined immediately in this file like above, or a file name.

   You must also give the name of the root element that the test will use.
 -->

<tdml:parserTestCase name="dateTimeText" root="dateTimeText"
    model="s1" description="date time issue"> <!-- description is optional --> 

<!--
   The data for your test is given by the tdml:document element.

   Notice specifically the use of the CDATA bracketing of the data. This
   insures that no unintended whitespace gets inserted around your data.

   This specific example is using text data. We'll see examples of hexadecimal,
   bits, and use of data from an external file as well.

   Our test is expecting some Japanese Unicode characters in here. 
  -->
    <tdml:document><![CDATA[2013年04月02日の14:00:56 GMT-05:00]]></tdml:document>

  <!--
   The infoset element gives the expected infoset, expressed as an XML fragment.
  -->

  <tdml:infoset>
      <tdml:dfdlInfoset>
        <dateTimeText>2013-04-02T14:00:56-05:00</dateTimeText>
      </tdml:dfdlInfoset>
    </tdml:infoset>

<!-- end of the test case -->
 </tdml:parserTestCase>
<!-- end of the whole TDML file --> 
</tdml:testSuite>
 



  • No labels