Wrong table count in DbUnit + springtestdbunit
<p>I have 2 tables, but code from this post leads exception.</p>

<p>What I am doing wrong?</p>

<p>How fix this?</p>

<p>Fail text</p>

<pre><code>junit.framework.ComparisonFailure: table count
Expected :5
Actual   :2
</code></pre>

<p>Pom dependencies</p>

<pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.github.springtestdbunit&lt;/groupId&gt;
    &lt;artifactId&gt;spring-test-dbunit&lt;/artifactId&gt;
    &lt;version&gt;1.2.1&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>

<p>Dataset</p>

<pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;dataset&gt;
&lt;table name="CATEGORY"&gt;
    &lt;column&gt;CATEGORY_ID&lt;/column&gt;
    &lt;row&gt;
        &lt;value&gt;1&lt;/value&gt;
    &lt;/row&gt;
    &lt;row&gt;
        &lt;value&gt;2&lt;/value&gt;
    &lt;/row&gt;
&lt;/table&gt;
&lt;table name="CATEGORY_RELATIONS"&gt;
    &lt;column&gt;CATEGORY_RELATIONS_PARENT_ID&lt;/column&gt;
    &lt;column&gt;CATEGORY_RELATIONS_CATEGORY_ID&lt;/column&gt;
    &lt;column&gt;ID&lt;/column&gt;
    &lt;row&gt;
        &lt;value&gt;1&lt;/value&gt;
        &lt;value&gt;2&lt;/value&gt;
        &lt;null/&gt;
    &lt;/row&gt;
&lt;/table&gt;
&lt;/dataset&gt;
</code></pre>

<p>POST UPDATE (information, requested by people added)</p>

<p>Test</p>

<pre><code>@Test
@DatabaseSetup("classpath:data-sets/empty.xml")     
@ExpectedDatabase("classpath:data-sets/categories/save.xml") 
public void save() throws Exception { 
   testTarget.save(parentCategory); 
   testTarget.save(childCategory); 
} 
</code></pre>

<p>empty.xml</p>

<pre><code>&lt;dataset&gt; 
   &lt;CATEGORY/&gt; 
   &lt;CATEGORY_RELATIONS/&gt;
&lt;/dataset&gt; 
</code></pre>

<p>No table counters </p>

<pre><code>@ActiveProfiles("test") @RunWith(SpringJUnit4ClassRunner.class)     
@TestExecutionListeners({DependencyInjectionTestExecutionListener.class, 
   DirtiesContextTestExecutionListener.class, 
   TransactionalTestExecutionListener.class, DbUnitTestExecutionListener.class, 
   HSqlTestExecutionListener.class}) 
@ContextConfiguration({"classpath:contexts/bean-locations.xml"}) 
public class SpringHsqlTest {//...
</code></pre>