mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
99763: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 99694: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2) 99487: Merged DEV to V4.2-BUG-FIX (4.2.5) 99401: MNT-13567: [Workflow Public API] : incorrect hasMoreItems value - Comparison operator was changed to take in account SkipCount > totalItems condition. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@100490 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -65,7 +65,7 @@ public class DeploymentsImpl extends WorkflowRestImpl implements Deployments
|
||||
page.add(new Deployment(deployment));
|
||||
}
|
||||
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, page.size() != totalCount, totalCount);
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) < totalCount, totalCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -232,7 +232,7 @@ public class ProcessDefinitionsImpl extends WorkflowRestImpl implements ProcessD
|
||||
page.add(createProcessDefinitionRest((ProcessDefinitionEntity) processDefinition));
|
||||
}
|
||||
|
||||
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), page, page.size() != totalCount, totalCount);
|
||||
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), page, (page.size() + parameters.getPaging().getSkipCount()) < totalCount, totalCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -496,7 +496,7 @@ public class ProcessesImpl extends WorkflowRestImpl implements Processes
|
||||
page.add(processInfo);
|
||||
}
|
||||
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) != totalCount, totalCount);
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) < totalCount, totalCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -596,7 +596,7 @@ public class TasksImpl extends WorkflowRestImpl implements Tasks
|
||||
throw new InvalidArgumentException("Invalid status parameter: " + status);
|
||||
}
|
||||
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, page.size() != totalCount, totalCount);
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) < totalCount, totalCount);
|
||||
}
|
||||
|
||||
protected void addVariables(Task task, Boolean includeProcessVariables, Boolean includeTaskVariables,
|
||||
@@ -705,7 +705,7 @@ public class TasksImpl extends WorkflowRestImpl implements Tasks
|
||||
throw new InvalidArgumentException("Invalid status parameter: " + status);
|
||||
}
|
||||
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, page.size() != totalCount, totalCount);
|
||||
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) < totalCount, totalCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -171,6 +171,16 @@ public class ProcessesImplTest extends TestCase
|
||||
CollectionWithPagingInfo<ProcessInfo> actualProcesses = queryActiveProcessesAndAssertResult(5, ACTIVE_WORKFLOWS_INITIAL_AMOUNT);
|
||||
assertFalse(actualProcesses.hasMoreItems());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHasMoreFalseAsPerMnt13567() throws Exception
|
||||
{
|
||||
CollectionWithPagingInfo<ProcessInfo> actualProcesses = queryActiveProcessesAndAssertResult(ACTIVE_WORKFLOWS_INITIAL_AMOUNT, ACTIVE_WORKFLOWS_INITIAL_AMOUNT);
|
||||
assertFalse(actualProcesses.hasMoreItems());
|
||||
|
||||
actualProcesses = queryActiveProcessesAndAssertResult(ACTIVE_WORKFLOWS_INITIAL_AMOUNT + 1, ACTIVE_WORKFLOWS_INITIAL_AMOUNT);
|
||||
assertFalse(actualProcesses.hasMoreItems());
|
||||
}
|
||||
|
||||
private CollectionWithPagingInfo<ProcessInfo> queryActiveProcessesAndAssertResult(int skipCount, int maxItems)
|
||||
{
|
||||
@@ -182,7 +192,7 @@ public class ProcessesImplTest extends TestCase
|
||||
assertNotNull(result);
|
||||
assertNotNull(result.getCollection());
|
||||
|
||||
int remainingProcessesAmount = ACTIVE_WORKFLOWS_INITIAL_AMOUNT - skipCount;
|
||||
int remainingProcessesAmount = skipCount > ACTIVE_WORKFLOWS_INITIAL_AMOUNT ? 0 : ACTIVE_WORKFLOWS_INITIAL_AMOUNT - skipCount;
|
||||
if (maxItems >= remainingProcessesAmount)
|
||||
{
|
||||
assertEquals(remainingProcessesAmount, result.getCollection().size());
|
||||
|
Reference in New Issue
Block a user