cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [4/8] cayenne git commit: Implement DBCleaner
Date Mon, 17 Nov 2014 19:03:57 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityIT.java
index ab8ac03..12069cc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityIT.java
@@ -28,8 +28,10 @@ import org.apache.cayenne.testdo.inheritance_people.AbstractPerson;
 import org.apache.cayenne.testdo.inheritance_people.CustomerRepresentative;
 import org.apache.cayenne.testdo.inheritance_people.Employee;
 import org.apache.cayenne.testdo.inheritance_people.Manager;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -39,7 +41,7 @@ import static org.junit.Assert.assertEquals;
 
 /**
  */
-@UseServerRuntime(ServerCase.PEOPLE_PROJECT)
+@UseServerRuntime(CayenneProjects.PEOPLE_PROJECT)
 public class DataContextQualifiedEntityIT extends ServerCase {
 
     @Inject
@@ -50,17 +52,11 @@ public class DataContextQualifiedEntityIT extends ServerCase {
 
     protected TableHelper tPerson;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
+    @Before
+    public void testSetUp() throws Exception {
         // manually break circular deps
         dbHelper.update("PERSON").set("DEPARTMENT_ID", null, Types.INTEGER).execute();
 
-        dbHelper.deleteAll("ADDRESS");
-        dbHelper.deleteAll("DEPARTMENT");
-        dbHelper.deleteAll("PERSON_NOTES");
-        dbHelper.deleteAll("PERSON");
-        dbHelper.deleteAll("CLIENT_COMPANY");
-        
         tPerson = new TableHelper(dbHelper, "PERSON");
         tPerson.setColumns(
                 "CLIENT_COMPANY_ID",

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingEhCacheIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingEhCacheIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingEhCacheIT.java
index d259acf..3e4f068 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingEhCacheIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingEhCacheIT.java
@@ -20,23 +20,19 @@ package org.apache.cayenne.access;
 
 import org.apache.cayenne.cache.EhCacheQueryCache;
 import org.apache.cayenne.test.jdbc.TableHelper;
-import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.After;
+import org.junit.Before;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextQueryCachingEhCacheIT extends DataContextQueryCachingIT {
     
     protected EhCacheQueryCache domainCache;
     protected EhCacheQueryCache contextCache;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 
@@ -56,8 +52,8 @@ public class DataContextQueryCachingEhCacheIT extends DataContextQueryCachingIT
         context.setQueryCache(contextCache);
     }
     
-    @Override
-    protected void tearDownBeforeInjection() throws Exception {
+    @After
+    public void testTearDown() throws Exception {
         domainCache.shutdown();
         contextCache.shutdown();
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingIT.java
index e82441f..570a0a3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingIT.java
@@ -30,8 +30,11 @@ import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -42,7 +45,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextQueryCachingIT extends ServerCase {
 
     @Inject
@@ -61,14 +64,8 @@ public class DataContextQueryCachingIT extends ServerCase {
         return this.domain.getDataNodes().iterator().next();
     }
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 
@@ -85,8 +82,8 @@ public class DataContextQueryCachingIT extends ServerCase {
         context.setQueryCache(new MapQueryCache(50));
     }
 
-    @Override
-    protected void tearDownBeforeInjection() throws Exception {
+    @After
+    public void testTearDown() throws Exception {
         domain.setQueryCache(oldCache);
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingOSCacheIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingOSCacheIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingOSCacheIT.java
index 7428fd5..1bc77dc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingOSCacheIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryCachingOSCacheIT.java
@@ -20,21 +20,16 @@ package org.apache.cayenne.access;
 
 import org.apache.cayenne.cache.OSQueryCache;
 import org.apache.cayenne.test.jdbc.TableHelper;
-import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextQueryCachingOSCacheIT extends DataContextQueryCachingIT {
 
     // runs super tests with a different setup...
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryChainIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryChainIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryChainIT.java
index db95860..d46be93 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryChainIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQueryChainIT.java
@@ -23,8 +23,8 @@ import org.apache.cayenne.QueryResponse;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.QueryChain;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -34,25 +34,12 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextQueryChainIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-    }
-
     @Test
     public void testSelectQuery() {
         Artist a1 = context.newObject(Artist.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshQueryIT.java
index 7ca4d20..f4ca6fc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshQueryIT.java
@@ -32,8 +32,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
@@ -45,7 +47,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextRefreshQueryIT extends ServerCase {
 
     @Inject
@@ -57,14 +59,8 @@ public class DataContextRefreshQueryIT extends ServerCase {
     protected TableHelper tArtist;
     protected TableHelper tPainting;
 
-    @Override
-    public void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshingIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshingIT.java
index 6086b6c..c882dc1 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshingIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRefreshingIT.java
@@ -29,8 +29,10 @@ import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.DataChannelInterceptor;
 import org.apache.cayenne.unit.di.UnitTestClosure;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -47,7 +49,7 @@ import static org.junit.Assert.assertNull;
  * refreshing relationships and attributes changed outside of Cayenne with and without
  * prefetching.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextRefreshingIT extends ServerCase {
 
     @Inject
@@ -62,14 +64,8 @@ public class DataContextRefreshingIT extends ServerCase {
     protected TableHelper tArtist;
     protected TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRelationshipQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRelationshipQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRelationshipQueryIT.java
index e5c9dc8..357b7f4 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRelationshipQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRelationshipQueryIT.java
@@ -25,8 +25,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
@@ -34,7 +36,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextRelationshipQueryIT extends ServerCase {
 
     @Inject
@@ -46,15 +48,8 @@ public class DataContextRelationshipQueryIT extends ServerCase {
     private TableHelper tArtist;
     private TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
         tPainting = new TableHelper(dbHelper, "PAINTING");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRollbackIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRollbackIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRollbackIT.java
index 0c67109..56209d2 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRollbackIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextRollbackIT.java
@@ -25,9 +25,9 @@ import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextRollbackIT extends ServerCase {
 
     @Inject
@@ -47,18 +47,6 @@ public class DataContextRollbackIT extends ServerCase {
     @Inject
     private ServerRuntime serverRuntime;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-    }
-
     @Test
     public void testRollbackNew() {
         Artist artist = (Artist) context.newObject("Artist");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateCompoundIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateCompoundIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateCompoundIT.java
index c6e8c29..76adc85 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateCompoundIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateCompoundIT.java
@@ -27,8 +27,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.compound.CompoundFkTestEntity;
 import org.apache.cayenne.testdo.compound.CompoundPkTestEntity;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.Collections;
@@ -38,7 +40,7 @@ import java.util.Map;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+@UseServerRuntime(CayenneProjects.COMPOUND_PROJECT)
 public class DataContextSQLTemplateCompoundIT extends ServerCase {
 
     @Inject
@@ -50,11 +52,8 @@ public class DataContextSQLTemplateCompoundIT extends ServerCase {
     protected TableHelper tCompoundPkTest;
     protected TableHelper tCompoundFkTest;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tCompoundPkTest = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
         tCompoundPkTest.setColumns("KEY1", "KEY2");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateIT.java
index 58c48f5..b7748b2 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateIT.java
@@ -35,9 +35,11 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.unit.util.SQLTemplateCustomizer;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -48,7 +50,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextSQLTemplateIT extends ServerCase {
 
     @Inject
@@ -66,14 +68,8 @@ public class DataContextSQLTemplateIT extends ServerCase {
     protected TableHelper tPainting;
     protected TableHelper tArtist;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSelectQuerySplitAliasesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSelectQuerySplitAliasesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSelectQuerySplitAliasesIT.java
index a71bcb0..1c2a489 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSelectQuerySplitAliasesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSelectQuerySplitAliasesIT.java
@@ -24,15 +24,17 @@ import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextSelectQuerySplitAliasesIT extends ServerCase {
 
     @Inject
@@ -44,15 +46,8 @@ public class DataContextSelectQuerySplitAliasesIT extends ServerCase {
     private TableHelper tArtist;
     private TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSerializationIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSerializationIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSerializationIT.java
index e677d04..d7e27fe 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSerializationIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSerializationIT.java
@@ -30,9 +30,12 @@ import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.util.Util;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.HashMap;
@@ -46,7 +49,7 @@ import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextSerializationIT extends ServerCase {
 
     @Inject
@@ -63,16 +66,10 @@ public class DataContextSerializationIT extends ServerCase {
 
     protected TableHelper tArtist;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
+    @Before
+    public void testSetUp() throws Exception {
         CayenneRuntime.bindThreadInjector(runtime.getInjector());
 
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
     }
@@ -81,8 +78,8 @@ public class DataContextSerializationIT extends ServerCase {
         tArtist.insert(33001, "aaa");
     }
 
-    @Override
-    protected void tearDownBeforeInjection() throws Exception {
+    @After
+    public void testTearDown() throws Exception {
         CayenneRuntime.bindThreadInjector(null);
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricIT.java
index 9f98d4f..3c3f2f1 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheEmpiricIT.java
@@ -29,8 +29,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.test.parallel.ParallelTestContainer;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.Collections;
@@ -40,7 +42,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextSharedCacheEmpiricIT extends ServerCase {
 
     private static final String NEW_NAME = "versionX";
@@ -57,14 +59,8 @@ public class DataContextSharedCacheEmpiricIT extends ServerCase {
     private DataContext c1;
     private DataContext c2;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         DataRowStore cache = new DataRowStore(
                 "cacheTest",
                 Collections.EMPTY_MAP,

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheIT.java
index 7b69abe..271611a 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSharedCacheIT.java
@@ -27,13 +27,14 @@ import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.parallel.ParallelTestContainer;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.unit.util.SQLTemplateCustomizer;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.Collection;
@@ -54,16 +55,13 @@ import static org.junit.Assert.assertTrue;
  * Test suite for testing behavior of multiple DataContexts that share the same underlying
  * DataDomain.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextSharedCacheIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
     @Inject
-    protected DBHelper dbHelper;
-
-    @Inject
     private DataContext context1;
 
     @Inject
@@ -71,17 +69,8 @@ public class DataContextSharedCacheIT extends ServerCase {
 
     private Artist artist;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("EXHIBIT");
-        dbHelper.deleteAll("GALLERY");
-
+    @Before
+    public void testSetUp() throws Exception {
         // prepare a single artist record
         artist = (Artist) context.newObject("Artist");
         artist.setArtistName("version1");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextValidationIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextValidationIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextValidationIT.java
index 6005077..a99e813 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextValidationIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextValidationIT.java
@@ -21,9 +21,9 @@ package org.apache.cayenne.access;
 
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.unit.util.ValidationDelegate;
@@ -36,25 +36,12 @@ import static org.junit.Assert.assertTrue;
 
 /**
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextValidationIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-    }
-
     @Test
     public void testValidatingObjectsOnCommitProperty() throws Exception {
         context.setValidatingObjectsOnCommit(true);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainCallbacksIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainCallbacksIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainCallbacksIT.java
index c670b5a..43d09d6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainCallbacksIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainCallbacksIT.java
@@ -28,9 +28,9 @@ import org.apache.cayenne.query.EJBQLQuery;
 import org.apache.cayenne.query.RefreshQuery;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.reflect.LifecycleCallbackRegistry;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -41,7 +41,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataDomainCallbacksIT extends ServerCase {
 
     @Inject
@@ -52,20 +52,6 @@ public class DataDomainCallbacksIT extends ServerCase {
 
     @Inject
     private ObjectContext context1;
-    
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("EXHIBIT");
-        dbHelper.deleteAll("GALLERY");
-    }
 
     @Test
     public void testPostLoad() throws Exception {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainFiltersIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainFiltersIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainFiltersIT.java
index 8e8a877..36dd7f8 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainFiltersIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainFiltersIT.java
@@ -29,6 +29,7 @@ import org.apache.cayenne.graph.GraphDiff;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.util.ListResponse;
@@ -41,7 +42,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataDomainFiltersIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainIT.java
index 5607bb1..479ca3f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainIT.java
@@ -34,6 +34,7 @@ import org.apache.cayenne.testdo.testmap.Exhibit;
 import org.apache.cayenne.testdo.testmap.Gallery;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.testdo.testmap.annotations.Tag1;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -50,7 +51,7 @@ import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataDomainIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainQueryActionIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainQueryActionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainQueryActionIT.java
index 373dcc5..55016e7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainQueryActionIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataDomainQueryActionIT.java
@@ -27,10 +27,11 @@ import org.apache.cayenne.query.QueryCacheStrategy;
 import org.apache.cayenne.query.QueryMetadata;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.query.SortOrder;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.After;
 import org.junit.Test;
 
 import java.io.Serializable;
@@ -38,7 +39,7 @@ import java.util.List;
 
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataDomainQueryActionIT extends ServerCase {
 
     @Inject
@@ -47,21 +48,8 @@ public class DataDomainQueryActionIT extends ServerCase {
     @Inject
     private ServerRuntime runtime;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    public void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-    }
-
-    @Override
-    public void tearDownBeforeInjection() {
+    @After
+    public void testTearDown() {
         runtime.getDataDomain().resetProperties();
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
index 9584e22..62d3adf 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeIT.java
@@ -22,6 +22,7 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -30,7 +31,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataNodeIT extends ServerCase {
     
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeQueriesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeQueriesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeQueriesIT.java
index 99ccb2c..02f4ff6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeQueriesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataNodeQueriesIT.java
@@ -26,9 +26,11 @@ import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.unit.util.SQLTemplateCustomizer;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Date;
@@ -40,7 +42,7 @@ import java.util.Map;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataNodeQueriesIT extends ServerCase {
 
     @Inject
@@ -54,14 +56,8 @@ public class DataNodeQueriesIT extends ServerCase {
 
     protected TableHelper tArtist;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
index f5470bd..6a15123 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
@@ -23,6 +23,7 @@ import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -36,7 +37,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataRowStoreIT extends ServerCase {
 
     @Test

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowUtilsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowUtilsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowUtilsIT.java
index 3d942b3..3632acc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowUtilsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowUtilsIT.java
@@ -30,8 +30,10 @@ import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Gallery;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
@@ -41,7 +43,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataRowUtilsIT extends ServerCase {
 
     @Inject
@@ -53,14 +55,8 @@ public class DataRowUtilsIT extends ServerCase {
     protected TableHelper tArtist;
     protected TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DateTimeTypesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DateTimeTypesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DateTimeTypesIT.java
index 75c3812..1883fca 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DateTimeTypesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DateTimeTypesIT.java
@@ -23,9 +23,9 @@ import org.apache.cayenne.DataRow;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.NamedQuery;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.date_time.CalendarEntity;
 import org.apache.cayenne.testdo.date_time.DateTestEntity;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -41,21 +41,12 @@ import static org.junit.Assert.assertTrue;
 /**
  * Tests Date handling in Cayenne.
  */
-@UseServerRuntime(ServerCase.DATE_TIME_PROJECT)
+@UseServerRuntime(CayenneProjects.DATE_TIME_PROJECT)
 public class DateTimeTypesIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("CALENDAR_TEST");
-        dbHelper.deleteAll("DATE_TEST");
-    }
-
     @Test
     public void testCalendar() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DbGeneratorIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DbGeneratorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DbGeneratorIT.java
index ffa489b..e7fac36 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DbGeneratorIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DbGeneratorIT.java
@@ -25,8 +25,10 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import static org.junit.Assert.assertFalse;
@@ -34,7 +36,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DbGeneratorIT extends ServerCase {
 
     @Inject
@@ -48,8 +50,8 @@ public class DbGeneratorIT extends ServerCase {
 
     private DbGenerator generator;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
+    @Before
+    public void testSetUp() throws Exception {
         generator = new DbGenerator(adapter, runtime
                 .getDataDomain()
                 .getDataMap("testmap"), logger);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderIT.java
index 8bad0d2..3294b19 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderIT.java
@@ -30,9 +30,12 @@ import org.apache.cayenne.map.DbRelationship;
 import org.apache.cayenne.map.ObjAttribute;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.unit.UnitDbAdapter;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.ServerCaseDataSourceFactory;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -45,7 +48,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DbLoaderIT extends ServerCase {
 
     @Inject
@@ -62,13 +65,13 @@ public class DbLoaderIT extends ServerCase {
 
     private DbLoader loader;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
+    @Before
+    public void testSetUp() throws Exception {
         loader = new DbLoader(dataSourceFactory.getSharedDataSource().getConnection(), adapter, null);
     }
 
-    @Override
-    protected void tearDownBeforeInjection() throws Exception {
+    @After
+    public void testTearDown() throws Exception {
         loader.getConnection().close();
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderPartialIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderPartialIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderPartialIT.java
index 4b0a9cd..343f80c 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderPartialIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DbLoaderPartialIT.java
@@ -24,9 +24,12 @@ import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.ServerCaseDataSourceFactory;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.Collection;
@@ -34,7 +37,7 @@ import java.util.Collection;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DbLoaderPartialIT extends ServerCase {
 
     @Inject
@@ -45,8 +48,8 @@ public class DbLoaderPartialIT extends ServerCase {
 
     private DbLoader loader;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
+    @Before
+    public void testSetUp() throws Exception {
         loader = new DbLoader(
                 dataSourceFactory.getSharedDataSource().getConnection(),
                 adapter,
@@ -59,8 +62,8 @@ public class DbLoaderPartialIT extends ServerCase {
                 });
     }
 
-    @Override
-    protected void tearDownBeforeInjection() throws Exception {
+    @After
+    public void testTearDown() throws Exception {
         loader.getConnection().close();
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteObjectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteObjectIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteObjectIT.java
index 6bb7cd3..fa33e47 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteObjectIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteObjectIT.java
@@ -29,8 +29,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -40,7 +42,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DeleteObjectIT extends ServerCase {
 
     @Inject
@@ -52,14 +54,8 @@ public class DeleteObjectIT extends ServerCase {
     protected TableHelper tArtist;
     protected TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteRulesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteRulesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteRulesIT.java
index 6fbd8da..4c1aece 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteRulesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DeleteRulesIT.java
@@ -27,12 +27,12 @@ import org.apache.cayenne.graph.NodeDiff;
 import org.apache.cayenne.map.DeleteRule;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.ObjRelationship;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleFlatA;
 import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleFlatB;
 import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest1;
 import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest2;
 import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest3;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -47,25 +47,12 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_DELETE_RULES_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_DELETE_RULES_PROJECT)
 public class DeleteRulesIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("DELETE_RULE_TEST3");
-        dbHelper.deleteAll("DELETE_RULE_TEST1");
-        dbHelper.deleteAll("DELETE_RULE_TEST2");
-        dbHelper.deleteAll("DELETE_RULE_JOIN");
-        dbHelper.deleteAll("DELETE_RULE_FLATB");
-        dbHelper.deleteAll("DELETE_RULE_FLATA");
-    }
-
     @Test
     public void testDenyToOne() {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/EmbeddingIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/EmbeddingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/EmbeddingIT.java
index 1dfbf5d..7d50b47 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/EmbeddingIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/EmbeddingIT.java
@@ -29,8 +29,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.embeddable.EmbedEntity1;
 import org.apache.cayenne.testdo.embeddable.Embeddable1;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
@@ -38,7 +40,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.EMBEDDABLE_PROJECT)
+@UseServerRuntime(CayenneProjects.EMBEDDABLE_PROJECT)
 public class EmbeddingIT extends ServerCase {
     
     @Inject
@@ -48,11 +50,9 @@ public class EmbeddingIT extends ServerCase {
     protected DBHelper dbHelper;
     
     protected TableHelper tEmbedEntity1;
-    
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("EMBED_ENTITY1");
-        
+
+    @Before
+    public void testSetUp() throws Exception {
         tEmbedEntity1 = new TableHelper(dbHelper, "EMBED_ENTITY1");
         tEmbedEntity1.setColumns("ID", "NAME", "EMBEDDED10", "EMBEDDED20", "EMBEDDED30", "EMBEDDED40");
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/EntityInheritanceIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/EntityInheritanceIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/EntityInheritanceIT.java
index 4fffde1..0229f81 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/EntityInheritanceIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/EntityInheritanceIT.java
@@ -23,13 +23,14 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.inheritance.BaseEntity;
 import org.apache.cayenne.testdo.inheritance.RelatedEntity;
 import org.apache.cayenne.testdo.inheritance.SubEntity;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ServerCase.INHERITANCE_PROJECT)
+@UseServerRuntime(CayenneProjects.INHERITANCE_PROJECT)
 public class EntityInheritanceIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/EnumIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/EnumIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/EnumIT.java
index 7b6e1a8..81d9b75 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/EnumIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/EnumIT.java
@@ -29,6 +29,7 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.enum_test.Enum1;
 import org.apache.cayenne.testdo.enum_test.EnumEntity;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -36,7 +37,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ServerCase.ENUM_PROJECT)
+@UseServerRuntime(CayenneProjects.ENUM_PROJECT)
 public class EnumIT extends ServerCase {
 
     @Inject
@@ -45,12 +46,6 @@ public class EnumIT extends ServerCase {
     @Inject
     private DBHelper dbHelper;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("ENUM_ENTITY");
-
-    }
-
     private void createDataSet() throws Exception {
         TableHelper tEnumEntity = new TableHelper(dbHelper, "ENUM_ENTITY");
         tEnumEntity.setColumns("ID", "ENUM_ATTRIBUTE");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedArcKeyIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedArcKeyIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedArcKeyIT.java
index 397c8ac..7e3bd7f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedArcKeyIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedArcKeyIT.java
@@ -25,6 +25,7 @@ import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.ObjRelationship;
 import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest1;
 import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest3;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -33,7 +34,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_FLATTENED_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_FLATTENED_PROJECT)
 public class FlattenedArcKeyIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedPrefetchIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedPrefetchIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedPrefetchIT.java
index ce8dd83..b7cd2c5 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedPrefetchIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedPrefetchIT.java
@@ -32,8 +32,10 @@ import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.DataChannelInterceptor;
 import org.apache.cayenne.unit.di.UnitTestClosure;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -46,7 +48,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class FlattenedPrefetchIT extends ServerCase {
 
     @Inject
@@ -63,16 +65,9 @@ public class FlattenedPrefetchIT extends ServerCase {
     protected TableHelper tArtgroup;
     protected TableHelper tArtistGroup;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
+    @Before
+    public void testSetUp() throws Exception {
         dbHelper.update("ARTGROUP").set("PARENT_GROUP_ID", null, Types.INTEGER).execute();
-        dbHelper.deleteAll("ARTGROUP");
 
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedRelationshipInContextIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedRelationshipInContextIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedRelationshipInContextIT.java
index 9f4e7b0..960fd97 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedRelationshipInContextIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/FlattenedRelationshipInContextIT.java
@@ -28,8 +28,10 @@ import org.apache.cayenne.reflect.ClassDescriptor;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest3;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
@@ -38,7 +40,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_FLATTENED_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_FLATTENED_PROJECT)
 public class FlattenedRelationshipInContextIT extends ServerCase {
 
     @Inject
@@ -51,14 +53,8 @@ public class FlattenedRelationshipInContextIT extends ServerCase {
     private TableHelper tFlattenedTest2;
     private TableHelper tFlattenedTest3;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("COMPLEX_JOIN");
-        dbHelper.deleteAll("FLATTENED_TEST_4");
-        dbHelper.deleteAll("FLATTENED_TEST_3");
-        dbHelper.deleteAll("FLATTENED_TEST_2");
-        dbHelper.deleteAll("FLATTENED_TEST_1");
-
+    @Before
+    public void testSetUp() throws Exception {
         tFlattenedTest1 = new TableHelper(dbHelper, "FLATTENED_TEST_1");
         tFlattenedTest1.setColumns("FT1_ID", "NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/IdentityColumnsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/IdentityColumnsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/IdentityColumnsIT.java
index b98eed7..dad1db3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/IdentityColumnsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/IdentityColumnsIT.java
@@ -37,8 +37,10 @@ import org.apache.cayenne.testdo.generated.GeneratedColumnTest2;
 import org.apache.cayenne.testdo.generated.GeneratedColumnTestEntity;
 import org.apache.cayenne.testdo.generated.GeneratedF1;
 import org.apache.cayenne.testdo.generated.GeneratedF2;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.util.List;
@@ -48,7 +50,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.GENERATED_PROJECT)
+@UseServerRuntime(CayenneProjects.GENERATED_PROJECT)
 public class IdentityColumnsIT extends ServerCase {
 
     @Inject
@@ -65,15 +67,8 @@ public class IdentityColumnsIT extends ServerCase {
 
     protected TableHelper joinTable;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        // TODO: extract in a separate DataMap?
-        dbHelper.deleteAll("GENERATED_JOIN");
-        dbHelper.deleteAll("GENERATED_F1");
-        dbHelper.deleteAll("GENERATED_F2");
-        dbHelper.deleteAll("GENERATED_COLUMN_DEP");
-        dbHelper.deleteAll("GENERATED_COLUMN_TEST");
-
+    @Before
+    public void testSetUp() throws Exception {
         joinTable = new TableHelper(dbHelper, "GENERATED_JOIN");
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/IncrementalFaultListIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/IncrementalFaultListIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/IncrementalFaultListIT.java
index 5faf72b..8b09ab5 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/IncrementalFaultListIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/IncrementalFaultListIT.java
@@ -21,6 +21,7 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.util.Util;
@@ -29,7 +30,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class IncrementalFaultListIT extends ServerCase {
 
 	@Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/JointPrefetchIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/JointPrefetchIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/JointPrefetchIT.java
index 8779b3f..62cc1fa 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/JointPrefetchIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/JointPrefetchIT.java
@@ -42,8 +42,10 @@ import org.apache.cayenne.testdo.testmap.Gallery;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.DataChannelInterceptor;
 import org.apache.cayenne.unit.di.UnitTestClosure;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Date;
@@ -63,7 +65,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Tests joint prefetch handling by Cayenne access stack.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class JointPrefetchIT extends ServerCase {
 
     @Inject
@@ -82,14 +84,8 @@ public class JointPrefetchIT extends ServerCase {
     protected TableHelper tGallery;
     protected TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT"); // table artist_exhibit depends on artist and exhibit
-        dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("EXHIBIT"); // table exhibit depends on gallery
-        dbHelper.deleteAll("GALLERY");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/MiscTypesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/MiscTypesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/MiscTypesIT.java
index c43dbb0..30eecfc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/MiscTypesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/MiscTypesIT.java
@@ -22,11 +22,11 @@ import org.apache.cayenne.MockSerializable;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.misc_types.ArraysEntity;
 import org.apache.cayenne.testdo.misc_types.CharacterEntity;
 import org.apache.cayenne.testdo.misc_types.SerializableEntity;
 import org.apache.cayenne.unit.UnitDbAdapter;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.MISC_TYPES_PROJECT)
+@UseServerRuntime(CayenneProjects.MISC_TYPES_PROJECT)
 public class MiscTypesIT extends ServerCase {
 
     @Inject
@@ -46,19 +46,6 @@ public class MiscTypesIT extends ServerCase {
     @Inject
     private UnitDbAdapter accessStackAdapter;
     
-    @Inject 
-    private DBHelper dbHelper;
-    
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        if(accessStackAdapter.supportsLobs()) {
-            dbHelper.deleteAll("SERIALIZABLE_ENTITY");
-        }
-        
-        dbHelper.deleteAll("ARRAYS_ENTITY");
-        dbHelper.deleteAll("CHARACTER_ENTITY");
-    }
-
     @Test
     public void testSerializable() throws Exception {
         

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheIT.java
index 74c2b41..2c7cb06 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheIT.java
@@ -24,8 +24,8 @@ import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.QueryCacheStrategy;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -35,7 +35,7 @@ import java.util.List;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class NestedDataContextLocalCacheIT extends ServerCase {
 
     @Inject
@@ -44,20 +44,6 @@ public class NestedDataContextLocalCacheIT extends ServerCase {
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("EXHIBIT");
-        dbHelper.deleteAll("GALLERY");
-    }
-
     @Test
     public void testLocalCacheStaysLocal() {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsIT.java
index f3309db..34512bf 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsIT.java
@@ -24,6 +24,7 @@ import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.test.parallel.ParallelTestContainer;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -33,7 +34,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class NestedDataContextParentEventsIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsIT.java
index e653f68..3b62cbf 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsIT.java
@@ -25,6 +25,7 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.test.parallel.ParallelTestContainer;
 import org.apache.cayenne.testdo.relationships_child_master.Child;
 import org.apache.cayenne.testdo.relationships_child_master.Master;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -35,7 +36,7 @@ import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_CHILD_MASTER_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_CHILD_MASTER_PROJECT)
 public class NestedDataContextParentPeerEventsIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsIT.java
index 2b3c306..5c71361 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsIT.java
@@ -26,6 +26,7 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.test.parallel.ParallelTestContainer;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -35,7 +36,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class NestedDataContextPeerEventsIT extends ServerCase {
 
 	@Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
index 6f87de4..ad9dd99 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextReadIT.java
@@ -37,8 +37,10 @@ import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.DataChannelInterceptor;
 import org.apache.cayenne.unit.di.UnitTestClosure;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -54,7 +56,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class NestedDataContextReadIT extends ServerCase {
 
     @Inject
@@ -72,14 +74,8 @@ public class NestedDataContextReadIT extends ServerCase {
     private TableHelper tArtist;
     private TableHelper tPainting;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackIT.java
index 5adc512..af318c7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackIT.java
@@ -22,6 +22,7 @@ import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -29,7 +30,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class NestedDataContextRollbackIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextValidationIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextValidationIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextValidationIT.java
index af65367..b7e0c58 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextValidationIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NestedDataContextValidationIT.java
@@ -22,8 +22,8 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.apache.cayenne.validation.ValidationException;
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class NestedDataContextValidationIT extends ServerCase {
 
     @Inject
@@ -42,18 +42,6 @@ public class NestedDataContextValidationIT extends ServerCase {
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("ARTIST_GROUP");
-        dbHelper.deleteAll("ARTIST");
-    }
-
     @Test
     public void testValidateOnCommitToParent() {
         context.setValidatingObjectsOnCommit(true);


Mime
View raw message