title: Integration test DBUnit NoSuchTableException Java
body: <p>When i start the test i have this <strong>NoSuchTableException</strong>. Do i need to set the same name of in-memory data base like that in production ?</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
      @ContextConfiguration
      @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class,
              TransactionalTestExecutionListener.class, DbUnitTestExecutionListener.class })
      @DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "login.xml")
      public class LoginControllerTest {
  
          private MockMvc mockMvc;
  
          @Before
          public void setUp() {
              mockMvc = MockMvcBuilders.xmlConfigSetup("loginControllerTest-context.xml").build();
          }
  
          @Test
          @ExpectedDatabase("login.xml")
          public void testShowForm() throws Exception {
              mockMvc.perform(get("/login")).andExpect(status().isOk()).andExpect(view().name("/login"))
                      .andExpect(forwardedUrl("/WebContent/j/login.jsp"))
                      .andExpect(model().attribute("form", hasProperty("id", nullValue())))
                      .andExpect(model().attribute("form", hasProperty("email", isEmptyOrNullString())))
                      .andExpect(model().attribute("form", hasProperty("username", isEmptyOrNullString())))
                      .andExpect(model().attribute("form", hasProperty("hostname", isEmptyOrNullString())))
                      .andExpect(model().attribute("form", hasProperty("pass", isEmptyOrNullString())));
          }
      }
  </code></pre>
  
  <p>This here is <strong>loginControllerTest-context.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
      xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/task
      http://www.springframework.org/schema/task/spring-task-3.2.xsd
      http://www.springframework.org/schema/mvc
      http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
      http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.2.xsd
      http://www.springframework.org/schema/tx 
      http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"&gt;
  
      &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
      &lt;context:component-scan base-package="com.profiles.controller.test" /&gt;
  
      &lt;bean id="dataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="org.hsqldb.jdbcDriver" /&gt;
          &lt;property name="url" value="jdbc:hsqldb:mem:login" /&gt;
          &lt;property name="username" value="sa" /&gt;
          &lt;property name="password" value="" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>This here is login.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;dataset&gt;
      &lt;person id="1" email="qwerty@asdf.com" username="qwerty"
          hostname="asdf.com" pass="password1234" /&gt;
  
      &lt;person id="2" email="zxcvb@asdf.com" username="zxcvb"
          hostname="asdf.com" pass="password1234" /&gt;
  &lt;/dataset&gt;
  </code></pre>
  
  <p>At last but not least <strong>Stack Trace</strong></p>
  
  <pre><code>org.dbunit.dataset.NoSuchTableException: person
      at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:288)
      at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:109)
      at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79)
      at com.github.springtestdbunit.DbUnitRunner.setupOrTeardown(DbUnitRunner.java:159)
      at com.github.springtestdbunit.DbUnitRunner.beforeTestMethod(DbUnitRunner.java:70)
      at com.github.springtestdbunit.DbUnitTestExecutionListener.beforeTestMethod(DbUnitTestExecutionListener.java:136)
      at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:277)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runBefores(SpringMethodRoadie.java:315)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runBeforesThenTestThenAfters(SpringMethodRoadie.java:253)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:234)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:204)
      at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:146)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:151)
      at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  
  junit.framework.ComparisonFailure: table count expected:&lt;[1]&gt; but was:&lt;[0]&gt;
      at org.dbunit.assertion.JUnitFailureFactory.createFailure(JUnitFailureFactory.java:39)
      at org.dbunit.assertion.DefaultFailureHandler.createFailure(DefaultFailureHandler.java:105)
      at org.dbunit.assertion.DbUnitAssert.assertEquals(DbUnitAssert.java:237)
      at org.dbunit.assertion.DbUnitAssert.assertEquals(DbUnitAssert.java:205)
      at org.dbunit.Assertion.assertEquals(Assertion.java:104)
      at com.github.springtestdbunit.assertion.DefaultDatabaseAssertion.assertEquals(DefaultDatabaseAssertion.java:33)
      at com.github.springtestdbunit.DbUnitRunner.verifyExpected(DbUnitRunner.java:128)
      at com.github.springtestdbunit.DbUnitRunner.afterTestMethod(DbUnitRunner.java:80)
      at com.github.springtestdbunit.DbUnitTestExecutionListener.afterTestMethod(DbUnitTestExecutionListener.java:141)
      at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:340)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runAfters(SpringMethodRoadie.java:351)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runBeforesThenTestThenAfters(SpringMethodRoadie.java:262)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:234)
      at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:204)
      at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:146)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:151)
      at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  </code></pre>