Menu

#79 FlatXMLdataSet counts 14 tables instead of 1 table of 14 row

v2.1
closed-fixed
None
1
2008-10-12
2004-11-09
Doj
No

Here is the symptom: a flat xml file containing 14 rows
for a EMP table (former Oracle sample table) becomes a
DataSet with 14 tables of 1 row, instead of 1 table of
14 rows. It make fails equality assertions :

Reason : table names are not the same case in DTD and
XML file. Table name was "emp" in the DTD, "EMP" in the
xml file.

Suggestion : in org.dbunit.dataset.xml.FlatXmlProducer,
lines 205 and 213, better test equality of string
ignoring character case.

Discussion

  • Doj

    Doj - 2004-11-09
    • priority: 5 --> 1
     
  • Srinivasan Ranganthan

    Logged In: YES
    user_id=1097914

    Can you submit an XML dataset that misbehaves?

     
  • Doj

    Doj - 2005-04-21

    1st file : the XML data file containing 14 rows for EMP table

     
  • Doj

    Doj - 2005-04-21

    2nd file: the misbehaving DTD file

     
  • Tom Schneider

    Tom Schneider - 2006-04-27

    Logged In: YES
    user_id=47435

    I too ran into this very frustrating bug myself. I dug into
    this a bit and it seems that in the FlatXMLProducer, the
    metadata is created based off of the first row for the table
    encountered and never updated after that. I have some (ugly
    in my opinion) code that works around--I'll post if I get a
    chance. Basically, In the FlatXMLProducer, I update the
    metadata upon encountering each row and add columns to the
    metadata if there are rows to add. Out of the box, the API
    doesn't really support this, but for my purposes I think it
    will work.

     
  • Roberto Lo Giacco

    Patch by Sébastien Le Callonec

     
  • Roberto Lo Giacco

    Logged In: YES
    user_id=57511
    Originator: NO

    Sébastien Le Callonec have providen a patch for this issue, but it needs to be tested. I'm going to attach it and let you provide feedback on that.
    File Added: 1063128.patch

     
  • matthias g

    matthias g - 2008-10-12
    • status: open --> closed-fixed
     
  • matthias g

    matthias g - 2008-10-12

    Hi there,

    I added your testcases to the dbunit testsuite and fixed the bug. Commit is svn rev. 832/trunk for the next 2.4 release.

    Thanks a lot for this valuable submission!

    regards,
    mat

     

Log in to post a comment.