DbUnit ignores unknown tables while reading from data set

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DbUnit ignores unknown tables while reading from data set

Michał Grzejszczak
Hello everyone,

I'm trying to store table contents in memory from database by using the
following code:

         DatabaseConnection dbuConnection = new
DatabaseConnection(connection);
         IDataSet tmpDataSet = dbuConnection.createDataSet(new String[]
{ "b" });
         CharArrayWriter writer = new CharArrayWriter();
         XmlDataSet.write(tmpDataSet, writer);
         XmlDataSet xmlDataSet = new XmlDataSet(new
CharArrayReader(writer.toCharArray()));

When I do a typo in table name, that is table "b" in example above does
not exist, dbUnit will only report the problem by logging

... DatabaseDataSet:286 - Table 'b' not found in
tableMap=org.dbunit.dataset.OrderedTableNameMap ...

There is no exception thrown. I wonder if  I do something wrong or there
should be an exception. Can anyone tell, if that is a bug in DbUnit or
in my code?

BTW the exception, properly generated in
DatabaseDataSet.getTableMetadata, is ignored in
SequenceTableFilter.getTableNames.

Best regards,
Michal


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: DbUnit ignores unknown tables while reading from data set

Jeff Jensen-2
Possibly you have found at least one bug, and possibly two; requiring
further analysis to determine.  If you can diagnose further, providing
a patch, explicit description of a needed change, or test cases that
reproduce would be much appreciated and used to verify and fix the
problems.


2011/4/19 Michał Grzejszczak <[hidden email]>:

> Hello everyone,
>
> I'm trying to store table contents in memory from database by using the
> following code:
>
>         DatabaseConnection dbuConnection = new
> DatabaseConnection(connection);
>         IDataSet tmpDataSet = dbuConnection.createDataSet(new String[]
> { "b" });
>         CharArrayWriter writer = new CharArrayWriter();
>         XmlDataSet.write(tmpDataSet, writer);
>         XmlDataSet xmlDataSet = new XmlDataSet(new
> CharArrayReader(writer.toCharArray()));
>
> When I do a typo in table name, that is table "b" in example above does
> not exist, dbUnit will only report the problem by logging
>
> ... DatabaseDataSet:286 - Table 'b' not found in
> tableMap=org.dbunit.dataset.OrderedTableNameMap ...
>
> There is no exception thrown. I wonder if  I do something wrong or there
> should be an exception. Can anyone tell, if that is a bug in DbUnit or
> in my code?
>
> BTW the exception, properly generated in
> DatabaseDataSet.getTableMetadata, is ignored in
> SequenceTableFilter.getTableNames.
>
> Best regards,
> Michal
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user