cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: Test case when lowercase names used by DB
Date Mon, 02 Oct 2017 12:52:46 GMT
Repository: cayenne
Updated Branches:
  refs/heads/STABLE-4.0 c0c0cfa05 -> 1b945ae6c


Test case when lowercase names used by DB


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

Branch: refs/heads/STABLE-4.0
Commit: 1b945ae6cd7eb27932d9fad890ace0466309a537
Parents: c0c0cfa
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Mon Oct 2 15:52:41 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Mon Oct 2 15:52:41 2017 +0300

----------------------------------------------------------------------
 .../java/org/apache/cayenne/query/SQLExecIT.java    | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/1b945ae6/cayenne-server/src/test/java/org/apache/cayenne/query/SQLExecIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLExecIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLExecIT.java
index 6da090b..4591022 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SQLExecIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SQLExecIT.java
@@ -26,6 +26,7 @@ import org.apache.cayenne.QueryResult;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.test.jdbc.DBHelper;
+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 SQLExecIT extends ServerCase {
     @Inject
     private DBHelper dbHelper;
 
+    @Inject
+    private UnitDbAdapter unitDbAdapter;
+
     @Test
     public void test_DataMapNameRoot() throws Exception {
         int inserted = SQLExec.query("testmap", "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME)
VALUES (1, 'a')").update(
@@ -74,8 +78,16 @@ public class SQLExecIT extends ServerCase {
         assertEquals(1, result.firstList().size());
 
         DataRow row = (DataRow)result.firstList().get(0);
-        assertEquals(1L, row.get("ARTIST_ID"));
-        assertEquals("a", row.get("ARTIST_NAME"));
+
+        if(unitDbAdapter.isLowerCaseNames()) {
+            assertTrue(row.containsKey("artist_id"));
+            assertEquals(1L, row.get("artist_id"));
+            assertEquals("a", row.get("artist_name"));
+        } else {
+            assertTrue(row.containsKey("ARTIST_ID"));
+            assertEquals(1L, row.get("ARTIST_ID"));
+            assertEquals("a", row.get("ARTIST_NAME"));
+        }
     }
 
     @Test


Mime
View raw message