cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [6/8] cayenne git commit: Implement DBCleaner
Date Mon, 17 Nov 2014 19:03:59 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorIT.java b/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorIT.java
index 4b7dc76..85e55a9 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorIT.java
@@ -27,7 +27,7 @@ import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.remote.service.LocalConnection;
 import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass1;
 import org.apache.cayenne.testdo.mt.MtTable1Subclass1;
-import org.apache.cayenne.unit.di.client.ClientCase;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -39,7 +39,7 @@ import java.util.Collection;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ClientCase.MULTI_TIER_PROJECT)
+@UseServerRuntime(CayenneProjects.MULTI_TIER_PROJECT)
 @RunWith(value=Parameterized.class)
 public class ValueInjectorIT extends RemoteCayenneCase {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCase.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCase.java b/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCase.java
index f9bdc55..a8781d2 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCase.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCase.java
@@ -19,9 +19,11 @@
 package org.apache.cayenne.unit.di.client;
 
 import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.spi.DefaultScope;
 import org.apache.cayenne.unit.di.DICase;
+import org.apache.cayenne.unit.di.server.DBCleaner;
 import org.apache.cayenne.unit.di.server.SchemaBuilder;
 import org.apache.cayenne.unit.di.server.ServerCaseModule;
 
@@ -29,18 +31,11 @@ public class ClientCase extends DICase {
 
     public static final String ROP_CLIENT_KEY = "client";
 
-    public static final String MULTI_TIER_PROJECT = "cayenne-multi-tier.xml";
-    public static final String PERSISTENT_PROJECT = "cayenne-persistent.xml";
-    public static final String REFLEXIVE_PROJECT = "cayenne-reflexive.xml";
-    public static final String DELETE_RULES_PROJECT = "cayenne-delete-rules.xml";
-    public static final String LIFECYCLES_PROJECT = "cayenne-lifecycles.xml";
-    public static final String MAP_TO_MANY_PROJECT = "cayenne-map-to-many.xml";
-    public static final String TOONE_PROJECT = "cayenne-toone.xml";
-    public static final String MEANINGFUL_PK_PROJECT = "cayenne-meaningful-pk.xml";
-    public static final String TABLE_PRIMITIVES_PROJECT = "cayenne-table-primitives.xml";
-
     private static final Injector injector;
 
+    @Inject
+    private DBCleaner dbCleaner;
+
     static {
         DefaultScope testScope = new DefaultScope();
         injector = DIBootstrap.createInjector(
@@ -51,6 +46,11 @@ public class ClientCase extends DICase {
     }
 
     @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbCleaner.clean();
+    }
+
+    @Override
     protected Injector getUnitTestInjector() {
         return injector;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCaseSelfIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCaseSelfIT.java b/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCaseSelfIT.java
index 32fb280..cc79b35 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCaseSelfIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/unit/di/client/ClientCaseSelfIT.java
@@ -21,6 +21,7 @@ package org.apache.cayenne.unit.di.client;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Provider;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 
@@ -28,7 +29,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ClientCase.MULTI_TIER_PROJECT)
+@UseServerRuntime(CayenneProjects.MULTI_TIER_PROJECT)
 public class ClientCaseSelfIT extends ClientCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-client/src/test/java/org/apache/cayenne/util/ObjectDetachOperationIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/util/ObjectDetachOperationIT.java b/cayenne-client/src/test/java/org/apache/cayenne/util/ObjectDetachOperationIT.java
index 236e06a..7537eb9 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/util/ObjectDetachOperationIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/util/ObjectDetachOperationIT.java
@@ -29,7 +29,9 @@ import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.mt.ClientMtTable1;
 import org.apache.cayenne.testdo.mt.MtTable1;
 import org.apache.cayenne.unit.di.client.ClientCase;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -38,7 +40,7 @@ import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ClientCase.MULTI_TIER_PROJECT)
+@UseServerRuntime(CayenneProjects.MULTI_TIER_PROJECT)
 public class ObjectDetachOperationIT extends ClientCase {
 
     @Inject
@@ -49,11 +51,8 @@ public class ObjectDetachOperationIT extends ClientCase {
 
     private TableHelper tMtTable1;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("MT_TABLE2");
-        dbHelper.deleteAll("MT_TABLE1");
-
+    @Before
+    public void testSetUp() throws Exception {
         tMtTable1 = new TableHelper(dbHelper, "MT_TABLE1");
         tMtTable1.setColumns("TABLE1_ID", "GLOBAL_ATTRIBUTE1", "SERVER_ATTRIBUTE1");
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-client/src/test/java/org/apache/cayenne/util/ShallowMergeOperation_ClientIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/util/ShallowMergeOperation_ClientIT.java b/cayenne-client/src/test/java/org/apache/cayenne/util/ShallowMergeOperation_ClientIT.java
index 398467b..2c19a92 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/util/ShallowMergeOperation_ClientIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/util/ShallowMergeOperation_ClientIT.java
@@ -33,14 +33,16 @@ import org.apache.cayenne.testdo.mt.ClientMtTable2;
 import org.apache.cayenne.unit.di.DataChannelInterceptor;
 import org.apache.cayenne.unit.di.UnitTestClosure;
 import org.apache.cayenne.unit.di.client.ClientCase;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Before;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ClientCase.MULTI_TIER_PROJECT)
+@UseServerRuntime(CayenneProjects.MULTI_TIER_PROJECT)
 public class ShallowMergeOperation_ClientIT extends ClientCase {
 
     @Inject
@@ -57,14 +59,8 @@ public class ShallowMergeOperation_ClientIT extends ClientCase {
 
     private TableHelper tMtTable1;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("MT_TABLE2");
-        dbHelper.deleteAll("MT_TABLE1");
-        dbHelper.deleteAll("MT_JOIN45");
-        dbHelper.deleteAll("MT_TABLE4");
-        dbHelper.deleteAll("MT_TABLE5");
-
+    @Before
+    public void testSetUp() throws Exception {
         tMtTable1 = new TableHelper(dbHelper, "MT_TABLE1");
         tMtTable1.setColumns("TABLE1_ID", "GLOBAL_ATTRIBUTE1", "SERVER_ATTRIBUTE1");
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOCollectionRelationshipIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOCollectionRelationshipIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOCollectionRelationshipIT.java
index cdb5ff9..a24f3ce 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOCollectionRelationshipIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOCollectionRelationshipIT.java
@@ -26,8 +26,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.relationships_collection_to_many.CollectionToMany;
 import org.apache.cayenne.testdo.relationships_collection_to_many.CollectionToManyTarget;
+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.Collection;
@@ -39,7 +41,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_COLLECTION_TO_MANY_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_COLLECTION_TO_MANY_PROJECT)
 public class CDOCollectionRelationshipIT extends ServerCase {
 
     @Inject
@@ -48,11 +50,8 @@ public class CDOCollectionRelationshipIT extends ServerCase {
     @Inject
     private DBHelper dbHelper;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("COLLECTION_TO_MANY_TARGET");
-        dbHelper.deleteAll("COLLECTION_TO_MANY");
-
+    @Before
+    public void testSetUp() throws Exception {
         TableHelper tCollectionToMany = new TableHelper(dbHelper, "COLLECTION_TO_MANY");
         tCollectionToMany.setColumns("ID");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneIT.java
index fefc3b3..cdfd183 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneIT.java
@@ -32,8 +32,10 @@ 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.testdo.testmap.ROPainting;
+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.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CDOMany2OneIT extends ServerCase {
 
     @Inject
@@ -62,16 +64,8 @@ public class CDOMany2OneIT extends ServerCase {
     protected TableHelper tPainting;
     protected TableHelper tGallery;
 
-    @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 {
         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/CDOMany2OneNoRevIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneNoRevIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneNoRevIT.java
index 232e685..3aa3423 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneNoRevIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOMany2OneNoRevIT.java
@@ -22,6 +22,7 @@ package org.apache.cayenne;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting1;
+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.assertNotNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CDOMany2OneNoRevIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOMapRelationshipIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOMapRelationshipIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOMapRelationshipIT.java
index ada0d70..4c99936 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOMapRelationshipIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOMapRelationshipIT.java
@@ -27,8 +27,10 @@ import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.map_to_many.IdMapToMany;
 import org.apache.cayenne.testdo.map_to_many.MapToMany;
 import org.apache.cayenne.testdo.map_to_many.MapToManyTarget;
+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.Map;
@@ -40,7 +42,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.MAP_TO_MANY_PROJECT)
+@UseServerRuntime(CayenneProjects.MAP_TO_MANY_PROJECT)
 public class CDOMapRelationshipIT extends ServerCase {
 
     @Inject
@@ -54,14 +56,8 @@ public class CDOMapRelationshipIT extends ServerCase {
     protected TableHelper tIdMapToMany;
     protected TableHelper tIdMapToManyTarget;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("MAP_TO_MANY_TARGET");
-        dbHelper.deleteAll("MAP_TO_MANY");
-
-        dbHelper.deleteAll("ID_MAP_TO_MANY_TARGET");
-        dbHelper.deleteAll("ID_MAP_TO_MANY");
-
+    @Before
+    public void testSetUp() throws Exception {
         tMapToMany = new TableHelper(dbHelper, "MAP_TO_MANY");
         tMapToMany.setColumns("ID");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2ManyIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2ManyIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2ManyIT.java
index b8a09c3..022e8fd 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2ManyIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2ManyIT.java
@@ -31,8 +31,10 @@ import org.apache.cayenne.testdo.testmap.ArtistExhibit;
 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.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.Date;
@@ -42,7 +44,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 CDOOne2ManyIT extends ServerCase {
 
     @Inject
@@ -57,17 +59,8 @@ public class CDOOne2ManyIT extends ServerCase {
     protected TableHelper tArtist;
     protected 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");
-        dbHelper.deleteAll("EXHIBIT");
-        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/CDOOne2OneDepIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2OneDepIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2OneDepIT.java
index 470d298..fcf94dd 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2OneDepIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOOne2OneDepIT.java
@@ -24,6 +24,7 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.testdo.testmap.PaintingInfo;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 
@@ -33,7 +34,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime("cayenne-small-testmap.xml")
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CDOOne2OneDepIT extends CayenneDOTestBase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOOneDep2OneIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOOneDep2OneIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOOneDep2OneIT.java
index b93d1cc..3e38dd5 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOOneDep2OneIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOOneDep2OneIT.java
@@ -27,6 +27,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.PaintingInfo;
+import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 
@@ -38,7 +39,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime("cayenne-small-testmap.xml")
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CDOOneDep2OneIT extends CayenneDOTestBase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToManyFKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToManyFKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToManyFKIT.java
index 6d85e10..a442452 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToManyFKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToManyFKIT.java
@@ -21,10 +21,10 @@ package org.apache.cayenne;
 
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.di.Inject;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyFkDep;
 import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyFkRoot;
 import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyRoot2;
+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,22 +35,12 @@ import static org.junit.Assert.assertSame;
 
 // TODO: this mapping scenario is really unsupported ... this is just an attempt at
 // partial solution
-@UseServerRuntime(ServerCase.RELATIONSHIPS_TO_MANY_FK_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_TO_MANY_FK_PROJECT)
 public class CDOOneToManyFKIT extends ServerCase {
 
     @Inject
     protected DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("TO_MANY_FKDEP");
-        dbHelper.deleteAll("TO_MANY_FKROOT");
-        dbHelper.deleteAll("TO_MANY_ROOT2");
-    }
-
     @Test
     public void testReadRelationship() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToOneFKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToOneFKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToOneFKIT.java
index 371b523..ea21563 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToOneFKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOOneToOneFKIT.java
@@ -22,9 +22,9 @@ package org.apache.cayenne;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.ObjectIdQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.relationships_to_one_fk.ToOneFK1;
 import org.apache.cayenne.testdo.relationships_to_one_fk.ToOneFK2;
+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.assertTrue;
 /**
  * Tests the behavior of one-to-one relationship where to-one is pointing to an FK.
  */
-@UseServerRuntime(ServerCase.RELATIONSHIPS_TO_ONE_FK_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_TO_ONE_FK_PROJECT)
 public class CDOOneToOneFKIT extends ServerCase {
 
     @Inject
@@ -47,15 +47,6 @@ public class CDOOneToOneFKIT extends ServerCase {
     @Inject
     private DataContext context1;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("TO_ONE_FK1");
-        dbHelper.deleteAll("TO_ONE_FK2");
-    }
-
     @Test
     public void testReadRelationship() {
         ToOneFK2 src = context.newObject(ToOneFK2.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesIT.java
index 74c65df..837d698 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesIT.java
@@ -25,8 +25,10 @@ import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.qualified.Qualified1;
 import org.apache.cayenne.testdo.qualified.Qualified2;
 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.Before;
 import org.junit.Test;
 
 import java.sql.Types;
@@ -35,7 +37,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
-@UseServerRuntime(ServerCase.QUALIFIED_PROJECT)
+@UseServerRuntime(CayenneProjects.QUALIFIED_PROJECT)
 public class CDOQualifiedEntitiesIT extends ServerCase {
 
     @Inject
@@ -50,11 +52,8 @@ public class CDOQualifiedEntitiesIT extends ServerCase {
     private TableHelper tQualified1;
     private TableHelper tQualified2;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("TEST_QUALIFIED2");
-        dbHelper.deleteAll("TEST_QUALIFIED1");
-
+    @Before
+    public void testSetUp() throws Exception {
         int bool = accessStackAdapter.supportsBoolean() ? Types.BOOLEAN : Types.INTEGER;
 
         tQualified1 = new TableHelper(dbHelper, "TEST_QUALIFIED1");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteIT.java
index b789135..4911092 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteIT.java
@@ -21,11 +21,13 @@ package org.apache.cayenne;
 
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.ArtGroup;
+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;
 
-@UseServerRuntime("cayenne-small-testmap.xml")
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CDOReflexiveRelDeleteIT extends ServerCase {
 
     @Inject
@@ -36,9 +38,8 @@ public class CDOReflexiveRelDeleteIT extends ServerCase {
     private ArtGroup childGroup2;
     private ArtGroup childGroup3;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        super.setUpAfterInjection();
+    @Before
+    public void testSetUp() throws Exception {
 
         parentGroup = context.newObject(ArtGroup.class);
         parentGroup.setName("parent");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelIT.java
index 95ea822..56dfd47 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOReflexiveRelIT.java
@@ -21,6 +21,7 @@ package org.apache.cayenne;
 
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.ArtGroup;
+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;
  * Some more tests regarding reflexive relationships, especially related to delete rules
  * etc. The implementation is hairy, and so needs a really good workout.
  */
-@UseServerRuntime("cayenne-small-testmap.xml")
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CDOReflexiveRelIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CDOSetRelationshipIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CDOSetRelationshipIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CDOSetRelationshipIT.java
index 97d643b..0344ed6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CDOSetRelationshipIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CDOSetRelationshipIT.java
@@ -26,8 +26,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.relationships_set_to_many.SetToMany;
 import org.apache.cayenne.testdo.relationships_set_to_many.SetToManyTarget;
+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.Set;
@@ -39,7 +41,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_SET_TO_MANY_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_SET_TO_MANY_PROJECT)
 public class CDOSetRelationshipIT extends ServerCase {
 
     @Inject
@@ -51,11 +53,8 @@ public class CDOSetRelationshipIT extends ServerCase {
     protected TableHelper tSetToMany;
     protected TableHelper tSetToManyTarget;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("SET_TO_MANY_TARGET");
-        dbHelper.deleteAll("SET_TO_MANY");
-
+    @Before
+    public void testSetUp() throws Exception {
         tSetToMany = new TableHelper(dbHelper, "SET_TO_MANY");
         tSetToMany.setColumns("ID");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CayenneCompoundIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneCompoundIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneCompoundIT.java
index dec9c1e..fe2aa66 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneCompoundIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneCompoundIT.java
@@ -25,8 +25,10 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.compound.CharPkTestEntity;
 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.HashMap;
@@ -38,7 +40,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+@UseServerRuntime(CayenneProjects.COMPOUND_PROJECT)
 public class CayenneCompoundIT extends ServerCase {
 
     @Inject
@@ -50,12 +52,8 @@ public class CayenneCompoundIT extends ServerCase {
     protected TableHelper tCompoundPKTest;
     protected TableHelper tCharPKTest;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
-        dbHelper.deleteAll("CHAR_PK_TEST");
-
+    @Before
+    public void testSetUp() throws Exception {
         tCompoundPKTest = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
         tCompoundPKTest.setColumns("KEY1", "KEY2", "NAME");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDOTestBase.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
index 8815ca2..eee88e2 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
@@ -19,18 +19,16 @@ package org.apache.cayenne;
  *  under the License.
  ****************************************************************/
 
-import java.util.List;
-import java.sql.Types;
-
 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.testdo.testmap.PaintingInfo;
 import org.apache.cayenne.unit.di.server.ServerCase;
 
+import java.util.List;
+
 public abstract class CayenneDOTestBase extends ServerCase {
 
     public static final String artistName = "artist with one painting";
@@ -45,20 +43,6 @@ public abstract class CayenneDOTestBase extends ServerCase {
     @Inject
     protected ObjectContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("PAINTING_INFO");
-        dbHelper.deleteAll("PAINTING");
-        dbHelper.deleteAll("PAINTING1");
-        dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("EXHIBIT");
-        dbHelper.deleteAll("GALLERY");
-    }
-
     protected Artist newArtist() {
         Artist a1 = context.newObject(Artist.class);
         a1.setArtistName(artistName);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectFlattenedRelIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectFlattenedRelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectFlattenedRelIT.java
index b32f188..5629061 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectFlattenedRelIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectFlattenedRelIT.java
@@ -30,11 +30,12 @@ import org.apache.cayenne.testdo.testmap.ArtGroup;
 import org.apache.cayenne.testdo.testmap.Artist;
 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;
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
@@ -43,7 +44,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class CayenneDataObjectFlattenedRelIT extends ServerCase {
 
     @Inject
@@ -64,16 +65,8 @@ public class CayenneDataObjectFlattenedRelIT extends ServerCase {
 
     private TableHelper tArtistGroup;
 
-    @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.update("ARTGROUP").set("PARENT_GROUP_ID", null, Types.INTEGER).execute();
-        dbHelper.deleteAll("ARTGROUP");
-
+    @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/CayenneDataObjectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectIT.java
index 964766c..efe5c52 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectIT.java
@@ -25,6 +25,7 @@ import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.ArtistExhibit;
 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.TstBean;
@@ -37,7 +38,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 CayenneDataObjectIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectInContextIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectInContextIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectInContextIT.java
index 752efa7..074ea27 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectInContextIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectInContextIT.java
@@ -27,8 +27,10 @@ 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;
@@ -41,7 +43,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 CayenneDataObjectInContextIT extends ServerCase {
 
     @Inject
@@ -55,14 +57,8 @@ public class CayenneDataObjectInContextIT 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/CayenneDataObjectRelationshipsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectRelationshipsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectRelationshipsIT.java
index 725ce81..24a4884 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectRelationshipsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectRelationshipsIT.java
@@ -29,8 +29,10 @@ 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.testdo.testmap.PaintingInfo;
+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;
@@ -43,7 +45,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 CayenneDataObjectRelationshipsIT extends ServerCase {
 
     @Inject
@@ -59,14 +61,8 @@ public class CayenneDataObjectRelationshipsIT extends ServerCase {
     private TableHelper tPaintingInfo;
     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/CayenneDataObjectValidationIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectValidationIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectValidationIT.java
index d65b3c4..5eebeee 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectValidationIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneDataObjectValidationIT.java
@@ -24,6 +24,7 @@ import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Exhibit;
 import org.apache.cayenne.testdo.testmap.Gallery;
+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.BeanValidationFailure;
@@ -38,7 +39,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 CayenneDataObjectValidationIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/CayenneIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CayenneIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CayenneIT.java
index 008bb52..301a5ca 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CayenneIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CayenneIT.java
@@ -33,8 +33,10 @@ 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.Collection;
@@ -48,7 +50,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 CayenneIT extends ServerCase {
 
     @Inject
@@ -60,14 +62,8 @@ public class CayenneIT 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/CompoundPkChangeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/CompoundPkChangeIT.java b/cayenne-server/src/test/java/org/apache/cayenne/CompoundPkChangeIT.java
index dcdaa83..012edf3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/CompoundPkChangeIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/CompoundPkChangeIT.java
@@ -21,15 +21,15 @@ package org.apache.cayenne;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.ObjectIdQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 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.Test;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+@UseServerRuntime(CayenneProjects.COMPOUND_PROJECT)
 public class CompoundPkChangeIT extends ServerCase {
 
     private static final String key1v1 = "-key1-v1-";
@@ -42,15 +42,6 @@ public class CompoundPkChangeIT extends ServerCase {
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
-    }
-
     @Test
     public void testCompoundPkChangeSingleElement() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/DataContextMaxIdQualifierIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/DataContextMaxIdQualifierIT.java b/cayenne-server/src/test/java/org/apache/cayenne/DataContextMaxIdQualifierIT.java
index 9e57d0b..0efd037 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/DataContextMaxIdQualifierIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/DataContextMaxIdQualifierIT.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.SQLException;
@@ -40,7 +42,7 @@ import java.util.List;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextMaxIdQualifierIT extends ServerCase {
 
     @Inject
@@ -58,14 +60,8 @@ public class DataContextMaxIdQualifierIT 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/DataObjectSerializationIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/DataObjectSerializationIT.java b/cayenne-server/src/test/java/org/apache/cayenne/DataObjectSerializationIT.java
index 2e1c441..7307402 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/DataObjectSerializationIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/DataObjectSerializationIT.java
@@ -22,6 +22,7 @@ package org.apache.cayenne;
 import org.apache.cayenne.access.ToManyList;
 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.apache.cayenne.util.Util;
@@ -35,7 +36,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 DataObjectSerializationIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/FlattenedRelationshipsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/FlattenedRelationshipsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/FlattenedRelationshipsIT.java
index e285420..f716142 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/FlattenedRelationshipsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/FlattenedRelationshipsIT.java
@@ -31,8 +31,10 @@ import org.apache.cayenne.testdo.relationships_flattened.FlattenedCircular;
 import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest1;
 import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest2;
 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.sql.Types;
@@ -46,7 +48,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Test case for objects with flattened relationships.
  */
-@UseServerRuntime(ServerCase.RELATIONSHIPS_FLATTENED_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_FLATTENED_PROJECT)
 public class FlattenedRelationshipsIT extends ServerCase {
 
     @Inject
@@ -65,16 +67,8 @@ public class FlattenedRelationshipsIT extends ServerCase {
     private TableHelper tFlattenedCircular;
     private TableHelper tFlattenedCircularJoin;
 
-    @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");
-        dbHelper.deleteAll("FLATTENED_CIRCULAR_JOIN");
-        dbHelper.deleteAll("FLATTENED_CIRCULAR");
-
+    @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/GenericMappingIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/GenericMappingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/GenericMappingIT.java
index 1b111bc..cba5a4f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/GenericMappingIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/GenericMappingIT.java
@@ -25,7 +25,7 @@ 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.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,21 +36,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.GENERIC_PROJECT)
+@UseServerRuntime(CayenneProjects.GENERIC_PROJECT)
 public class GenericMappingIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("GENERIC2");
-        dbHelper.deleteAll("GENERIC1");
-    }
-
     @Test
     public void testInsertSingle() {
         DataObject g1 = (DataObject) context.newObject("Generic1");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/ManyToManyNoJoinIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/ManyToManyNoJoinIT.java b/cayenne-server/src/test/java/org/apache/cayenne/ManyToManyNoJoinIT.java
index 50e0c3f..2ee4c8f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/ManyToManyNoJoinIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/ManyToManyNoJoinIT.java
@@ -19,30 +19,21 @@
 package org.apache.cayenne;
 
 import org.apache.cayenne.di.Inject;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.relationships_activity.Activity;
 import org.apache.cayenne.testdo.relationships_activity.ActivityResult;
+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 java.sql.Date;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_ACTIVITY_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_ACTIVITY_PROJECT)
 public class ManyToManyNoJoinIT extends ServerCase {
 
     @Inject
     private ObjectContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("ACTIVITY");
-        dbHelper.deleteAll("RESULT");
-    }
-
     @Test
     public void testValidateForSave1() throws Exception {
         ActivityResult result = context.newObject(ActivityResult.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/MeaningfulFKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/MeaningfulFKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/MeaningfulFKIT.java
index 4e31c2c..f11552c 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/MeaningfulFKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/MeaningfulFKIT.java
@@ -20,9 +20,9 @@
 package org.apache.cayenne;
 
 import org.apache.cayenne.di.Inject;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.relationships.MeaningfulFK;
 import org.apache.cayenne.testdo.relationships.RelationshipHelper;
+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.ValidationResult;
@@ -32,20 +32,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RELATIONSHIPS_PROJECT)
+@UseServerRuntime(CayenneProjects.RELATIONSHIPS_PROJECT)
 public class MeaningfulFKIT extends ServerCase {
 
     @Inject
     private ObjectContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("MEANINGFUL_FK");
-    }
-
     @Test
     public void testValidateForSave1() throws Exception {
         MeaningfulFK testObject = context.newObject(MeaningfulFK.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/OneWayRelationshipsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/OneWayRelationshipsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/OneWayRelationshipsIT.java
index 4b99f55..6130b5d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/OneWayRelationshipsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/OneWayRelationshipsIT.java
@@ -26,8 +26,10 @@ import org.apache.cayenne.testdo.oneway.OnewayTable1;
 import org.apache.cayenne.testdo.oneway.OnewayTable2;
 import org.apache.cayenne.testdo.oneway.OnewayTable3;
 import org.apache.cayenne.testdo.oneway.OnewayTable4;
+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.SQLException;
@@ -38,7 +40,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.ONEWAY_PROJECT)
+@UseServerRuntime(CayenneProjects.ONEWAY_PROJECT)
 public class OneWayRelationshipsIT extends ServerCase {
 
     @Inject
@@ -52,14 +54,8 @@ public class OneWayRelationshipsIT extends ServerCase {
     private TableHelper t3Helper;
     private TableHelper t4Helper;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-
-        dbHelper.deleteAll("oneway_table2");
-        dbHelper.deleteAll("oneway_table1");
-        dbHelper.deleteAll("oneway_table4");
-        dbHelper.deleteAll("oneway_table3");
-
+    @Before
+    public void testSetUp() throws Exception {
         t1Helper = new TableHelper(dbHelper, "oneway_table1");
         t1Helper.setColumns("ID");
         t2Helper = new TableHelper(dbHelper, "oneway_table2");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/PersistenceByReachabilityIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/PersistenceByReachabilityIT.java b/cayenne-server/src/test/java/org/apache/cayenne/PersistenceByReachabilityIT.java
index 65fb933..ad545cb 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/PersistenceByReachabilityIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/PersistenceByReachabilityIT.java
@@ -22,6 +22,7 @@ package org.apache.cayenne;
 import org.apache.cayenne.di.Inject;
 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;
@@ -29,7 +30,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class PersistenceByReachabilityIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/PersistentObjectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/PersistentObjectIT.java b/cayenne-server/src/test/java/org/apache/cayenne/PersistentObjectIT.java
index c6a1146..4b240b3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/PersistentObjectIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/PersistentObjectIT.java
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne;
 
+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;
@@ -28,7 +29,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.mockito.Mockito.mock;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class PersistentObjectIT extends ServerCase {
 
     @Test

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/PregeneratedPKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/PregeneratedPKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/PregeneratedPKIT.java
index 4059622..c3ca428 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/PregeneratedPKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/PregeneratedPKIT.java
@@ -23,8 +23,8 @@ import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbEntity;
-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;
@@ -39,26 +39,12 @@ import static org.junit.Assert.assertNotNull;
 // TODO: 1/16/2006 - the algorithm used to generate the PK may be included in
 // DataObjectUtils to pull the PK on demand. A caveat - we need to analyze DataObject in
 // question to see if a PK is numeric and not propagated.
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class PregeneratedPKIT 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 testLongPk() throws Exception {
         Artist a = context.newObject(Artist.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBinaryPKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBinaryPKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBinaryPKIT.java
index 8dd8202..42e24e8 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBinaryPKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBinaryPKIT.java
@@ -22,10 +22,10 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.binary_pk.BinaryPKTest1;
 import org.apache.cayenne.testdo.binary_pk.BinaryPKTest2;
 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;
@@ -33,7 +33,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.BINARY_PK_PROJECT)
+@UseServerRuntime(CayenneProjects.BINARY_PK_PROJECT)
 public class DataContextBinaryPKIT extends ServerCase {
 
     @Inject
@@ -45,17 +45,6 @@ public class DataContextBinaryPKIT extends ServerCase {
     @Inject
     private UnitDbAdapter accessStackAdapter;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        if (accessStackAdapter.supportsBinaryPK()) {
-            dbHelper.deleteAll("BINARY_PK_TEST2");
-            dbHelper.deleteAll("BINARY_PK_TEST1");
-        }
-    }
-
     @Test
     public void testInsertBinaryPK() throws Exception {
         if (accessStackAdapter.supportsBinaryPK()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBlobIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBlobIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBlobIT.java
index c482bd8..8b0c4fa 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBlobIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextBlobIT.java
@@ -22,9 +22,9 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.access.types.ByteArrayTypeTest;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.lob.BlobTestEntity;
 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;
@@ -34,7 +34,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
-@UseServerRuntime(ServerCase.LOB_PROJECT)
+@UseServerRuntime(CayenneProjects.LOB_PROJECT)
 public class DataContextBlobIT extends ServerCase {
 
     @Inject
@@ -49,16 +49,6 @@ public class DataContextBlobIT extends ServerCase {
     @Inject
     private UnitDbAdapter accessStackAdapter;
     
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        if (accessStackAdapter.supportsLobs()) {
-            dbHelper.deleteAll("BLOB_TEST");
-        }
-    }
-
     protected boolean skipTests() {
         return !accessStackAdapter.supportsLobs();
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCallbacksIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCallbacksIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCallbacksIT.java
index 1b89bd2..742b1d9 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCallbacksIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCallbacksIT.java
@@ -23,11 +23,12 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.LifecycleEvent;
 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.After;
 import org.junit.Test;
 
 import static org.junit.Assert.assertFalse;
@@ -36,7 +37,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 DataContextCallbacksIT extends ServerCase {
 
     @Inject
@@ -45,20 +46,8 @@ public class DataContextCallbacksIT extends ServerCase {
     @Inject
     private ServerRuntime runtime;
 
-    @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");
-    }
-
-    @Override
-    protected void tearDownBeforeInjection() throws Exception {
+    @After
+    public void testTearDown() throws Exception {
         EntityResolver resolver = runtime.getDataDomain().getEntityResolver();
         resolver.getCallbackRegistry().clear();
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharPKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharPKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharPKIT.java
index 8d37950..a0b97e4 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharPKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharPKIT.java
@@ -22,8 +22,8 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.SQLTemplate;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.compound.CharPkTestEntity;
+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,21 +33,12 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+@UseServerRuntime(CayenneProjects.COMPOUND_PROJECT)
 public class DataContextCharPKIT extends ServerCase {
 
     @Inject
     private DataContext context;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("CHAR_FK_TEST");
-        dbHelper.deleteAll("CHAR_PK_TEST");
-    }
-
     @Test
     public void testInsert() throws Exception {
         CharPkTestEntity object = context.newObject(CharPkTestEntity.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharTypeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharTypeIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharTypeIT.java
index 2b35330..cf84989 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharTypeIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCharTypeIT.java
@@ -23,9 +23,9 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.return_types.ReturnTypesMap1;
 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;
@@ -34,23 +34,15 @@ import java.util.List;
 
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.RETURN_TYPES_PROJECT)
+@UseServerRuntime(CayenneProjects.RETURN_TYPES_PROJECT)
 public class DataContextCharTypeIT extends ServerCase {
     
     @Inject
     protected ObjectContext context;
     
     @Inject
-    protected DBHelper dbHelper;
-    
-    @Inject
     private UnitDbAdapter unitDbAdapter;
     
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("TYPES_MAPPING_TEST1");
-    }
-
     @Test
     public void testCharTrimming() {
         if (unitDbAdapter.supportsLobs()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextClobIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextClobIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextClobIT.java
index 68e79bd..60ad7b3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextClobIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextClobIT.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.lob.ClobTestEntity;
 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;
@@ -33,7 +33,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
-@UseServerRuntime(ServerCase.LOB_PROJECT)
+@UseServerRuntime(CayenneProjects.LOB_PROJECT)
 public class DataContextClobIT extends ServerCase {
 
     @Inject
@@ -48,16 +48,6 @@ public class DataContextClobIT extends ServerCase {
     @Inject
     private UnitDbAdapter accessStackAdapter;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        if (accessStackAdapter.supportsLobs()) {
-            dbHelper.deleteAll("CLOB_TEST");
-        }
-    }
-
     private boolean skipTests() {
         return !accessStackAdapter.supportsLobs();
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCommitIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCommitIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCommitIT.java
index 2e9a795..a8753fb 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCommitIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCommitIT.java
@@ -22,10 +22,10 @@ package org.apache.cayenne.access;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.graph.GraphDiff;
 import org.apache.cayenne.graph.MockGraphChangeHandler;
-import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.NullTestEntity;
 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;
@@ -36,25 +36,12 @@ 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 DataContextCommitIT 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("NULL_TEST");
-    }
-
     @Test
     public void testFlushToParent_Commit() {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCompoundRelIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCompoundRelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCompoundRelIT.java
index 9c5932f..be2041f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCompoundRelIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCompoundRelIT.java
@@ -23,9 +23,9 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SelectQuery;
-import org.apache.cayenne.test.jdbc.DBHelper;
 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.Test;
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertEquals;
 /**
  * Testing relationships with compound keys.
  */
-@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+@UseServerRuntime(CayenneProjects.COMPOUND_PROJECT)
 public class DataContextCompoundRelIT extends ServerCase {
 
     @Inject
@@ -46,15 +46,6 @@ public class DataContextCompoundRelIT extends ServerCase {
     @Inject
     private DataContext context1;
 
-    @Inject
-    private DBHelper dbHelper;
-
-    @Override
-    protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
-    }
-
     @Test
     public void testInsert() {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCrossDBIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCrossDBIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCrossDBIT.java
index 3a3d7ed..8ac4620 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCrossDBIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextCrossDBIT.java
@@ -23,11 +23,12 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.db1.CrossdbM1E1;
 import org.apache.cayenne.testdo.db2.CrossdbM2E1;
 import org.apache.cayenne.testdo.db2.CrossdbM2E2;
+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;
 
-@UseServerRuntime(ServerCase.MULTINODE_PROJECT)
+@UseServerRuntime(CayenneProjects.MULTINODE_PROJECT)
 public class DataContextCrossDBIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsIT.java
index 6a74e2e..2cff155 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsIT.java
@@ -27,6 +27,7 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.graph.GraphEvent;
 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.apache.cayenne.util.EventUtil;
@@ -38,7 +39,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Tests that DataContext sends DataChannel events.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextDataChannelEventsIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackIT.java
index 969a54c..92e3d06 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDecoratedStackIT.java
@@ -31,8 +31,8 @@ import org.apache.cayenne.graph.GraphDiff;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLTemplate;
-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;
@@ -43,24 +43,12 @@ 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 DataContextDecoratedStackIT extends ServerCase {
 
     @Inject
     private ServerRuntime runtime;
 
-    @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 testCommitDecorated() {
         DataDomain dd = runtime.getDataDomain();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateIT.java
index 46d1231..f758917 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateIT.java
@@ -23,11 +23,12 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.MockQuery;
 import org.apache.cayenne.query.Query;
 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.Gallery;
+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;
@@ -42,26 +43,14 @@ import static org.junit.Assert.assertTrue;
  * Tests various DataContextDelegate methods invocation and consequences on DataContext
  * behavior.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextDelegateIT 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");
-
+    @Before
+    public void testSetUp() throws Exception {
         // prepare a single gallery record
         Gallery gallery = (Gallery) context.newObject("Gallery");
         gallery.setGalleryName("version1");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/368b4ac5/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateSharedCacheIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateSharedCacheIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateSharedCacheIT.java
index 18b07e4..2d2c695 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateSharedCacheIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextDelegateSharedCacheIT.java
@@ -25,8 +25,10 @@ import org.apache.cayenne.PersistenceState;
 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.Before;
 import org.junit.Test;
 
 import java.util.Date;
@@ -37,7 +39,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 public class DataContextDelegateSharedCacheIT extends ServerCase {
 
     @Inject
@@ -48,8 +50,8 @@ public class DataContextDelegateSharedCacheIT extends ServerCase {
 
     private Artist artist;
 
-    @Override
-    protected void setUpAfterInjection() throws Exception {
+    @Before
+    public void testSetUp() throws Exception {
 
         // prepare a single artist record
         artist = (Artist) context.newObject("Artist");


Mime
View raw message