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.
Logged In: YES
user_id=1097914
Can you submit an XML dataset that misbehaves?
1st file : the XML data file containing 14 rows for EMP table
2nd file: the misbehaving DTD file
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.
Patch by Sébastien Le Callonec
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
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