cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1563386 - in /cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query: ClientExpressionTest.java ClientSelectQueryExpressionTest.java
Date Sat, 01 Feb 2014 10:07:03 GMT
Author: aadamchik
Date: Sat Feb  1 10:07:03 2014
New Revision: 1563386

URL: http://svn.apache.org/r1563386
Log:
CAY-1796 ROP: All entity's to-many relationships getting faulted from database when using
it as a parameter in qualifier expression

fixing unit tests for DBs other than H2 - per Oleg Artyukevich

Modified:
    cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientExpressionTest.java
    cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientSelectQueryExpressionTest.java

Modified: cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientExpressionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientExpressionTest.java?rev=1563386&r1=1563385&r2=1563386&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientExpressionTest.java
(original)
+++ cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientExpressionTest.java
Sat Feb  1 10:07:03 2014
@@ -33,8 +33,8 @@ public class ClientExpressionTest extend
     
     @Override
     protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("MT_TABLE1");
         dbHelper.deleteAll("MT_TABLE2");
+        dbHelper.deleteAll("MT_TABLE1");
         
         tMtTable1 = new TableHelper(dbHelper, "MT_TABLE1");
         tMtTable1.setColumns("TABLE1_ID", "GLOBAL_ATTRIBUTE1", "SERVER_ATTRIBUTE1");
@@ -127,6 +127,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable1> table1Query = new SelectQuery<ClientMtTable1>(ClientMtTable1.class);
+        table1Query.addOrdering(new Ordering("db:TABLE1_ID", SortOrder.ASCENDING));
         List<ClientMtTable1> table1List = context.select(table1Query);
         
         assertNotNull(table1List);
@@ -153,6 +154,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable2> table2Query = new SelectQuery<ClientMtTable2>(ClientMtTable2.class);
+        table2Query.addOrdering(new Ordering("db:TABLE2_ID", SortOrder.ASCENDING));
         List<ClientMtTable2> table2List = context.select(table2Query);
         
         ClientMtTable2 element_1 = table2List.get(0);
@@ -171,6 +173,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable2> table2Query = new SelectQuery<ClientMtTable2>(ClientMtTable2.class);
+        table2Query.addOrdering(new Ordering("db:TABLE2_ID", SortOrder.ASCENDING));
         List<ClientMtTable2> table2List = context.select(table2Query);
         
         ClientMtTable2 element_1 = table2List.get(0);
@@ -187,6 +190,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable1> table1Query = new SelectQuery<ClientMtTable1>(ClientMtTable1.class);
+        table1Query.addOrdering(new Ordering("db:TABLE1_ID", SortOrder.ASCENDING));
         List<ClientMtTable1> table1List = context.select(table1Query);
         
         ClientMtTable1 element_3 = table1List.get(2);
@@ -211,6 +215,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable1> table1Query = new SelectQuery<ClientMtTable1>(ClientMtTable1.class);
+        table1Query.addOrdering(new Ordering("db:TABLE1_ID", SortOrder.ASCENDING));
         List<ClientMtTable1> table1List = context.select(table1Query);
         
         ClientMtTable1 element_1 = table1List.get(0);
@@ -228,10 +233,6 @@ public class ClientExpressionTest extend
         table2Query = new SelectQuery<ClientMtTable2>(ClientMtTable2.class, exp);
         table2List = context.select(table2Query);
         
-        Object op2 = exp.getOperand(1);
-        Object op3 = exp.getOperand(2);
-        assertEquals(element_1.getObjectId(), op2);
-        assertEquals(element_7.getObjectId(), op3);
         assertEquals(6, table2List.size());
     }
     
@@ -239,6 +240,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable1> table1Query = new SelectQuery<ClientMtTable1>(ClientMtTable1.class);
+        table1Query.addOrdering(new Ordering("db:TABLE1_ID", SortOrder.ASCENDING));
         List<ClientMtTable1> table1List = context.select(table1Query);
         
         ClientMtTable1 element_7 = table1List.get(6);
@@ -276,6 +278,7 @@ public class ClientExpressionTest extend
         createDataSet();
         
         SelectQuery<ClientMtTable1> table1Query = new SelectQuery<ClientMtTable1>(ClientMtTable1.class);
+        table1Query.addOrdering(new Ordering("db:TABLE1_ID", SortOrder.ASCENDING));
         List<ClientMtTable1> table1List = context.select(table1Query);
         
         ClientMtTable1 element_1 = table1List.get(0);

Modified: cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientSelectQueryExpressionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientSelectQueryExpressionTest.java?rev=1563386&r1=1563385&r2=1563386&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientSelectQueryExpressionTest.java
(original)
+++ cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/ClientSelectQueryExpressionTest.java
Sat Feb  1 10:07:03 2014
@@ -43,6 +43,7 @@ public class ClientSelectQueryExpression
 
     @Override
     protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("MT_TABLE2");
         dbHelper.deleteAll("MT_TABLE1");
 
         tMtTable1 = new TableHelper(dbHelper, "MT_TABLE1");



Mime
View raw message