chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1367758 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/server/ test/java/org/apache/chemistry/opencmis/inmemory/
Date Tue, 31 Jul 2012 20:27:51 GMT
Author: jens
Date: Tue Jul 31 20:27:51 2012
New Revision: 1367758

URL: http://svn.apache.org/viewvc?rev=1367758&view=rev
Log:
InMemory: calculate hasMoreitems for getChildren

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java?rev=1367758&r1=1367757&r2=1367758&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
Tue Jul 31 20:27:51 2012
@@ -124,6 +124,7 @@ public class InMemoryNavigationServiceIm
         }
         res.setObjects(odList);
         res.setNumItems(BigInteger.valueOf(odList.size()));
+        res.setHasMoreItems(false);
 
         LOG.debug("end getCheckedOutDocs()");
         return res;
@@ -319,6 +320,8 @@ public class InMemoryNavigationServiceIm
         }
         result.setObjects(folderList);
         result.setNumItems(BigInteger.valueOf(children.getNoItems()));
+        result.setHasMoreItems(children.getNoItems() > skipCount + folderList.size());
+
         if (objectInfos != null) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
             fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java?rev=1367758&r1=1367757&r2=1367758&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java
Tue Jul 31 20:27:51 2012
@@ -19,6 +19,7 @@
 package org.apache.chemistry.opencmis.inmemory;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -224,6 +225,7 @@ public class NavigationServiceTest exten
         }
         assertEquals(3, files.size());
         assertEquals(BigInteger.valueOf(10), result.getNumItems());
+        assertTrue(result.hasMoreItems());
 
         // get second page
         maxItems = BigInteger.valueOf(3);
@@ -237,6 +239,7 @@ public class NavigationServiceTest exten
         }
         assertEquals(3, files.size());
         assertEquals(BigInteger.valueOf(10), result.getNumItems());
+        assertTrue(result.hasMoreItems());
       
         // get third page
         maxItems = BigInteger.valueOf(3);
@@ -250,6 +253,7 @@ public class NavigationServiceTest exten
         }
         assertEquals(1, files.size());
         assertEquals(BigInteger.valueOf(10), result.getNumItems());
+        assertFalse(result.hasMoreItems());
         log.info("... testGetPaging() finished.");
         
     }



Mime
View raw message