code style improvements.
[utils] / test / enterprise / src / test / java / org / wamblee / support / persistence / MyEntityExampleTestBase.java
index 7cb81a929dd9b6fc581db5b069a5076f21927766..649508e658b76f0431284a5984d75568a7a743e1 100644 (file)
  */ 
 package org.wamblee.support.persistence;
 
+import static junit.framework.Assert.*;
+
 import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-import javax.sql.DataSource;
 
-import org.dbunit.DataSourceDatabaseTester;
-import org.dbunit.DatabaseTestCase;
 import org.dbunit.IDatabaseTester;
 import org.dbunit.dataset.ITable;
-import org.dbunit.dataset.filter.ITableFilterSimple;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.wamblee.support.persistence.DatabaseUtils;
-import org.wamblee.support.persistence.JpaBuilder;
-import org.wamblee.support.persistence.JpaTester;
 import org.wamblee.support.persistence.JpaBuilder.JpaUnitOfWork;
 
-import static junit.framework.Assert.*;
-
 /**
  * This class shows an example of how to test an entity using jpa.
  */
@@ -69,12 +61,13 @@ public class MyEntityExampleTestBase {
         // but we don't need it. We can use datbase utils if we want to execute
         // straight JDBC calls.
         builder = jpaTester.getJpaBuilder();
-        dbtester = jpaTester.getDbTester();
+        dbtester = jpaTester.getDbUtils().createDbTester(new MyTables());
         dbutils = jpaTester.getDbUtils();
     }
 
     @After
     public void tearDown() {
+        dbutils.stop();
         jpaTester.stop();
     }