Added the possibility to get unbounded instances using -1
This commit is contained in:
parent
38668d8a21
commit
9d9ec44b90
|
@ -517,7 +517,7 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
||||||
entityManagement.setAsEntryPoint();
|
entityManagement.setAsEntryPoint();
|
||||||
JsonNode jsonNode = entityManagement.serializeAsJsonNode();
|
JsonNode jsonNode = entityManagement.serializeAsJsonNode();
|
||||||
arrayNode.add(jsonNode);
|
arrayNode.add(jsonNode);
|
||||||
if(++count >= limit) {
|
if(limit > 0 && ++count >= limit) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch(ResourceRegistryException e) {
|
} catch(ResourceRegistryException e) {
|
||||||
|
|
|
@ -806,7 +806,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
|
||||||
oDatabaseDocument, edge);
|
oDatabaseDocument, edge);
|
||||||
// visitedSourceResources = relationManagement.fullSerialize(visitedSourceResources);
|
// visitedSourceResources = relationManagement.fullSerialize(visitedSourceResources);
|
||||||
serilizedEdges.add(relationManagement.serializeAsJsonNode());
|
serilizedEdges.add(relationManagement.serializeAsJsonNode());
|
||||||
if(++count >= limit) {
|
if(limit > 0 && ++count >= limit) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -739,7 +739,9 @@ public class ERManagementTest extends ContextTest {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLimitOffsetWithHostingNode() throws ResourceRegistryException, JsonParseException, JsonMappingException, IOException {
|
public void testLimitOffsetWithHostingNode() throws Exception {
|
||||||
|
setContextByName(GCUBE);
|
||||||
|
|
||||||
ServerRequestInfo requestInfo = RequestUtility.getRequestInfo().get();
|
ServerRequestInfo requestInfo = RequestUtility.getRequestInfo().get();
|
||||||
int limit = 2;
|
int limit = 2;
|
||||||
requestInfo.setLimit(limit);
|
requestInfo.setLimit(limit);
|
||||||
|
@ -803,6 +805,15 @@ public class ERManagementTest extends ContextTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requestInfo.setOffset(0);
|
||||||
|
requestInfo.setLimit(-1);
|
||||||
|
ret = resourceManagement.all(true);
|
||||||
|
logger.debug("{}", ret);
|
||||||
|
list = ElementMapper.unmarshalList(HostingNode.class, ret);
|
||||||
|
|
||||||
|
for(HostingNode hn : list) {
|
||||||
|
UUID uuid = hn.getID();
|
||||||
|
logger.debug("No limit listing: Got {} with UUID {}", HostingNode.NAME, uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue