title: DBUnit Test Comparison Failure
body: <p>I have a problem with a db unit test which tests if data is persisted correctly. Therefore I created an sample db with my data and tried to compare the setup and the expected data. The id generation and everything else should be managed by hibernate</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration
  @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, DbUnitTestExecutionListener.class })
  @DatabaseTearDown("empty.xml")
  public class UserDaoTests {
  
      @Autowired
      UserAdminDao userDao;
  
      @Test
      @DatabaseSetup("db-setup.xml")
      @ExpectedDatabase("db-expected.xml")
      public void testPersistUser(){
  
          User user = new User();
  
          user.setUserId("user2");
          user.setName("test2");
          user.setEmail("user2@email.com");
          user.setLocked(false);
          user.setEnabled(true);
          user.setVersion(0);
          user.setPassword("asdfasdf");
  
          userDao.persist(user);
  
      }
  
  }
  </code></pre>
  
  <p>And my setups are: </p>
  
  <pre><code>&lt;dataset&gt;       
      &lt;user id="1" userId="user1" name="test1" email="user1@email.com" locked="0" enabled="1" version="0" password="asdfasdf" /&gt; 
  
  &lt;/dataset&gt;
  </code></pre>
  
  <p>and the same with user id=2 underneath:</p>
  
  <pre><code>&lt;user id="2" userId="user2" name="test2" email="user2@email.com" locked="0" enabled="1" version="0" password="asdfasdf" /&gt;
  </code></pre>
  
  <p>But I'm getting an Comparison error:</p>
  
  <pre><code>junit.framework.ComparisonFailure: row count (table=user) expected:&lt;[2]&gt; but was:&lt;[1]&gt;
  </code></pre>
  
  <p>Not sure where my mistake is. thx for any help :)</p>