cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: CAY-2056, CAY-2058, CAY-2200: cleanup tests - cayenne-server tests are passing for DB2 and Oracle - all tests are passing for SQL Server - minor fixes for Ingres, hsqldb and Firebird
Date Sat, 21 Jan 2017 09:14:28 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 48f7e411c -> 44f3076ab


CAY-2056, CAY-2058, CAY-2200: cleanup tests
 - cayenne-server tests are passing for DB2 and Oracle
 - all tests are passing for SQL Server
 - minor fixes for Ingres, hsqldb and Firebird


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/44f3076a
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/44f3076a
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/44f3076a

Branch: refs/heads/master
Commit: 44f3076ab3e713938c2d6f9ea5a0985c0fbd75c0
Parents: 48f7e41
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Sat Jan 21 12:12:08 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Sat Jan 21 12:12:08 2017 +0300

----------------------------------------------------------------------
 .../dbsync/reverse/dbload/EntityLoaderIT.java   | 10 ++-
 .../dba/hsqldb/HSQLQualifierTranslator.java     | 15 +++++
 .../oracle/OracleEJBQLConditionTranslator.java  | 33 ++++++++++
 ...extEJBQLDateTimeFunctionalExpressionsIT.java |  9 +++
 .../cayenne/access/ReturnTypesMappingIT.java    | 65 +++++++++++++++-----
 .../exp/parser/ASTFunctionCallDateIT.java       | 19 ++++--
 .../query/ObjectSelect_PrimitiveColumnsIT.java  | 11 ++++
 .../org/apache/cayenne/query/SelectQueryIT.java |  4 ++
 .../apache/cayenne/unit/DB2UnitDbAdapter.java   |  5 ++
 .../cayenne/unit/FirebirdUnitDbAdapter.java     |  5 ++
 .../cayenne/unit/IngresUnitDbAdapter.java       |  5 ++
 .../cayenne/unit/OracleUnitDbAdapter.java       | 10 +++
 .../cayenne/unit/SQLServerUnitDbAdapter.java    |  5 ++
 .../org/apache/cayenne/unit/UnitDbAdapter.java  | 12 ++++
 14 files changed, 185 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/dbload/EntityLoaderIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/dbload/EntityLoaderIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/dbload/EntityLoaderIT.java
index b05bc21..0ff5d8b 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/dbload/EntityLoaderIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/dbload/EntityLoaderIT.java
@@ -19,10 +19,11 @@
 
 package org.apache.cayenne.dbsync.reverse.dbload;
 
+import java.sql.SQLException;
+
 import org.apache.cayenne.dbsync.reverse.filters.FiltersConfig;
 import org.apache.cayenne.dbsync.reverse.filters.PatternFilter;
 import org.apache.cayenne.dbsync.reverse.filters.TableFilter;
-import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 
 import org.junit.Test;
@@ -43,7 +44,12 @@ public class EntityLoaderIT extends BaseLoaderIT {
         );
 
         EntityLoader loader = new EntityLoader(adapter, config, new DefaultDbLoaderDelegate());
-        loader.load(connection.getMetaData(), store);
+        try {
+            loader.load(connection.getMetaData(), store);
+        } catch (SQLException ex) {
+            // SQL Server will throw exception here.
+            assertTrue(ex.getMessage().contains("WRONG")); // just check that message is
about "WRONG" catalog
+        }
 
         assertTrue("Store is not empty", store.getDbEntities().isEmpty());
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLQualifierTranslator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLQualifierTranslator.java
b/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLQualifierTranslator.java
index ec3fa50..bc3990d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLQualifierTranslator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLQualifierTranslator.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.translator.select.QueryAssembler;
 import org.apache.cayenne.access.translator.select.TrimmingQualifierTranslator;
