vendredi 6 juillet 2018

ComparisonFailure: column count in DBUnit

I am trying to do some testing with DBUnit. I exported database to xml file.

QueryDataSet partialDataSet = new QueryDataSet(connection1);


    partialDataSet.addTable("table","SELECT * FROM table order by id limit 20");
    partialDataSet.addTable("person"," select * from person where person.table_id in (select id from table order by id limit 20  )");

    FlatXmlDataSet. write(partialDataSet,new FileOutputStream("partial.xml"));

And when testing I am getting exception:

    unit.framework.ComparisonFailure: column count (table=person, expectedColCount=6, actualColCount=8) 

I think, the problem is that when I export database to xml file, null values in columns are omitted by DbUnit.

There is some way, to put null values in xml? Or make DBUnit ignore columnt count when making assertion?

Aucun commentaire:

Enregistrer un commentaire