cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [10/11] cayenne git commit: Refactor TestMap Project
Date Wed, 12 Nov 2014 17:07:21 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryCompoundIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryCompoundIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryCompoundIT.java
new file mode 100644
index 0000000..e27e6a5
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryCompoundIT.java
@@ -0,0 +1,129 @@
+package org.apache.cayenne.access;
+
+import org.apache.cayenne.Cayenne;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.query.EJBQLQuery;
+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.UnitDbAdapter;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+
+@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+public class DataContextEJBQLQueryCompoundIT extends ServerCase {
+
+    @Inject
+    private ObjectContext context;
+
+    @Inject
+    private DBHelper dbHelper;
+
+    @Inject
+    private UnitDbAdapter accessStackAdapter;
+
+    private TableHelper tCompoundPk;
+    private TableHelper tCompoundFk;
+
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("COMPOUND_FK_TEST");
+        dbHelper.deleteAll("COMPOUND_PK_TEST");
+
+        tCompoundPk = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
+        tCompoundPk.setColumns("KEY1", "KEY2");
+
+        tCompoundFk = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
+        tCompoundFk.setColumns("PKEY", "F_KEY1", "F_KEY2");
+    }
+
+    private void createTwoCompoundPKTwoFK() throws Exception {
+        tCompoundPk.insert("a1", "a2");
+        tCompoundPk.insert("b1", "b2");
+        tCompoundFk.insert(33001, "a1", "a2");
+        tCompoundFk.insert(33002, "b1", "b2");
+    }
+
+    @Test
+    public void testSelectFromWhereMatchOnMultiColumnObject() throws Exception {
+        createTwoCompoundPKTwoFK();
+
+        Map<String, String> key1 = new HashMap<String, String>();
+        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
+        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
+        CompoundPkTestEntity a = Cayenne.objectForPK(
+                context,
+                CompoundPkTestEntity.class,
+                key1);
+
+        String ejbql = "select e from CompoundFkTestEntity e WHERE e.toCompoundPk = :param";
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        query.setParameter("param", a);
+
+        List<?> ps = context.performQuery(query);
+        assertEquals(1, ps.size());
+
+        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
+        assertEquals(33002, Cayenne.intPKForObject(o1));
+    }
+
+    @Test
+    public void testSelectFromWhereMatchOnMultiColumnObjectReverse() throws Exception {
+        if (!accessStackAdapter.supportsReverseComparison()) {
+            return;
+        }
+
+        createTwoCompoundPKTwoFK();
+
+        Map<String, String> key1 = new HashMap<String, String>();
+        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
+        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
+        CompoundPkTestEntity a = Cayenne.objectForPK(
+                context,
+                CompoundPkTestEntity.class,
+                key1);
+
+        String ejbql = "select e from CompoundFkTestEntity e WHERE :param = e.toCompoundPk";
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        query.setParameter("param", a);
+
+        List<?> ps = context.performQuery(query);
+        assertEquals(1, ps.size());
+
+        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
+        assertEquals(33002, Cayenne.intPKForObject(o1));
+    }
+
+    @Test
+    public void testSelectFromWhereNoMatchOnMultiColumnObject() throws Exception {
+        createTwoCompoundPKTwoFK();
+
+        Map<String, String> key1 = new HashMap<String, String>();
+        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
+        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
+        CompoundPkTestEntity a = Cayenne.objectForPK(
+                context,
+                CompoundPkTestEntity.class,
+                key1);
+
+        String ejbql = "select e from CompoundFkTestEntity e WHERE e.toCompoundPk <> :param";
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        query.setParameter("param", a);
+
+        List<?> ps = context.performQuery(query);
+        assertEquals(1, ps.size());
+
+        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
+        assertEquals(33001, Cayenne.intPKForObject(o1));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryIT.java
index 6e32995..a61cf18 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryIT.java
@@ -29,8 +29,6 @@ import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.test.junit.AssertExtras;
 import org.apache.cayenne.testdo.testmap.Artist;
-import org.apache.cayenne.testdo.testmap.CompoundFkTestEntity;
-import org.apache.cayenne.testdo.testmap.CompoundPkTestEntity;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.UnitDbAdapter;
 import org.apache.cayenne.unit.di.server.ServerCase;
@@ -39,11 +37,9 @@ import org.junit.Test;
 
 import java.math.BigDecimal;
 import java.sql.Types;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
@@ -64,8 +60,6 @@ public class DataContextEJBQLQueryIT extends ServerCase {
 
     private TableHelper tArtist;
     private TableHelper tPainting;
-    private TableHelper tCompoundPk;
-    private TableHelper tCompoundFk;
 
     @Override
     protected void setUpAfterInjection() throws Exception {
@@ -74,8 +68,6 @@ public class DataContextEJBQLQueryIT extends ServerCase {
         dbHelper.deleteAll("ARTIST_EXHIBIT");
         dbHelper.deleteAll("ARTIST_GROUP");
         dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
 
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
@@ -90,12 +82,6 @@ public class DataContextEJBQLQueryIT extends ServerCase {
                 Types.BIGINT,
                 Types.VARCHAR,
                 Types.DECIMAL);
-
-        tCompoundPk = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
-        tCompoundPk.setColumns("KEY1", "KEY2");
-
-        tCompoundFk = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
-        tCompoundFk.setColumns("PKEY", "F_KEY1", "F_KEY2");
     }
 
     private void createFourArtistsTwoPaintings() throws Exception {
@@ -107,13 +93,6 @@ public class DataContextEJBQLQueryIT extends ServerCase {
         tPainting.insert(33002, 33002, "P2", 5000);
     }
 
-    private void createTwoCompoundPKTwoFK() throws Exception {
-        tCompoundPk.insert("a1", "a2");
-        tCompoundPk.insert("b1", "b2");
-        tCompoundFk.insert(33001, "a1", "a2");
-        tCompoundFk.insert(33002, "b1", "b2");
-    }
-
     /**
      * CAY-899: Checks that aggregate results do not cause callbacks execution.
      */
@@ -494,76 +473,4 @@ public class DataContextEJBQLQueryIT extends ServerCase {
         assertEquals(33002, Cayenne.intPKForObject(p));
     }
 
-    @Test
-    public void testSelectFromWhereMatchOnMultiColumnObject() throws Exception {
-        createTwoCompoundPKTwoFK();
-
-        Map<String, String> key1 = new HashMap<String, String>();
-        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
-        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
-        CompoundPkTestEntity a = Cayenne.objectForPK(
-                context,
-                CompoundPkTestEntity.class,
-                key1);
-
-        String ejbql = "select e from CompoundFkTestEntity e WHERE e.toCompoundPk = :param";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-        query.setParameter("param", a);
-
-        List<?> ps = context.performQuery(query);
-        assertEquals(1, ps.size());
-
-        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
-        assertEquals(33002, Cayenne.intPKForObject(o1));
-    }
-
-    @Test
-    public void testSelectFromWhereMatchOnMultiColumnObjectReverse() throws Exception {
-        if (!accessStackAdapter.supportsReverseComparison()) {
-            return;
-        }
-
-        createTwoCompoundPKTwoFK();
-
-        Map<String, String> key1 = new HashMap<String, String>();
-        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
-        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
-        CompoundPkTestEntity a = Cayenne.objectForPK(
-                context,
-                CompoundPkTestEntity.class,
-                key1);
-
-        String ejbql = "select e from CompoundFkTestEntity e WHERE :param = e.toCompoundPk";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-        query.setParameter("param", a);
-
-        List<?> ps = context.performQuery(query);
-        assertEquals(1, ps.size());
-
-        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
-        assertEquals(33002, Cayenne.intPKForObject(o1));
-    }
-
-    @Test
-    public void testSelectFromWhereNoMatchOnMultiColumnObject() throws Exception {
-        createTwoCompoundPKTwoFK();
-
-        Map<String, String> key1 = new HashMap<String, String>();
-        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
-        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
-        CompoundPkTestEntity a = Cayenne.objectForPK(
-                context,
-                CompoundPkTestEntity.class,
-                key1);
-
-        String ejbql = "select e from CompoundFkTestEntity e WHERE e.toCompoundPk <> :param";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-        query.setParameter("param", a);
-
-        List<?> ps = context.performQuery(query);
-        assertEquals(1, ps.size());
-
-        CompoundFkTestEntity o1 = (CompoundFkTestEntity) ps.get(0);
-        assertEquals(33001, Cayenne.intPKForObject(o1));
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateCompoundIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateCompoundIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateCompoundIT.java
new file mode 100644
index 0000000..b85c3a0
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateCompoundIT.java
@@ -0,0 +1,87 @@
+package org.apache.cayenne.access;
+
+import org.apache.cayenne.Cayenne;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.QueryResponse;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.query.EJBQLQuery;
+import org.apache.cayenne.test.jdbc.DBHelper;
+import org.apache.cayenne.test.jdbc.TableHelper;
+import org.apache.cayenne.testdo.compound.CompoundPkTestEntity;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+
+@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+public class DataContextEJBQLUpdateCompoundIT extends ServerCase {
+
+    @Inject
+    private ObjectContext context;
+
+    @Inject
+    private DBHelper dbHelper;
+
+    private TableHelper tCompoundPk;
+    private TableHelper tCompoundFk;
+
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("COMPOUND_FK_TEST");
+        dbHelper.deleteAll("COMPOUND_PK_TEST");
+
+        tCompoundPk = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
+        tCompoundPk.setColumns("KEY1", "KEY2");
+
+        tCompoundFk = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
+        tCompoundFk.setColumns("PKEY", "F_KEY1", "F_KEY2");
+    }
+
+    private void createTwoCompoundPKTwoFK() throws Exception {
+        tCompoundPk.insert("a1", "a2");
+        tCompoundPk.insert("b1", "b2");
+        tCompoundFk.insert(33001, "a1", "a2");
+        tCompoundFk.insert(33002, "b1", "b2");
+    }
+
+    @Test
+    public void testUpdateNoQualifierToOneCompoundPK() throws Exception {
+        createTwoCompoundPKTwoFK();
+
+        Map<String, String> key1 = new HashMap<String, String>();
+        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
+        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
+        CompoundPkTestEntity object = Cayenne.objectForPK(
+                context,
+                CompoundPkTestEntity.class,
+                key1);
+
+        EJBQLQuery check = new EJBQLQuery(
+                "select count(e) from CompoundFkTestEntity e WHERE e.toCompoundPk <> :param");
+        check.setParameter("param", object);
+
+        Object notUpdated = Cayenne.objectForQuery(context, check);
+        assertEquals(new Long(1l), notUpdated);
+
+        String ejbql = "UPDATE CompoundFkTestEntity e SET e.toCompoundPk = :param";
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        query.setParameter("param", object);
+
+        QueryResponse result = context.performGenericQuery(query);
+
+        int[] count = result.firstUpdateCount();
+        assertNotNull(count);
+        assertEquals(1, count.length);
+        assertEquals(2, count[0]);
+
+        notUpdated = Cayenne.objectForQuery(context, check);
+        assertEquals(new Long(0l), notUpdated);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateIT.java
index 3de1db8..fad0256 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateIT.java
@@ -26,15 +26,11 @@ import org.apache.cayenne.query.EJBQLQuery;
 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.BooleanTestEntity;
-import org.apache.cayenne.testdo.testmap.CompoundPkTestEntity;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 
 import java.sql.Types;
-import java.util.HashMap;
-import java.util.Map;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -50,19 +46,14 @@ public class DataContextEJBQLUpdateIT extends ServerCase {
 
     private TableHelper tArtist;
     private TableHelper tPainting;
-    private TableHelper tCompoundPk;
-    private TableHelper tCompoundFk;
 
     @Override
     protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("BOOLEAN_TEST");
         dbHelper.deleteAll("PAINTING_INFO");
         dbHelper.deleteAll("PAINTING");
         dbHelper.deleteAll("ARTIST_EXHIBIT");
         dbHelper.deleteAll("ARTIST_GROUP");
         dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
 
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
@@ -78,11 +69,6 @@ public class DataContextEJBQLUpdateIT extends ServerCase {
                 Types.VARCHAR,
                 Types.DECIMAL);
 
-        tCompoundPk = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
-        tCompoundPk.setColumns("KEY1", "KEY2");
-
-        tCompoundFk = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
-        tCompoundFk.setColumns("PKEY", "F_KEY1", "F_KEY2");
     }
 
     private void createThreeArtistsTwoPaintings() throws Exception {
@@ -93,13 +79,6 @@ public class DataContextEJBQLUpdateIT extends ServerCase {
         tPainting.insert(33002, 33002, "P2", 5000);
     }
 
-    private void createTwoCompoundPKTwoFK() throws Exception {
-        tCompoundPk.insert("a1", "a2");
-        tCompoundPk.insert("b1", "b2");
-        tCompoundFk.insert(33001, "a1", "a2");
-        tCompoundFk.insert(33002, "b1", "b2");
-    }
-
     @Test
     public void testUpdateQualifier() throws Exception {
         createThreeArtistsTwoPaintings();
@@ -247,40 +226,6 @@ public class DataContextEJBQLUpdateIT extends ServerCase {
     }
 
     @Test
-    public void testUpdateNoQualifierBoolean() throws Exception {
-
-        BooleanTestEntity o1 = context.newObject(BooleanTestEntity.class);
-        o1.setBooleanColumn(Boolean.TRUE);
-
-        BooleanTestEntity o2 = context.newObject(BooleanTestEntity.class);
-        o2.setBooleanColumn(Boolean.FALSE);
-
-        BooleanTestEntity o3 = context.newObject(BooleanTestEntity.class);
-        o3.setBooleanColumn(Boolean.FALSE);
-
-        context.commitChanges();
-
-        EJBQLQuery check = new EJBQLQuery("select count(p) from BooleanTestEntity p "
-                + "WHERE p.booleanColumn = true");
-
-        Object notUpdated = Cayenne.objectForQuery(context, check);
-        assertEquals(new Long(1l), notUpdated);
-
-        String ejbql = "UPDATE BooleanTestEntity AS p SET p.booleanColumn = true";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-
-        QueryResponse result = context.performGenericQuery(query);
-
-        int[] count = result.firstUpdateCount();
-        assertNotNull(count);
-        assertEquals(1, count.length);
-        assertEquals(3, count[0]);
-
-        notUpdated = Cayenne.objectForQuery(context, check);
-        assertEquals(new Long(3l), notUpdated);
-    }
-
-    @Test
     public void testUpdateNoQualifierToOne() throws Exception {
         createThreeArtistsTwoPaintings();
 
@@ -308,38 +253,4 @@ public class DataContextEJBQLUpdateIT extends ServerCase {
         assertEquals(new Long(0l), notUpdated);
     }
 
-    @Test
-    public void testUpdateNoQualifierToOneCompoundPK() throws Exception {
-        createTwoCompoundPKTwoFK();
-
-        Map<String, String> key1 = new HashMap<String, String>();
-        key1.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "b1");
-        key1.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "b2");
-        CompoundPkTestEntity object = Cayenne.objectForPK(
-                context,
-                CompoundPkTestEntity.class,
-                key1);
-
-        EJBQLQuery check = new EJBQLQuery(
-                "select count(e) from CompoundFkTestEntity e WHERE e.toCompoundPk <> :param");
-        check.setParameter("param", object);
-
-        Object notUpdated = Cayenne.objectForQuery(context, check);
-        assertEquals(new Long(1l), notUpdated);
-
-        String ejbql = "UPDATE CompoundFkTestEntity e SET e.toCompoundPk = :param";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-        query.setParameter("param", object);
-
-        QueryResponse result = context.performGenericQuery(query);
-
-        int[] count = result.firstUpdateCount();
-        assertNotNull(count);
-        assertEquals(1, count.length);
-        assertEquals(2, count[0]);
-
-        notUpdated = Cayenne.objectForQuery(context, check);
-        assertEquals(new Long(0l), notUpdated);
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKIT.java
index 7b8483d..34be732 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKIT.java
@@ -27,8 +27,8 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.ObjectIdQuery;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.jdbc.DBHelper;
-import org.apache.cayenne.testdo.testmap.MeaningfulPKDep;
-import org.apache.cayenne.testdo.testmap.MeaningfulPKTest1;
+import org.apache.cayenne.testdo.meaningful_pk.MeaningfulPKDep;
+import org.apache.cayenne.testdo.meaningful_pk.MeaningfulPKTest1;
 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.assertNotNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.MEANINGFUL_PK_PROJECT)
 public class DataContextEntityWithMeaningfulPKIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextExtendedTypeOperationsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextExtendedTypeOperationsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextExtendedTypeOperationsIT.java
index 24fa4e4..594ef1f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextExtendedTypeOperationsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextExtendedTypeOperationsIT.java
@@ -26,8 +26,8 @@ import org.apache.cayenne.query.CapsStrategy;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.jdbc.DBHelper;
-import org.apache.cayenne.testdo.testmap.ExtendedTypeEntity;
-import org.apache.cayenne.testdo.testmap.StringET1;
+import org.apache.cayenne.testdo.extended_type.ExtendedTypeEntity;
+import org.apache.cayenne.testdo.extended_type.StringET1;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -36,7 +36,7 @@ import java.util.Arrays;
 
 import static org.junit.Assert.assertEquals;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.EXTENDED_TYPE_PROJECT)
 public class DataContextExtendedTypeOperationsIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextNoPkIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextNoPkIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextNoPkIT.java
index 9da593e..0e23a8d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextNoPkIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextNoPkIT.java
@@ -25,7 +25,7 @@ import org.apache.cayenne.di.Inject;
 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.NoPkTestEntity;
+import org.apache.cayenne.testdo.no_pk.NoPkTestEntity;
 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.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.NO_PK_PROJECT)
 public class DataContextNoPkIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchExtrasIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchExtrasIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchExtrasIT.java
index 12454bb..06cc7bd 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchExtrasIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextPrefetchExtrasIT.java
@@ -31,10 +31,10 @@ import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.query.SortOrder;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
-import org.apache.cayenne.testdo.testmap.CharFkTestEntity;
-import org.apache.cayenne.testdo.testmap.CharPkTestEntity;
-import org.apache.cayenne.testdo.testmap.CompoundFkTestEntity;
-import org.apache.cayenne.testdo.testmap.CompoundPkTestEntity;
+import org.apache.cayenne.testdo.compound.CharFkTestEntity;
+import org.apache.cayenne.testdo.compound.CharPkTestEntity;
+import org.apache.cayenne.testdo.compound.CompoundFkTestEntity;
+import org.apache.cayenne.testdo.compound.CompoundPkTestEntity;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -50,7 +50,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Test prefetching of various obscure cases.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
 public class DataContextPrefetchExtrasIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryIT.java
index 75eb08e..8a6267d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryIT.java
@@ -51,10 +51,10 @@ import static org.junit.Assert.assertTrue;
 @UseServerRuntime(ServerCase.TESTMAP_PROJECT)
 public class DataContextProcedureQueryIT extends ServerCase {
 
-    public static final String UPDATE_STORED_PROCEDURE = "cayenne_tst_upd_proc";
-    public static final String UPDATE_STORED_PROCEDURE_NOPARAM = "cayenne_tst_upd_proc2";
-    public static final String SELECT_STORED_PROCEDURE = "cayenne_tst_select_proc";
-    public static final String OUT_STORED_PROCEDURE = "cayenne_tst_out_proc";
+    public static final String UPDATE_STORED_PROCEDURE = "cayenne_test_upd_proc";
+    public static final String UPDATE_STORED_PROCEDURE_NOPARAM = "cayenne_test_upd_proc2";
+    public static final String SELECT_STORED_PROCEDURE = "cayenne_test_select_proc";
+    public static final String OUT_STORED_PROCEDURE = "cayenne_test_out_proc";
 
     @Inject
     private DataContext context;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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
new file mode 100644
index 0000000..6e84aee
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextSQLTemplateCompoundIT.java
@@ -0,0 +1,105 @@
+package org.apache.cayenne.access;
+
+import org.apache.cayenne.Cayenne;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.query.CapsStrategy;
+import org.apache.cayenne.query.SQLTemplate;
+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.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+
+@UseServerRuntime(ServerCase.COMPOUND_PROJECT)
+public class DataContextSQLTemplateCompoundIT extends ServerCase {
+
+    @Inject
+    protected DataContext context;
+
+    @Inject
+    protected DBHelper dbHelper;
+
+    protected TableHelper tCompoundPkTest;
+    protected TableHelper tCompoundFkTest;
+
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("COMPOUND_FK_TEST");
+        dbHelper.deleteAll("COMPOUND_PK_TEST");
+
+        tCompoundPkTest = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
+        tCompoundPkTest.setColumns("KEY1", "KEY2");
+
+        tCompoundFkTest = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
+        tCompoundFkTest.setColumns("PKEY", "F_KEY1", "F_KEY2");
+    }
+
+    protected void createTwoCompoundPKsAndCompoundFKsDataSet() throws Exception {
+        tCompoundPkTest.insert("a1", "a2");
+        tCompoundPkTest.insert("b1", "b2");
+
+        tCompoundFkTest.insert(6, "a1", "a2");
+        tCompoundFkTest.insert(7, "b1", "b2");
+    }
+
+    @Test
+    public void testBindObjectEqualCompound() throws Exception {
+        createTwoCompoundPKsAndCompoundFKsDataSet();
+
+        Map<String, String> pk = new HashMap<String, String>();
+        pk.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "a1");
+        pk.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "a2");
+
+        CompoundPkTestEntity a = Cayenne.objectForPK(
+                context,
+                CompoundPkTestEntity.class,
+                pk);
+
+        String template = "SELECT * FROM COMPOUND_FK_TEST t0"
+                + " WHERE #bindObjectEqual($a [ 't0.F_KEY1', 't0.F_KEY2' ] [ 'KEY1', 'KEY2' ] ) ORDER BY PKEY";
+        SQLTemplate query = new SQLTemplate(CompoundFkTestEntity.class, template);
+        query.setColumnNamesCapitalization(CapsStrategy.UPPER);
+        query.setParameters(Collections.singletonMap("a", a));
+
+        List<CompoundFkTestEntity> objects = context.performQuery(query);
+        assertEquals(1, objects.size());
+
+        CompoundFkTestEntity p = objects.get(0);
+        assertEquals(6, Cayenne.intPKForObject(p));
+    }
+
+    @Test
+    public void testBindObjectNotEqualCompound() throws Exception {
+        createTwoCompoundPKsAndCompoundFKsDataSet();
+
+        Map<String, String> pk = new HashMap<String, String>();
+        pk.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "a1");
+        pk.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "a2");
+
+        CompoundPkTestEntity a = Cayenne.objectForPK(
+                context,
+                CompoundPkTestEntity.class,
+                pk);
+
+        String template = "SELECT * FROM COMPOUND_FK_TEST t0"
+                + " WHERE #bindObjectNotEqual($a [ 't0.F_KEY1', 't0.F_KEY2' ] [ 'KEY1', 'KEY2' ] ) ORDER BY PKEY";
+        SQLTemplate query = new SQLTemplate(CompoundFkTestEntity.class, template);
+        query.setColumnNamesCapitalization(CapsStrategy.UPPER);
+        query.setParameters(Collections.singletonMap("a", a));
+
+        List<CompoundFkTestEntity> objects = context.performQuery(query);
+        assertEquals(1, objects.size());
+
+        CompoundFkTestEntity p = objects.get(0);
+        assertEquals(7, Cayenne.intPKForObject(p));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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 a88f2d4..58c48f5 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
@@ -34,8 +34,6 @@ import org.apache.cayenne.query.SQLTemplate;
 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.CompoundFkTestEntity;
-import org.apache.cayenne.testdo.testmap.CompoundPkTestEntity;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
@@ -44,9 +42,7 @@ import org.junit.Test;
 
 import java.sql.Types;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -69,8 +65,6 @@ public class DataContextSQLTemplateIT extends ServerCase {
 
     protected TableHelper tPainting;
     protected TableHelper tArtist;
-    protected TableHelper tCompoundPkTest;
-    protected TableHelper tCompoundFkTest;
 
     @Override
     protected void setUpAfterInjection() throws Exception {
@@ -79,8 +73,6 @@ public class DataContextSQLTemplateIT extends ServerCase {
         dbHelper.deleteAll("ARTIST_EXHIBIT");
         dbHelper.deleteAll("ARTIST_GROUP");
         dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("COMPOUND_FK_TEST");
-        dbHelper.deleteAll("COMPOUND_PK_TEST");
 
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
@@ -95,12 +87,6 @@ public class DataContextSQLTemplateIT extends ServerCase {
                 Types.VARCHAR,
                 Types.BIGINT,
                 Types.DECIMAL);
-
-        tCompoundPkTest = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
-        tCompoundPkTest.setColumns("KEY1", "KEY2");
-
-        tCompoundFkTest = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
-        tCompoundFkTest.setColumns("PKEY", "F_KEY1", "F_KEY2");
     }
 
     protected void createFourArtists() throws Exception {
@@ -118,14 +104,6 @@ public class DataContextSQLTemplateIT extends ServerCase {
         tPainting.insert(8, "p_artist4", null, 3000);
     }
 
-    protected void createTwoCompoundPKsAndCompoundFKsDataSet() throws Exception {
-        tCompoundPkTest.insert("a1", "a2");
-        tCompoundPkTest.insert("b1", "b2");
-
-        tCompoundFkTest.insert(6, "a1", "a2");
-        tCompoundFkTest.insert(7, "b1", "b2");
-    }
-
     @Test
     public void testSQLResultSetMappingMixed() throws Exception {
         createFourArtistsAndThreePaintingsDataSet();
@@ -135,7 +113,7 @@ public class DataContextSQLTemplateIT extends ServerCase {
                 + "GROUP BY t0.ARTIST_ID, t0.ARTIST_NAME, t0.DATE_OF_BIRTH "
                 + "ORDER BY t0.ARTIST_ID";
 
-        DataMap map = context.getEntityResolver().getDataMap("tstmap");
+        DataMap map = context.getEntityResolver().getDataMap("testmap");
         SQLTemplate query = new SQLTemplate(map, sql, false);
         query.setColumnNamesCapitalization(CapsStrategy.UPPER);
 
@@ -175,7 +153,7 @@ public class DataContextSQLTemplateIT extends ServerCase {
         createFourArtists();
         
         SQLTemplate query = new SQLTemplate("SELECT * FROM ARTIST", true);
-        query.setDataNodeName("tstmap");
+        query.setDataNodeName("testmap");
         assertEquals(4, context.performQuery(query).size());
     }
 
@@ -192,7 +170,7 @@ public class DataContextSQLTemplateIT extends ServerCase {
 
         String sql = "SELECT count(1) AS X FROM ARTIST";
 
-        DataMap map = context.getEntityResolver().getDataMap("tstmap");
+        DataMap map = context.getEntityResolver().getDataMap("testmap");
         SQLTemplate query = new SQLTemplate(map, sql, false);
         query.setTemplate(
                 FrontBaseAdapter.class.getName(),
@@ -220,7 +198,7 @@ public class DataContextSQLTemplateIT extends ServerCase {
 
         String sql = "SELECT count(1) AS X, 77 AS Y FROM ARTIST";
 
-        DataMap map = context.getEntityResolver().getDataMap("tstmap");
+        DataMap map = context.getEntityResolver().getDataMap("testmap");
         SQLTemplate query = new SQLTemplate(map, sql, false);
         query.setTemplate(
                 FrontBaseAdapter.class.getName(),
@@ -437,58 +415,6 @@ public class DataContextSQLTemplateIT extends ServerCase {
     }
 
     @Test
-    public void testBindObjectEqualCompound() throws Exception {
-        createTwoCompoundPKsAndCompoundFKsDataSet();
-
-        Map<String, String> pk = new HashMap<String, String>();
-        pk.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "a1");
-        pk.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "a2");
-
-        CompoundPkTestEntity a = Cayenne.objectForPK(
-                context,
-                CompoundPkTestEntity.class,
-                pk);
-
-        String template = "SELECT * FROM COMPOUND_FK_TEST t0"
-                + " WHERE #bindObjectEqual($a [ 't0.F_KEY1', 't0.F_KEY2' ] [ 'KEY1', 'KEY2' ] ) ORDER BY PKEY";
-        SQLTemplate query = new SQLTemplate(CompoundFkTestEntity.class, template);
-        query.setColumnNamesCapitalization(CapsStrategy.UPPER);
-        query.setParameters(Collections.singletonMap("a", a));
-
-        List<CompoundFkTestEntity> objects = context.performQuery(query);
-        assertEquals(1, objects.size());
-
-        CompoundFkTestEntity p = objects.get(0);
-        assertEquals(6, Cayenne.intPKForObject(p));
-    }
-
-    @Test
-    public void testBindObjectNotEqualCompound() throws Exception {
-        createTwoCompoundPKsAndCompoundFKsDataSet();
-
-        Map<String, String> pk = new HashMap<String, String>();
-        pk.put(CompoundPkTestEntity.KEY1_PK_COLUMN, "a1");
-        pk.put(CompoundPkTestEntity.KEY2_PK_COLUMN, "a2");
-
-        CompoundPkTestEntity a = Cayenne.objectForPK(
-                context,
-                CompoundPkTestEntity.class,
-                pk);
-
-        String template = "SELECT * FROM COMPOUND_FK_TEST t0"
-                + " WHERE #bindObjectNotEqual($a [ 't0.F_KEY1', 't0.F_KEY2' ] [ 'KEY1', 'KEY2' ] ) ORDER BY PKEY";
-        SQLTemplate query = new SQLTemplate(CompoundFkTestEntity.class, template);
-        query.setColumnNamesCapitalization(CapsStrategy.UPPER);
-        query.setParameters(Collections.singletonMap("a", a));
-
-        List<CompoundFkTestEntity> objects = context.performQuery(query);
-        assertEquals(1, objects.size());
-
-        CompoundFkTestEntity p = objects.get(0);
-        assertEquals(7, Cayenne.intPKForObject(p));
-    }
-
-    @Test
     public void testBindObjectNotEqualNull() throws Exception {
         createFourArtistsAndThreePaintingsDataSet();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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 f6a5ba2..75c3812 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
@@ -24,8 +24,8 @@ 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.testmap.CalendarEntity;
-import org.apache.cayenne.testdo.testmap.DateTestEntity;
+import org.apache.cayenne.testdo.date_time.CalendarEntity;
+import org.apache.cayenne.testdo.date_time.DateTestEntity;
 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.assertTrue;
 /**
  * Tests Date handling in Cayenne.
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.DATE_TIME_PROJECT)
 public class DateTimeTypesIT extends ServerCase {
 
     @Inject
@@ -203,6 +203,7 @@ public class DateTimeTypesIT extends ServerCase {
         NamedQuery q = new NamedQuery("SelectDateTest");
         DataRow testRead = (DataRow) context.performQuery(q).get(0);
         Date columnValue = (Date) testRead.get("TIME_COLUMN");
+        assertNotNull(testRead.toString(), columnValue);
         assertNotNull(columnValue);
         assertEquals(now.toString(), new Time(columnValue.getTime()).toString());
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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 9a003c3..ffa489b 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
@@ -52,7 +52,7 @@ public class DbGeneratorIT extends ServerCase {
     protected void setUpAfterInjection() throws Exception {
         generator = new DbGenerator(adapter, runtime
                 .getDataDomain()
-                .getDataMap("tstmap"), logger);
+                .getDataMap("testmap"), logger);
     }
 
     @Test
@@ -62,7 +62,7 @@ public class DbGeneratorIT extends ServerCase {
 
     @Test
     public void testPkFilteringLogic() throws Exception {
-        DataMap map = runtime.getDataDomain().getDataMap("tstmap");
+        DataMap map = runtime.getDataDomain().getDataMap("testmap");
         DbEntity artistExhibit = map.getDbEntity("ARTIST_EXHIBIT");
         DbEntity exhibit = map.getDbEntity("EXHIBIT");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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 b25267c..7b6e1a8 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
@@ -27,8 +27,8 @@ import org.apache.cayenne.query.SQLTemplate;
 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.Enum1;
-import org.apache.cayenne.testdo.testmap.EnumEntity;
+import org.apache.cayenne.testdo.enum_test.Enum1;
+import org.apache.cayenne.testdo.enum_test.EnumEntity;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -36,7 +36,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.ENUM_PROJECT)
 public class EnumIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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 bbd3787..b98eed7 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
@@ -30,13 +30,13 @@ import org.apache.cayenne.map.DbEntity;
 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.GeneratedColumnCompKey;
-import org.apache.cayenne.testdo.testmap.GeneratedColumnCompMaster;
-import org.apache.cayenne.testdo.testmap.GeneratedColumnDep;
-import org.apache.cayenne.testdo.testmap.GeneratedColumnTest2;
-import org.apache.cayenne.testdo.testmap.GeneratedColumnTestEntity;
-import org.apache.cayenne.testdo.testmap.GeneratedF1;
-import org.apache.cayenne.testdo.testmap.GeneratedF2;
+import org.apache.cayenne.testdo.generated.GeneratedColumnCompKey;
+import org.apache.cayenne.testdo.generated.GeneratedColumnCompMaster;
+import org.apache.cayenne.testdo.generated.GeneratedColumnDep;
+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.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -48,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(ServerCase.GENERATED_PROJECT)
 public class IdentityColumnsIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/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 d1da777..c43dbb0 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
@@ -23,9 +23,9 @@ 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.testmap.ArraysEntity;
-import org.apache.cayenne.testdo.testmap.CharacterEntity;
-import org.apache.cayenne.testdo.testmap.SerializableEntity;
+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.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.MISC_TYPES_PROJECT)
 public class MiscTypesIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/NumericTypesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/NumericTypesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/NumericTypesIT.java
index e18f218..c0e30ef 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/NumericTypesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/NumericTypesIT.java
@@ -27,15 +27,15 @@ import org.apache.cayenne.exp.ExpressionFactory;
 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.BigDecimalEntity;
-import org.apache.cayenne.testdo.testmap.BigIntegerEntity;
-import org.apache.cayenne.testdo.testmap.BitTestEntity;
-import org.apache.cayenne.testdo.testmap.BooleanTestEntity;
-import org.apache.cayenne.testdo.testmap.DecimalPKTest1;
-import org.apache.cayenne.testdo.testmap.DecimalPKTestEntity;
-import org.apache.cayenne.testdo.testmap.LongEntity;
-import org.apache.cayenne.testdo.testmap.SmallintTestEntity;
-import org.apache.cayenne.testdo.testmap.TinyintTestEntity;
+import org.apache.cayenne.testdo.numeric_types.BigDecimalEntity;
+import org.apache.cayenne.testdo.numeric_types.BigIntegerEntity;
+import org.apache.cayenne.testdo.numeric_types.BitTestEntity;
+import org.apache.cayenne.testdo.numeric_types.BooleanTestEntity;
+import org.apache.cayenne.testdo.numeric_types.DecimalPKTest1;
+import org.apache.cayenne.testdo.numeric_types.DecimalPKTestEntity;
+import org.apache.cayenne.testdo.numeric_types.LongEntity;
+import org.apache.cayenne.testdo.numeric_types.SmallintTestEntity;
+import org.apache.cayenne.testdo.numeric_types.TinyintTestEntity;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
@@ -51,7 +51,7 @@ import static org.junit.Assert.assertSame;
 
 /**
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.NUMERIC_TYPES_PROJECT)
 public class NumericTypesIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/PrimitiveAttributesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/PrimitiveAttributesIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/PrimitiveAttributesIT.java
index 206c90d..a7cef30 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/PrimitiveAttributesIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/PrimitiveAttributesIT.java
@@ -20,12 +20,12 @@ package org.apache.cayenne.access;
 
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.test.jdbc.DBHelper;
-import org.apache.cayenne.testdo.testmap.PrimitivesTestEntity;
+import org.apache.cayenne.testdo.primitive.PrimitivesTestEntity;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Test;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.PRIMITIVE_PROJECT)
 public class PrimitiveAttributesIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java
index 9b61b6a..ba5b085 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java
@@ -23,10 +23,9 @@ 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.testmap.DateTestEntity;
-import org.apache.cayenne.testdo.testmap.ReturnTypesMap1;
-import org.apache.cayenne.testdo.testmap.ReturnTypesMap2;
-import org.apache.cayenne.testdo.testmap.ReturnTypesMapLobs1;
+import org.apache.cayenne.testdo.return_types.ReturnTypesMap1;
+import org.apache.cayenne.testdo.return_types.ReturnTypesMap2;
+import org.apache.cayenne.testdo.return_types.ReturnTypesMapLobs1;
 import org.apache.cayenne.unit.UnitDbAdapter;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
@@ -45,7 +44,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Test Types mapping for selected columns
  */
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.RETURN_TYPES_PROJECT)
 public class ReturnTypesMappingIT extends ServerCase {
 
     @Inject
@@ -64,7 +63,6 @@ public class ReturnTypesMappingIT extends ServerCase {
             dbHelper.deleteAll("TYPES_MAPPING_TEST2");
         }
         dbHelper.deleteAll("TYPES_MAPPING_TEST1");
-        dbHelper.deleteAll("DATE_TEST");
     }
 
     /*
@@ -738,28 +736,6 @@ public class ReturnTypesMappingIT extends ServerCase {
     }
 
     @Test
-    public void testSQLTemplateTime() throws Exception {
-        DateTestEntity test = (DateTestEntity) context.newObject("DateTestEntity");
-
-        Calendar cal = Calendar.getInstance();
-        cal.clear();
-        cal.set(2003, 1, 1, 1, 20, 30);
-
-        // most databases fail millisecond accuracy
-        // cal.set(Calendar.MILLISECOND, 55);
-
-        Time now = new Time(cal.getTime().getTime());
-        test.setTimeColumn(now);
-        context.commitChanges();
-
-        NamedQuery q = new NamedQuery("SelectDateTest");
-        DataRow testRead = (DataRow) context.performQuery(q).get(0);
-        Date columnValue = (Date) testRead.get("TIME_COLUMN");
-        assertNotNull(testRead.toString(), columnValue);
-        assertEquals(now.toString(), new Time(columnValue.getTime()).toString());
-    }
-
-    @Test
     public void testTIMESTAMP() throws Exception {
         String columnName = "TIMESTAMP_COLUMN";
         ReturnTypesMap1 test = context.newObject(ReturnTypesMap1.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java
index 45ab106..dfea01e 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java
@@ -24,8 +24,8 @@ import org.apache.cayenne.di.Inject;
 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.UuidPkEntity;
-import org.apache.cayenne.testdo.testmap.UuidTestEntity;
+import org.apache.cayenne.testdo.uuid.UuidPkEntity;
+import org.apache.cayenne.testdo.uuid.UuidTestEntity;
 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.UUID;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.UUID_PROJECT)
 public class UUIDIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionGeneratedIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionGeneratedIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionGeneratedIT.java
new file mode 100644
index 0000000..263942a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionGeneratedIT.java
@@ -0,0 +1,70 @@
+package org.apache.cayenne.access.jdbc;
+
+import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.access.jdbc.reader.RowReaderFactory;
+import org.apache.cayenne.configuration.server.ServerRuntime;
+import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.query.InsertBatchQuery;
+import org.apache.cayenne.testdo.generated.GeneratedColumnTestEntity;
+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.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
+@UseServerRuntime(ServerCase.GENERATED_PROJECT)
+public class BatchActionGeneratedIT extends ServerCase {
+
+    @Inject
+    private ServerRuntime runtime;
+
+    @Inject
+    private AdhocObjectFactory objectFactory;
+
+    @Test
+    public void testHasGeneratedKeys1() throws Exception {
+        EntityResolver resolver = runtime.getChannel().getEntityResolver();
+
+        // test with adapter that supports keys
+        JdbcAdapter adapter = buildAdapter(true);
+
+        InsertBatchQuery batch1 = new InsertBatchQuery(resolver.getObjEntity(GeneratedColumnTestEntity.class)
+                .getDbEntity(), 5);
+
+        DataNode node = new DataNode();
+        node.setAdapter(adapter);
+        node.setEntityResolver(resolver);
+        node.setRowReaderFactory(mock(RowReaderFactory.class));
+
+        assertTrue(new BatchAction(batch1, node, false).hasGeneratedKeys());
+    }
+
+    @Test
+    public void testHasGeneratedKeys2() throws Exception {
+        EntityResolver resolver = runtime.getChannel().getEntityResolver();
+
+        // test with adapter that does not support keys...
+        JdbcAdapter adapter = buildAdapter(false);
+
+        InsertBatchQuery batch1 = new InsertBatchQuery(resolver.getObjEntity(GeneratedColumnTestEntity.class)
+                .getDbEntity(), 5);
+
+        DataNode node = new DataNode();
+        node.setAdapter(adapter);
+        node.setEntityResolver(resolver);
+        node.setRowReaderFactory(mock(RowReaderFactory.class));
+
+        assertFalse(new BatchAction(batch1, node, false).hasGeneratedKeys());
+    }
+
+    JdbcAdapter buildAdapter(boolean supportGeneratedKeys) {
+        JdbcAdapter adapter = objectFactory.newInstance(JdbcAdapter.class, JdbcAdapter.class.getName());
+        adapter.setSupportsGeneratedKeys(supportGeneratedKeys);
+        return adapter;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java
index 51bd248..3a72e1e 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java
@@ -28,13 +28,11 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.InsertBatchQuery;
 import org.apache.cayenne.testdo.testmap.Artist;
-import org.apache.cayenne.testdo.testmap.GeneratedColumnTestEntity;
 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.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 
 @UseServerRuntime(ServerCase.TESTMAP_PROJECT)
@@ -53,15 +51,11 @@ public class BatchActionIT extends ServerCase {
         // test with adapter that supports keys
         JdbcAdapter adapter = buildAdapter(true);
 
-        InsertBatchQuery batch1 = new InsertBatchQuery(resolver.getObjEntity(GeneratedColumnTestEntity.class)
-                .getDbEntity(), 5);
         DataNode node = new DataNode();
         node.setAdapter(adapter);
         node.setEntityResolver(resolver);
         node.setRowReaderFactory(mock(RowReaderFactory.class));
 
-        assertTrue(new BatchAction(batch1, node, false).hasGeneratedKeys());
-
         InsertBatchQuery batch2 = new InsertBatchQuery(resolver.getObjEntity(Artist.class).getDbEntity(), 5);
         assertFalse(new BatchAction(batch2, node, false).hasGeneratedKeys());
     }
@@ -73,16 +67,11 @@ public class BatchActionIT extends ServerCase {
         // test with adapter that does not support keys...
         JdbcAdapter adapter = buildAdapter(false);
 
-        InsertBatchQuery batch1 = new InsertBatchQuery(resolver.getObjEntity(GeneratedColumnTestEntity.class)
-                .getDbEntity(), 5);
-
         DataNode node = new DataNode();
         node.setAdapter(adapter);
         node.setEntityResolver(resolver);
         node.setRowReaderFactory(mock(RowReaderFactory.class));
 
-        assertFalse(new BatchAction(batch1, node, false).hasGeneratedKeys());
-
         InsertBatchQuery batch2 = new InsertBatchQuery(resolver.getObjEntity(Artist.class).getDbEntity(), 5);
         assertFalse(new BatchAction(batch2, node, false).hasGeneratedKeys());
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java
index 48ddcef..9786266 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java
@@ -24,8 +24,8 @@ import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.jdbc.DBHelper;
-import org.apache.cayenne.testdo.testmap.ClobTestEntity;
-import org.apache.cayenne.testdo.testmap.ClobTestRelation;
+import org.apache.cayenne.testdo.lob.ClobTestEntity;
+import org.apache.cayenne.testdo.lob.ClobTestRelation;
 import org.apache.cayenne.unit.UnitDbAdapter;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
@@ -36,7 +36,7 @@ import java.util.List;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.LOB_PROJECT)
 public class SelectActionIT extends ServerCase {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java
index 86218d9..954808e 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java
@@ -62,7 +62,7 @@ public class ServerRuntimeBuilder_InAction_IT extends ServerCase {
         tArtist.insert(33001, "AA1");
         tArtist.insert(33002, "AA2");
 
-        this.dataSource = runtime.getDataSource("tstmap");
+        this.dataSource = runtime.getDataSource("testmap");
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java
index d2a372e..73425bf 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+@UseServerRuntime(ServerCase.LOB_PROJECT)
 public class OracleAdapterIT extends ServerCase {
 
     @Inject
@@ -46,13 +46,13 @@ public class OracleAdapterIT extends ServerCase {
 
     @Test
     public void testUpdatesLOBColumns() throws Exception {
-        DataMap map = runtime.getDataDomain().getDataMap("tstmap");
+        DataMap map = runtime.getDataDomain().getDataMap("lob");
         assertTrue(OracleAdapter.updatesLOBColumns(new InsertBatchQuery(map
                 .getDbEntity("BLOB_TEST"), 1)));
         assertTrue(OracleAdapter.updatesLOBColumns(new InsertBatchQuery(map
                 .getDbEntity("CLOB_TEST"), 1)));
         assertFalse(OracleAdapter.updatesLOBColumns(new InsertBatchQuery(map
-                .getDbEntity("ARTIST"), 1)));
+                .getDbEntity("TEST"), 1)));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
index a305cf9..7a45599 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.exp;
 
-import org.apache.cayenne.testdo.testmap.BooleanTestEntity;
+import org.apache.cayenne.testdo.numeric_types.BooleanTestEntity;
 import org.junit.Test;
 
 import static org.junit.Assert.assertFalse;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
index 205f569..4e078e6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
@@ -91,11 +91,11 @@ public class MapLoaderLoadTest {
     @Test
     public void testLoadTestMap() throws Exception {
         MapLoader mapLoader = new MapLoader();
-        DataMap map = mapLoader.loadDataMap(getMapXml("tstmap.map.xml"));
+        DataMap map = mapLoader.loadDataMap(getMapXml("testmap.map.xml"));
         assertNotNull(map);
 
         // test procedures
-        Procedure procedure = map.getProcedure("cayenne_tst_upd_proc");
+        Procedure procedure = map.getProcedure("cayenne_test_upd_proc");
         assertNotNull(procedure);
         List<ProcedureParameter> params = procedure.getCallParameters();
         assertNotNull(params);
@@ -124,7 +124,7 @@ public class MapLoaderLoadTest {
     public void testEncodeAsXML() throws FileNotFoundException {
         // load map
         MapLoader mapLoader = new MapLoader();
-        DataMap map = mapLoader.loadDataMap(getMapXml("tstmap.map.xml"));
+        DataMap map = mapLoader.loadDataMap(getMapXml("testmap.map.xml"));
         assertNotNull(map);
 
         // encode map

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java
index 9103f15..14fe42f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java
@@ -124,7 +124,7 @@ public class ObjEntityIT extends ServerCase {
         assertNull(clientPk.getEntity());
         assertFalse(clientArtistE.getAttributes().contains(pk));
 
-        ObjEntity meaningfulPKE = runtime.getDataDomain().getEntityResolver().getObjEntity("MeaningfulPKTest1");
+        ObjEntity meaningfulPKE = runtime.getDataDomain().getEntityResolver().getObjEntity("MeaningfulGeneratedColumnTestEntity");
         Collection<ObjAttribute> mpks = meaningfulPKE.getPrimaryKeys();
         assertEquals(1, mpks.size());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java
index 53d5039..d8fac76 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java
@@ -85,7 +85,7 @@ public abstract class MergeCase extends ServerCase {
         // this map can't be safely modified in this test, as it is reset by DI
         // container
         // on every test
-        map = runtime.getDataDomain().getDataMap("tstmap");
+        map = runtime.getDataDomain().getDataMap("testmap");
 
         filterDataMap();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
index 2513627..c4f010b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java
@@ -29,7 +29,6 @@ import org.apache.cayenne.map.EntityResolver;
 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.BigIntegerEntity;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.DataChannelInterceptor;
 import org.apache.cayenne.unit.di.UnitTestClosure;
@@ -67,22 +66,17 @@ public class EJBQLQueryIT extends ServerCase {
 
     private TableHelper tArtist;
     private TableHelper tPainting;
-    private TableHelper tBigIntegerEntity;
 
     @Override
     protected void setUpAfterInjection() throws Exception {
         dbHelper.deleteAll("PAINTING");
         dbHelper.deleteAll("ARTIST");
-        dbHelper.deleteAll("BIGINTEGER_ENTITY");
 
         tArtist = new TableHelper(dbHelper, "ARTIST");
         tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
 
         tPainting = new TableHelper(dbHelper, "PAINTING");
         tPainting.setColumns("PAINTING_ID", "ARTIST_ID", "PAINTING_TITLE");
-
-        tBigIntegerEntity = new TableHelper(dbHelper, "BIGINTEGER_ENTITY");
-        tBigIntegerEntity.setColumns("ID", "BIG_INTEGER_FIELD");
     }
 
     protected void createArtistsDataSet() throws Exception {
@@ -101,29 +95,6 @@ public class EJBQLQueryIT extends ServerCase {
         tPainting.insert(33003, 33002, "%%?_title%%_");
     }
 
-    protected void createBigIntegerEntitiesDataSet() throws Exception {
-        tBigIntegerEntity.insert(44001, new Long(744073709551715l));
-    }
-
-    @Test
-    public void testLongParameter() throws Exception {
-        createBigIntegerEntitiesDataSet();
-        String ejbql = "SELECT bie FROM BigIntegerEntity bie WHERE bie.bigIntegerField > ?1";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-        query.setParameter(1,744073709551615l);
-        List<BigIntegerEntity> result = context.performQuery(query);
-        assertEquals(1, result.size());
-    }
-
-    @Test
-    public void testLongLiteral() throws Exception {
-        createBigIntegerEntitiesDataSet();
-        String ejbql = "SELECT bie FROM BigIntegerEntity bie WHERE bie.bigIntegerField > 744073709551615";
-        EJBQLQuery query = new EJBQLQuery(ejbql);
-        List<BigIntegerEntity> result = context.performQuery(query);
-        assertEquals(1, result.size());
-    }
-
     @Test
     public void testParameters() {
         String ejbql = "select a FROM Artist a WHERE a.artistName = ?1 OR a.artistName = :name";

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryNumericIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryNumericIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryNumericIT.java
new file mode 100644
index 0000000..3cb152a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryNumericIT.java
@@ -0,0 +1,57 @@
+package org.apache.cayenne.query;
+
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.test.jdbc.DBHelper;
+import org.apache.cayenne.test.jdbc.TableHelper;
+import org.apache.cayenne.testdo.numeric_types.BigIntegerEntity;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+@UseServerRuntime(ServerCase.NUMERIC_TYPES_PROJECT)
+public class EJBQLQueryNumericIT extends ServerCase {
+
+    @Inject
+    protected DBHelper dbHelper;
+
+    @Inject
+    private ObjectContext context;
+
+    private TableHelper tBigIntegerEntity;
+
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("BIGINTEGER_ENTITY");
+
+        tBigIntegerEntity = new TableHelper(dbHelper, "BIGINTEGER_ENTITY");
+        tBigIntegerEntity.setColumns("ID", "BIG_INTEGER_FIELD");
+    }
+
+    protected void createBigIntegerEntitiesDataSet() throws Exception {
+        tBigIntegerEntity.insert(44001, new Long(744073709551715l));
+    }
+
+    @Test
+    public void testLongParameter() throws Exception {
+        createBigIntegerEntitiesDataSet();
+        String ejbql = "SELECT bie FROM BigIntegerEntity bie WHERE bie.bigIntegerField > ?1";
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        query.setParameter(1,744073709551615l);
+        List<BigIntegerEntity> result = context.performQuery(query);
+        assertEquals(1, result.size());
+    }
+
+    @Test
+    public void testLongLiteral() throws Exception {
+        createBigIntegerEntitiesDataSet();
+        String ejbql = "SELECT bie FROM BigIntegerEntity bie WHERE bie.bigIntegerField > 744073709551615";
+        EJBQLQuery query = new EJBQLQuery(ejbql);
+        List<BigIntegerEntity> result = context.performQuery(query);
+        assertEquals(1, result.size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
index dd5882f..56d31b1 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLSelectIT.java
@@ -68,7 +68,7 @@ public class SQLSelectIT extends ServerCase {
 
 		createArtistsDataSet();
 
-		SQLSelect<DataRow> q1 = SQLSelect.dataRowQuery("tstmap", "SELECT * FROM ARTIST");
+		SQLSelect<DataRow> q1 = SQLSelect.dataRowQuery("testmap", "SELECT * FROM ARTIST");
 		assertTrue(q1.isFetchingDataRows());
 
 		List<DataRow> result = context.select(q1);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateIT.java
index 244c8d5..d4696ac 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLTemplateIT.java
@@ -65,7 +65,7 @@ public class SQLTemplateIT extends ServerCase {
 
     @Test
 	public void testSQLTemplateForDataMap() {
-		DataMap testDataMap = context.getEntityResolver().getDataMap("tstmap");
+		DataMap testDataMap = context.getEntityResolver().getDataMap("testmap");
 		SQLTemplate q1 = new SQLTemplate(testDataMap, "SELECT * FROM ARTIST", true);
 		List<DataRow> result = context.performQuery(q1);
 		assertEquals(0, result.size());
@@ -73,7 +73,7 @@ public class SQLTemplateIT extends ServerCase {
 
     @Test
 	public void testSQLTemplateForDataMapWithInsert() {
-		DataMap testDataMap = context.getEntityResolver().getDataMap("tstmap");
+		DataMap testDataMap = context.getEntityResolver().getDataMap("testmap");
 		String sql = "INSERT INTO ARTIST VALUES (15, 'Surikov', null)";
 		SQLTemplate q1 = new SQLTemplate(testDataMap, sql, true);
 		context.performNonSelectingQuery(q1);
@@ -85,7 +85,7 @@ public class SQLTemplateIT extends ServerCase {
 
     @Test
 	public void testSQLTemplateForDataMapWithInsertException() {
-		DataMap testDataMap = context.getEntityResolver().getDataMap("tstmap");
+		DataMap testDataMap = context.getEntityResolver().getDataMap("testmap");
 		String sql = "INSERT INTO ARTIST VALUES (15, 'Surikov', null)";
 		SQLTemplate q1 = new SQLTemplate(testDataMap, sql, true);
 		context.performNonSelectingQuery(q1);
@@ -97,7 +97,7 @@ public class SQLTemplateIT extends ServerCase {
 		} catch (CayenneRuntimeException e) {
 			gotRuntimeException = true;
 		}
-		assertTrue("If fetchingDataRows is false and ObjectEntity not set, shoulb be thrown exception",
+		assertTrue("If fetchingDataRows is false and ObjectEntity not set, should be thrown exception",
 				gotRuntimeException);
 	}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/535ecb88/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryClobIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryClobIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryClobIT.java
new file mode 100644
index 0000000..debde5e
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryClobIT.java
@@ -0,0 +1,108 @@
+package org.apache.cayenne.query;
+
+import org.apache.cayenne.Cayenne;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.exp.Expression;
+import org.apache.cayenne.exp.ExpressionFactory;
+import org.apache.cayenne.test.jdbc.DBHelper;
+import org.apache.cayenne.test.jdbc.TableHelper;
+import org.apache.cayenne.testdo.lob.ClobTestEntity;
+import org.apache.cayenne.unit.UnitDbAdapter;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+@UseServerRuntime(ServerCase.LOB_PROJECT)
+public class SelectQueryClobIT extends ServerCase {
+
+    @Inject
+    private ObjectContext context;
+
+    @Inject
+    private DBHelper dbHelper;
+
+    @Inject
+    private UnitDbAdapter accessStackAdapter;
+
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("CLOB_TEST_RELATION");
+
+        if (accessStackAdapter.supportsLobs()) {
+            dbHelper.deleteAll("CLOB_TEST");
+        }
+    }
+
+    protected void createClobDataSet() throws Exception {
+        TableHelper tClobTest = new TableHelper(dbHelper, "CLOB_TEST");
+        tClobTest.setColumns("CLOB_TEST_ID", "CLOB_COL");
+
+        tClobTest.deleteAll();
+
+        tClobTest.insert(1, "clob1");
+        tClobTest.insert(2, "clob2");
+    }
+
+    /**
+     * Test how "like ignore case" works when using uppercase parameter.
+     */
+    @Test
+    public void testSelectLikeIgnoreCaseClob() throws Exception {
+        if (accessStackAdapter.supportsLobs()) {
+            createClobDataSet();
+            SelectQuery<ClobTestEntity> query = new SelectQuery<ClobTestEntity>(ClobTestEntity.class);
+            Expression qual = ExpressionFactory.likeIgnoreCaseExp("clobCol", "clob%");
+            query.setQualifier(qual);
+            List<?> objects = context.performQuery(query);
+            assertEquals(2, objects.size());
+        }
+    }
+
+    @Test
+    public void testSelectFetchLimit_Offset_DistinctClob() throws Exception {
+        if (accessStackAdapter.supportsLobs()) {
+            createClobDataSet();
+
+            // see CAY-1539... CLOB column causes suppression of DISTINCT in
+            // SQL, and hence the offset processing is done in memory
+            SelectQuery<ClobTestEntity> query = new SelectQuery<ClobTestEntity>(ClobTestEntity.class);
+            query.addOrdering("db:" + ClobTestEntity.CLOB_TEST_ID_PK_COLUMN, SortOrder.ASCENDING);
+            query.setFetchLimit(1);
+            query.setFetchOffset(1);
+            query.setDistinct(true);
+
+            List<ClobTestEntity> objects = context.performQuery(query);
+            assertEquals(1, objects.size());
+            assertEquals(2, Cayenne.intPKForObject(objects.get(0)));
+        }
+    }
+
+    @Test
+    public void testSelectEqualsClob() throws Exception {
+        if (accessStackAdapter.supportsLobComparisons()) {
+            createClobDataSet();
+            SelectQuery<ClobTestEntity> query = new SelectQuery<ClobTestEntity>(ClobTestEntity.class);
+            Expression qual = ExpressionFactory.matchExp("clobCol", "clob1");
+            query.setQualifier(qual);
+            List<?> objects = context.performQuery(query);
+            assertEquals(1, objects.size());
+        }
+    }
+
+    @Test
+    public void testSelectNotEqualsClob() throws Exception {
+        if (accessStackAdapter.supportsLobComparisons()) {
+            createClobDataSet();
+            SelectQuery query = new SelectQuery(ClobTestEntity.class);
+            Expression qual = ExpressionFactory.noMatchExp("clobCol", "clob1");
+            query.setQualifier(qual);
+            List<?> objects = context.performQuery(query);
+            assertEquals(1, objects.size());
+        }
+    }
+}
\ No newline at end of file


Mime
View raw message