cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject cayenne git commit: fix ClientObjectSelectIT;
Date Wed, 25 May 2016 09:58:52 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 4937cd00f -> 917928f55


fix ClientObjectSelectIT;


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

Branch: refs/heads/master
Commit: 917928f55019c7e78ebf6fed1844c6e353a69785
Parents: 4937cd0
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Wed May 25 12:50:28 2016 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Wed May 25 12:50:54 2016 +0300

----------------------------------------------------------------------
 .../cayenne/query/ClientObjectSelectIT.java     | 38 +++++++++++++-------
 1 file changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/917928f5/cayenne-client/src/test/java/org/apache/cayenne/query/ClientObjectSelectIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/query/ClientObjectSelectIT.java
b/cayenne-client/src/test/java/org/apache/cayenne/query/ClientObjectSelectIT.java
index f1f7e7a..e328dd6 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/query/ClientObjectSelectIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/query/ClientObjectSelectIT.java
@@ -82,6 +82,7 @@ public class ClientObjectSelectIT extends ClientCase {
         assertFalse(list1.isEmpty());
 
         serverCaseDataChannelInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
+            @Override
             public void execute() {
                 List<ClientMtTable1> list2 = objectSelect.select(context);
                 assertNotNull(list2);
@@ -93,10 +94,10 @@ public class ClientObjectSelectIT extends ClientCase {
 
     @Test
     public void testLimitSelect() throws Exception{
-        List<ClientMtTable1> list = ObjectSelect.query(ClientMtTable1.class).
-                offset(5).
-                limit(10).
-                select(context);
+        List<ClientMtTable1> list = ObjectSelect.query(ClientMtTable1.class)
+                .offset(5)
+                .limit(10)
+                .select(context);
 
         assertNotNull(list);
         assertEquals(10, list.size());
@@ -104,15 +105,16 @@ public class ClientObjectSelectIT extends ClientCase {
 
     @Test
     public void testCacheLimitSelect() throws Exception {
-        final ObjectSelect objectSelect = ObjectSelect.query(ClientMtTable1.class).
-                cacheStrategy(QueryCacheStrategy.SHARED_CACHE).
-                offset(5).
-                limit(10);
+        final ObjectSelect objectSelect = ObjectSelect.query(ClientMtTable1.class)
+                .cacheStrategy(QueryCacheStrategy.SHARED_CACHE)
+                .offset(5)
+                .limit(10);
 
         final List<ClientMtTable1> list1 = objectSelect.select(context);
         assertEquals(10, list1.size());
 
         serverCaseDataChannelInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
+            @Override
             public void execute() {
                 List<ClientMtTable1> list2 = objectSelect.select(context);
                 assertNotNull(list2);
@@ -124,14 +126,24 @@ public class ClientObjectSelectIT extends ClientCase {
 
     @Test
     public void testPageSelect() throws Exception{
-        final ObjectSelect objectSelect = ObjectSelect.query(ClientMtTable1.class).
-                pageSize(5);
+        final ObjectSelect objectSelect = ObjectSelect.query(ClientMtTable1.class)
+                .pageSize(5);
 
-        List<ClientMtTable1> list = objectSelect.select(context);
+        final List<ClientMtTable1> list = objectSelect.select(context);
         assertNotNull(list);
         assertEquals(RemoteIncrementalFaultList.class, list.getClass());
-        assertEquals("globalAttr1", list.get(0).getGlobalAttribute1Direct());
-        assertEquals("globalAttr6", list.get(5).getGlobalAttribute1Direct());
+
+        int count = serverCaseDataChannelInterceptor.runWithQueryCounter(new UnitTestClosure()
{
+            @Override
+            public void execute() {
+                assertNotNull(list.get(0));
+                assertNotNull(list.get(4));
+                assertNotNull(list.get(5));
+                assertNotNull(list.get(6));
+            }
+        });
+
+        assertEquals(1, count);
     }
 
 }


Mime
View raw message