use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByVersion.
public void testQueryByVersion() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionVersion(2);
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionVersion(1);
verifyQueryResults(query, 2);
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByLatest.
public void testQueryByLatest() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().latestVersion();
verifyQueryResults(query, 2);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").latestVersion();
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("two").latestVersion();
verifyQueryResults(query, 1);
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByDeploymentId.
public void testQueryByDeploymentId() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentOneId);
verifyQueryResults(query, 2);
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByInvalidKeyLike.
public void testQueryByInvalidKeyLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike("%invalid%");
verifyQueryResults(query, 0);
try {
repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike(null);
fail();
} catch (ActivitiIllegalArgumentException e) {
}
}
use of org.activiti.engine.repository.ProcessDefinitionQuery in project Activiti by Activiti.
the class ProcessDefinitionQueryTest method testQueryByInvalidVersion.
public void testQueryByInvalidVersion() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionVersion(3);
verifyQueryResults(query, 0);
try {
repositoryService.createProcessDefinitionQuery().processDefinitionVersion(-1).list();
fail();
} catch (ActivitiIllegalArgumentException e) {
}
try {
repositoryService.createProcessDefinitionQuery().processDefinitionVersion(null).list();
fail();
} catch (ActivitiIllegalArgumentException e) {
}
}
Aggregations