use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class CaseDefinitionQueryTest method testQueryByInvalidName.
public void testQueryByInvalidName() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
query.caseDefinitionName("invalid");
verifyQueryResults(query, 0);
try {
query.caseDefinitionName(null);
fail();
} catch (NotValidException e) {
// Expected exception
}
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testGetCaseModel.
@Deployment(resources = { "org/camunda/bpm/engine/test/repository/one.cmmn" })
public void testGetCaseModel() throws Exception {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
CaseDefinition caseDefinition = query.singleResult();
String caseDefinitionId = caseDefinition.getId();
InputStream caseModel = repositoryService.getCaseModel(caseDefinitionId);
assertNotNull(caseModel);
byte[] readInputStream = IoUtil.readInputStream(caseModel, "caseModel");
String model = new String(readInputStream, "UTF-8");
assertTrue(model.contains("<case id=\"one\" name=\"One\">"));
IoUtil.closeSilently(caseModel);
}
Aggregations