+import org.apache.cayenne.exp.parser.ASTFunctionCall;
 import org.apache.cayenne.exp.parser.PatternMatchNode;
 
 /**
@@ -54,4 +55,18 @@ public class HSQLQualifierTranslator extends TrimmingQualifierTranslator
{
             out.append("'");
         }
     }
+
+    @Override
+    protected void appendFunction(ASTFunctionCall functionExpression) {
+        // from documentation:
+        // CURRENT_TIME returns a value of TIME WITH TIME ZONE type.
+        // LOCALTIME returns a value of TIME type.
+        // CURTIME() is a synonym for LOCALTIME.
+        // use LOCALTIME to better align with other DBs
+        if("CURRENT_TIME".equals(functionExpression.getFunctionName())) {
+            out.append("LOCALTIME");
+        } else {
+            super.appendFunction(functionExpression);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleEJBQLConditionTranslator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleEJBQLConditionTranslator.java
b/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleEJBQLConditionTranslator.java
index 8a7efb6..31fce59 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleEJBQLConditionTranslator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleEJBQLConditionTranslator.java
@@ -25,6 +25,7 @@ import org.apache.cayenne.access.translator.ejbql.EJBQLMultiColumnOperand;
 import org.apache.cayenne.access.translator.ejbql.EJBQLPathTranslator;
 import org.apache.cayenne.access.translator.ejbql.EJBQLTranslationContext;
 import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.parser.Node;
 import org.apache.cayenne.map.ObjAttribute;
 
 /**
@@ -61,4 +62,36 @@ class OracleEJBQLConditionTranslator extends EJBQLConditionTranslator {
 
         return false;
     }
+
+    /**
+     * The order of arguments is inverted in Oracle.
+     * LOCATE(substr, str) -> INSTR(str, substr)
+     * @since 4.0
+     */
+    @Override
+    public boolean visitLocate(EJBQLExpression expression, int finishedChildIndex) {
+        if(finishedChildIndex < 0) {
+            swapNodeChildren(expression, 0, 1);
+            context.append(" INSTR(");
+        } else if (finishedChildIndex + 1 == expression.getChildrenCount()) {
+            context.append(")");
+            swapNodeChildren(expression, 0, 1);
+        } else {
+            context.append(',');
+        }
+        return true;
+    }
+
+    /**
+     * @since 4.0
+     */
+    private void swapNodeChildren(EJBQLExpression expression, int i, int j) {
+        if(!(expression instanceof Node)) {
+            return;
+        }
+        Node node = (Node)expression;
+        Node tmp = node.jjtGetChild(i);
+        node.jjtAddChild(node.jjtGetChild(j), i);
+        node.jjtAddChild(tmp, j);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLDateTimeFunctionalExpressionsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLDateTimeFunctionalExpressionsIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLDateTimeFunctionalExpressionsIT.java
index 2f58216..494e840 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLDateTimeFunctionalExpressionsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLDateTimeFunctionalExpressionsIT.java
@@ -23,6 +23,7 @@ import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.EJBQLQuery;
 import org.apache.cayenne.testdo.date_time.DateTestEntity;
+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;
@@ -40,6 +41,9 @@ public class DataContextEJBQLDateTimeFunctionalExpressionsIT extends ServerCase
     @Inject
     private ObjectContext context;
 
+    @Inject
+    private UnitDbAdapter unitDbAdapter;
+
     @Test
     public void testCURRENT_DATE() {
 
@@ -84,6 +88,11 @@ public class DataContextEJBQLDateTimeFunctionalExpressionsIT extends ServerCase
         EJBQLQuery query = new EJBQLQuery(
                 "SELECT d FROM DateTestEntity d WHERE d.timeColumn < CURRENT_TIME");
         List<?> objects = context.performQuery(query);
+        if(!unitDbAdapter.supportsTimeSqlType()) {
+            // check only that query is executed without error
+            // result will be invalid most likely as DB doesn't support TIME data type
+            return;
+        }
         assertEquals(1, objects.size());
         assertTrue(objects.contains(o1));
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/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 f06d146..4dabb68 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
@@ -45,7 +45,7 @@ import static org.junit.Assume.assumeTrue;
  * Test Types mapping for selected columns
  */
 @UseServerRuntime(CayenneProjects.RETURN_TYPES_PROJECT)
-public class    ReturnTypesMappingIT extends ServerCase {
+public class ReturnTypesMappingIT extends ServerCase {
 
     @Inject
     private DataContext context;
@@ -69,8 +69,13 @@ public class    ReturnTypesMappingIT extends ServerCase {
         DataRow testRead = (DataRow) context.performQuery(MappedSelect.query("SelectReturnTypesMap1")).get(0);
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
-        assertEquals(Long.class, columnValue.getClass());
-        assertEquals(bigintValue, columnValue);
+        if(unitDbAdapter.onlyGenericNumberType()) {
+            assertEquals(BigDecimal.class, columnValue.getClass());
+            assertEquals(BigDecimal.valueOf(bigintValue), columnValue);
+        } else {
+            assertEquals(Long.class, columnValue.getClass());
+            assertEquals(bigintValue, columnValue);
+        }
     }
 
     @Test
@@ -142,7 +147,8 @@ public class    ReturnTypesMappingIT extends ServerCase {
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
         assertTrue(Boolean.class.equals(columnValue.getClass())
-                || Short.class.equals(columnValue.getClass()));
+                || Short.class.equals(columnValue.getClass())
+                || Integer.class.equals(columnValue.getClass()));
         assertTrue(bitValue.equals(columnValue) || ((Number) columnValue).intValue() == 1);
     }
 
@@ -218,7 +224,8 @@ public class    ReturnTypesMappingIT extends ServerCase {
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
         assertTrue(Boolean.class.equals(columnValue.getClass())
-                || Short.class.equals(columnValue.getClass()));
+                || Short.class.equals(columnValue.getClass())
+                || Integer.class.equals(columnValue.getClass()));
         assertTrue(booleanValue.equals(columnValue)
                 || ((Number) columnValue).intValue() == 1);
     }
@@ -442,8 +449,13 @@ public class    ReturnTypesMappingIT extends ServerCase {
         DataRow testRead = (DataRow) context.performQuery(MappedSelect.query("SelectReturnTypesMap1")).get(0);
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
-        assertEquals(Double.class, columnValue.getClass());
-        assertEquals(doubleValue, columnValue);
+        if(unitDbAdapter.onlyGenericNumberType()) {
+            assertEquals(BigDecimal.class, columnValue.getClass());
+            assertEquals(BigDecimal.valueOf(doubleValue), columnValue);
+        } else {
+            assertEquals(Double.class, columnValue.getClass());
+            assertEquals(doubleValue, columnValue);
+        }
     }
 
     @Test
@@ -474,8 +486,12 @@ public class    ReturnTypesMappingIT extends ServerCase {
         DataRow testRead = (DataRow) context.performQuery(MappedSelect.query("SelectReturnTypesMap1")).get(0);
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
-        assertTrue(Float.class.equals(columnValue.getClass())
-                || Double.class.equals(columnValue.getClass()));
+        if(unitDbAdapter.onlyGenericNumberType()) {
+            assertEquals(BigDecimal.class, columnValue.getClass());
+        } else {
+            assertTrue(Float.class.equals(columnValue.getClass())
+                    || Double.class.equals(columnValue.getClass()));
+        }
         assertEquals(floatValue.floatValue(), ((Number)columnValue).floatValue(), 0);
     }
 
@@ -674,12 +690,16 @@ public class    ReturnTypesMappingIT extends ServerCase {
 
         // MySQL can treat REAL as either DOUBLE or FLOAT depending on the
         // engine settings
-        if (unitDbAdapter.realAsDouble()) {
-            assertEquals(Double.class, columnValue.getClass());
-            assertEquals(Double.valueOf(realValue), (Double) columnValue, 0.0001);
+        if(unitDbAdapter.onlyGenericNumberType()) {
+            assertEquals(BigDecimal.class, columnValue.getClass());
         } else {
-            assertEquals(Float.class, columnValue.getClass());
-            assertEquals(realValue, columnValue);
+            if (unitDbAdapter.realAsDouble()) {
+                assertEquals(Double.class, columnValue.getClass());
+                assertEquals(Double.valueOf(realValue), (Double) columnValue, 0.0001);
+            } else {
+                assertEquals(Float.class, columnValue.getClass());
+                assertEquals(realValue, columnValue);
+            }
         }
     }
 
@@ -705,14 +725,20 @@ public class    ReturnTypesMappingIT extends ServerCase {
         ReturnTypesMap1 test = context.newObject(ReturnTypesMap1.class);
 
         Short smallintValue = 32564;
+        Integer intValue = 32564;
         test.setSmallintColumn(smallintValue);
         context.commitChanges();
 		
         DataRow testRead = (DataRow) context.performQuery(MappedSelect.query("SelectReturnTypesMap1")).get(0);
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
-        assertEquals(Short.class, columnValue.getClass());
-        assertEquals(smallintValue, columnValue);
+        if(unitDbAdapter.onlyGenericNumberType()) {
+            assertEquals(Integer.class, columnValue.getClass());
+            assertEquals(intValue, columnValue);
+        } else {
+            assertEquals(Short.class, columnValue.getClass());
+            assertEquals(smallintValue, columnValue);
+        }
     }
 
     @Test
@@ -815,13 +841,18 @@ public class    ReturnTypesMappingIT extends ServerCase {
         ReturnTypesMap1 test = context.newObject(ReturnTypesMap1.class);
 
         Byte tinyintValue = 89;
+        Integer intValue = 89;
         test.setTinyintColumn(tinyintValue);
         context.commitChanges();
 		
         DataRow testRead = (DataRow) context.performQuery(MappedSelect.query("SelectReturnTypesMap1")).get(0);
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
-        assertEquals(Short.class, columnValue.getClass());
+        if(unitDbAdapter.onlyGenericNumberType()) {
+            assertEquals(Integer.class, columnValue.getClass());
+        } else {
+            assertEquals(Short.class, columnValue.getClass());
+        }
         assertEquals(tinyintValue.intValue(), ((Number)columnValue).intValue());
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTFunctionCallDateIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTFunctionCallDateIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTFunctionCallDateIT.java
index 2c4a17d..6110eb1 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTFunctionCallDateIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTFunctionCallDateIT.java
@@ -20,7 +20,7 @@
 package org.apache.cayenne.exp.parser;
 
 import java.util.Calendar;
-import java.util.TimeZone;
+import java.util.List;
 
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.di.Inject;
@@ -29,12 +29,14 @@ import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.ObjectSelect;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.date_time.DateTestEntity;
+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 static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 
@@ -50,9 +52,12 @@ public class ASTFunctionCallDateIT extends ServerCase {
     @Inject
     private DBHelper dbHelper;
 
+    @Inject
+    private UnitDbAdapter unitDbAdapter;
+
     @Before
     public void createDataSet() throws Exception {
-        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+        Calendar cal = Calendar.getInstance();
         int year = cal.get(Calendar.YEAR);
         int month = cal.get(Calendar.MONTH);
         int day = cal.get(Calendar.DAY_OF_MONTH);
@@ -92,8 +97,14 @@ public class ASTFunctionCallDateIT extends ServerCase {
     @Test
     public void testCurrentTime() throws Exception {
         Expression exp = ExpressionFactory.greaterOrEqualExp("timeColumn", new ASTCurrentTime());
-        DateTestEntity res1 = ObjectSelect.query(DateTestEntity.class, exp).selectOne(context);
-        assertNotNull(res1);
+        List<DateTestEntity> res = ObjectSelect.query(DateTestEntity.class, exp).select(context);
+        if(!unitDbAdapter.supportsTimeSqlType()) {
+            // check only that query is executed without error
+            // result will be invalid most likely as DB doesn't support TIME data type
+            return;
+        }
+        assertEquals(1, res.size());
+        DateTestEntity res1 = res.get(0);
 
         Expression exp2 = ExpressionFactory.lessExp("timeColumn", new ASTCurrentTime());
         DateTestEntity res2 = ObjectSelect.query(DateTestEntity.class, exp2).selectOne(context);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/query/ObjectSelect_PrimitiveColumnsIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/ObjectSelect_PrimitiveColumnsIT.java
b/cayenne-server/src/test/java/org/apache/cayenne/query/ObjectSelect_PrimitiveColumnsIT.java
index 7654bca..14f0d71 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/ObjectSelect_PrimitiveColumnsIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/ObjectSelect_PrimitiveColumnsIT.java
@@ -28,6 +28,7 @@ import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.primitive.PrimitivesTestEntity;
+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;
@@ -50,6 +51,9 @@ public class ObjectSelect_PrimitiveColumnsIT extends ServerCase {
     @Inject
     private DBHelper dbHelper;
 
+    @Inject
+    private UnitDbAdapter unitDbAdapter;
+
     @Before
     public void createTestRecords() throws Exception {
         TableHelper tPrimitives = new TableHelper(dbHelper, "PRIMITIVES_TEST");
@@ -111,6 +115,10 @@ public class ObjectSelect_PrimitiveColumnsIT extends ServerCase {
 
     @Test
     public void test_SelectBooleanExpColumn() throws Exception {
+        if(!unitDbAdapter.supportsSelectBooleanExpression()) {
+            return;
+        }
+
         Property<Boolean> property = Property.create("boolColumn",
                 ExpressionFactory.exp("(obj:intColumn < 10)"), Boolean.class);
 
@@ -135,6 +143,9 @@ public class ObjectSelect_PrimitiveColumnsIT extends ServerCase {
 
     @Test
     public void test_SelectColumnsExpList() throws Exception {
+        if(!unitDbAdapter.supportsSelectBooleanExpression()) {
+            return;
+        }
 
         Property<Integer> intProperty = Property.create("intColumn",
                 ExpressionFactory.exp("(obj:intColumn + 1)"), Integer.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryIT.java
index efbb8fa..6108934 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectQueryIT.java
@@ -247,6 +247,10 @@ public class SelectQueryIT extends ServerCase {
 		assertEquals(19, objects.size());
 	}
 
+	/**
+	 * SQL Server failure:
+	 * http://stackoverflow.com/questions/14962419/is-the-like-operator-case-sensitive-with-ms-sql-server
+	 */
 	@Test
 	public void testSelectLikeCaseSensitive() throws Exception {
 		if (!accessStackAdapter.supportsCaseSensitiveLike()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/unit/DB2UnitDbAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/DB2UnitDbAdapter.java b/cayenne-server/src/test/java/org/apache/cayenne/unit/DB2UnitDbAdapter.java
index ac46910..0eeb26b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/DB2UnitDbAdapter.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/DB2UnitDbAdapter.java
@@ -68,4 +68,9 @@ public class DB2UnitDbAdapter extends UnitDbAdapter {
     public boolean supportsExpressionInHaving() {
         return false;
     }
+
+    @Override
+    public boolean supportsSelectBooleanExpression() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/unit/FirebirdUnitDbAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/FirebirdUnitDbAdapter.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/FirebirdUnitDbAdapter.java
index 54e333a..b6e7eca 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/FirebirdUnitDbAdapter.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/FirebirdUnitDbAdapter.java
@@ -51,4 +51,9 @@ public class FirebirdUnitDbAdapter extends UnitDbAdapter {
     public boolean supportsPKGeneratorConcurrency() {
         return false;
     }
+
+    @Override
+    public boolean supportsSelectBooleanExpression() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
index e0f913f..aa043ec 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
@@ -46,4 +46,9 @@ public class IngresUnitDbAdapter extends UnitDbAdapter {
     public boolean supportsExpressionInHaving() {
         return false;
     }
+
+    @Override
+    public boolean supportsSelectBooleanExpression() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/unit/OracleUnitDbAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/OracleUnitDbAdapter.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/OracleUnitDbAdapter.java
index 1d9c99b..633a03d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/OracleUnitDbAdapter.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/OracleUnitDbAdapter.java
@@ -132,7 +132,17 @@ public class OracleUnitDbAdapter extends UnitDbAdapter {
     }
 
     @Override
+    public boolean supportsTimeSqlType() {
+        return false;
+    }
+
+    @Override
     public boolean supportsExpressionInHaving() {
         return false;
     }
+
+    @Override
+    public boolean supportsSelectBooleanExpression() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/unit/SQLServerUnitDbAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/SQLServerUnitDbAdapter.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/SQLServerUnitDbAdapter.java
index b91f09b..d25c97b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/SQLServerUnitDbAdapter.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/SQLServerUnitDbAdapter.java
@@ -86,4 +86,9 @@ public class SQLServerUnitDbAdapter extends SybaseUnitDbAdapter {
     public boolean supportsExpressionInHaving() {
         return false;
     }
+
+    @Override
+    public boolean supportsSelectBooleanExpression() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/44f3076a/cayenne-server/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java b/cayenne-server/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
index 57a2336..87ca60c 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/UnitDbAdapter.java
@@ -355,6 +355,10 @@ public class UnitDbAdapter {
         return false;
     }
 
+    public boolean supportsTimeSqlType() {
+        return true;
+    }
+
     public boolean onlyGenericDateType() {
         return false;
     }
@@ -386,4 +390,12 @@ public class UnitDbAdapter {
     public boolean supportsExpressionInHaving() {
         return true;
     }
+
+    /**
+     * Support for select like this:
+     * SELECT (intColumn < 10) AS bool FROM table
+     */
+    public boolean supportsSelectBooleanExpression() {
+        return true;
+    }
 }


Mime
View raw message