[arquillian-issues] [JBoss JIRA] (ARQ-1136) Enhance the dataset comparison to allow for custom row ordering

Vineet Reynolds (JIRA) jira-events at lists.jboss.org
Tue Oct 9 07:12:03 EDT 2012


    [ https://issues.jboss.org/browse/ARQ-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724940#comment-12724940 ] 

Vineet Reynolds commented on ARQ-1136:
--------------------------------------

This behavior was observed to occur when JPA entities (that did not implement equals() & hashcode()) were added as members of a Set in another entity. Hibernate ordered the INSERTs by the hashcode values of the entities, resulting in an inconsistent row order across test runs. The only way to do away with this problem is to order the rows using a different column other than the primary key (auto-generated primary keys may be sorted inconsistently across test runs).

The solution is to either implement equals() and hashcode() to ensure consistent row ordering, or to implement custom row ordering in APE.
                
> Enhance the dataset comparison to allow for custom row ordering
> ---------------------------------------------------------------
>
>                 Key: ARQ-1136
>                 URL: https://issues.jboss.org/browse/ARQ-1136
>             Project: Arquillian
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>          Components: Extension - Persistence
>    Affects Versions: persistence_1.0.0.Alpha5
>            Reporter: Vineet Reynolds
>            Assignee: Vineet Reynolds
>
> By default, DbUnit uses primary keys to sort rows in a database snapshot. This behavior is not reproducible in cases where the database snapshot is not consistently ordered after a transaction. For e.g., when unordered collections like Sets are persisted to a table with auto-generated primary keys, then test assertions using {{@ShouldMatchDataset}} may fail intermittently.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the arquillian-issues mailing list