How to handle the data when relation is many to many

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to handle the data when relation is many to many

Feng Xuemin

I met one issue when compare tables, here is the case.

I defined the xls format dataset below and insert db successfully, then I check if the insert result is correct. Very simple case, but compare failed.

I think it is because the relation between these two columns is many to many, so when compare the result, the data order was broken.

So for this case, how I can handle it correctly, thanks for your helpJ

Here is the run result: junit.framework.ComparisonFailure: value (table=SDMC_DEVICE_TYPE_SEGMENT, row=1, col=SEGMENT_ID) expected:<[2]> but was:<[1]>

       at org.dbunit.assertion.JUnitFailureFactory.createFailure(JUnitFailureFactory.java:39)

       at org.dbunit.assertion.DefaultFailureHandler.createFailure(DefaultFailureHandler.java:105)

       at org.dbunit.assertion.DefaultFailureHandler.handle(DefaultFailureHandler.java:208)

       at org.dbunit.assertion.DbUnitAssert.compareData(DbUnitAssert.java:514)

       at org.dbunit.assertion.DbUnitAssert.assertEquals(DbUnitAssert.java:400)

       at org.dbunit.assertion.DbUnitAssert.assertEquals(DbUnitAssert.java:312)

       at org.dbunit.assertion.DbUnitAssert.assertEquals(DbUnitAssert.java:274)

       at org.dbunit.Assertion.assertEquals(Assertion.java:122)

 

xls file data:

SEGMENT_ID

DEVICE_TYPE_ID

1

2

2

3

3

4

1

3

1

4

db data:

 

Best Regards,

Xuemin

 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user