use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByLatestAndName_NotFound.
public void testQueryByLatestAndName_NotFound() {
String firstDeployment = repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/repository/first-process.bpmn20.xml").deploy().getId();
String secondDeployment = repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/repository/second-process.bpmn20.xml").deploy().getId();
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
query.processDefinitionName("First Test Process").latestVersion();
verifyQueryResults(query, 0);
repositoryService.deleteDeployment(firstDeployment, true);
repositoryService.deleteDeployment(secondDeployment, true);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByNameLikeCaseInsensitive.
/**
* CAM-8014
*
* Verify that search by name like returns results with case-insensitive
*/
public void testQueryByNameLikeCaseInsensitive() {
ProcessDefinitionQuery queryCaseInsensitive = repositoryService.createProcessDefinitionQuery().processDefinitionNameLike("%OnE%");
verifyQueryResults(queryCaseInsensitive, 2);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByName.
public void testQueryByName() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionName("Two");
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionName("One");
verifyQueryResults(query, 2);
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByInvalidKeyLike.
public void testQueryByInvalidKeyLike() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike("%invalid%");
verifyQueryResults(query, 0);
try {
repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike(null);
fail();
} catch (ProcessEngineException e) {
// Expected Exception
}
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByKeyAndVersion.
public void testQueryByKeyAndVersion() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").processDefinitionVersion(1);
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").processDefinitionVersion(2);
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").processDefinitionVersion(3);
verifyQueryResults(query, 0);
}
Aggregations