#177 org.dbunit.dataset.NoSuchColumnException use XlsDataSet

v2.2.2
closed-fixed
Bug (232)
5
2014-08-18
2008-05-21
achie chen
No

it the dataset file contains two sheets such as attach file,testcase throws org.dbunit.dataset.NoSuchColumnException.

org.dbunit.dataset.NoSuchColumnException: customer.NAME
at org.dbunit.dataset.AbstractTable.getColumnIndex(AbstractTable.java:91)
at org.dbunit.dataset.excel.XlsTable.getValue(XlsTable.java:113)
at org.dbunit.dataset.ReplacementTable.getValue(ReplacementTable.java:180)

I try to modified it like this:
if (columnName.trim().equalsIgnoreCase(columns[i].getColumnName().trim()))

in file DataSetUtils.java:233

and

if (column.getColumnName().trim().equalsIgnoreCase(columnName.trim()))

in file AbstractTable.java:85

it works ok!

Discussion

  • achie chen
    achie chen
    2008-05-21

    excel dataset file

     
    Attachments
    • assigned_to: nobody --> slecallonnec
     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=1232035
    Originator: NO

    Hi,

    I've actually taken a slightly different approach to fix this, and trimmed the column names returned by poi before adding them to the metadata. This should be fixed in the next major release 2.3.0.

    Regards,
    Sébastien

     
    • labels: --> Bug