fail();
} catch (NotValidException e) {}
}
public void testQuerySorting() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
// asc
query
.orderByCaseDefinitionId()
.asc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
query
.orderByDeploymentId()
.asc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
query
.orderByCaseDefinitionKey()
.asc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
query
.orderByCaseDefinitionVersion()
.asc();
verifyQueryResults(query, 3);
// desc
query = repositoryService.createCaseDefinitionQuery();
query
.orderByCaseDefinitionId()
.desc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
query
.orderByDeploymentId()
.desc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
query
.orderByCaseDefinitionKey()
.desc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
query
.orderByCaseDefinitionVersion()
.desc();
verifyQueryResults(query, 3);
query = repositoryService.createCaseDefinitionQuery();
// Typical use case
query
.orderByCaseDefinitionKey()
.asc()
.orderByCaseDefinitionVersion()
.desc();
List<CaseDefinition> caseDefinitions = query.list();
assertEquals(3, caseDefinitions.size());
assertEquals("one", caseDefinitions.get(0).getKey());
assertEquals(2, caseDefinitions.get(0).getVersion());
assertEquals("one", caseDefinitions.get(1).getKey());