use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class RedeploymentRegistrationTest method registrationFoundByDeploymentId.
@Test
public void registrationFoundByDeploymentId() {
// given
ProcessApplicationReference reference1 = processApplication.getReference();
Deployment deployment1 = repositoryService.createDeployment(reference1).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy();
assertEquals(reference1, getProcessApplicationForDeployment(deployment1.getId()));
// when
ProcessApplicationReference reference2 = processApplication.getReference();
Deployment deployment2 = repositoryService.createDeployment(reference2).name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.getId()).deploy();
// then
assertEquals(reference2, getProcessApplicationForDeployment(deployment2.getId()));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class RedeploymentRegistrationTest method registrationFoundOnlyForOneProcessDefinition.
@Test
public void registrationFoundOnlyForOneProcessDefinition() {
// given
// first deployment
Deployment deployment1 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addClasspathResource(resource1).addClasspathResource(resource2).deploy();
// second deployment
ProcessApplicationReference reference2 = processApplication.getReference();
repositoryService.createDeployment(reference2).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy();
// when
repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.getId()).deploy();
String firstDefinitionId = getLatestDefinitionIdByKey(definitionKey1);
String secondDefinitionId = getLatestDefinitionIdByKey(definitionKey2);
// then
assertEquals(reference2, getProcessApplicationForDefinition(firstDefinitionId));
assertNull(getProcessApplicationForDefinition(secondDefinitionId));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class RedeploymentRegistrationTest method registrationFoundAfterDiscardingDeploymentCache.
@Test
public void registrationFoundAfterDiscardingDeploymentCache() {
// given
// first deployment
Deployment deployment1 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy();
// second deployment
ProcessApplicationReference reference2 = processApplication.getReference();
repositoryService.createDeployment(reference2).name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.getId()).deploy();
// when (1)
// third deployment
repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.getId()).deploy();
String firstDefinitionId = getLatestDefinitionIdByKey(definitionKey1);
// then (1)
assertEquals(reference2, getProcessApplicationForDefinition(firstDefinitionId));
// when (2)
discardDefinitionCache();
// then (2)
assertEquals(reference2, getProcessApplicationForDefinition(firstDefinitionId));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class EmbeddedProcessApplicationTest method testDeploymentSourceProperty.
public void testDeploymentSourceProperty() {
registerProcessEngine();
TestApplicationWithResources processApplication = new TestApplicationWithResources();
processApplication.deploy();
Deployment deployment = repositoryService.createDeploymentQuery().singleResult();
assertNotNull(deployment);
assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deployment.getSource());
processApplication.undeploy();
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class EmbeddedProcessApplicationTest method testDeployAppWithResources.
public void testDeployAppWithResources() {
registerProcessEngine();
TestApplicationWithResources processApplication = new TestApplicationWithResources();
processApplication.deploy();
Deployment deployment = repositoryService.createDeploymentQuery().singleResult();
assertNotNull(deployment);
List<Resource> deploymentResources = repositoryService.getDeploymentResources(deployment.getId());
assertEquals(4, deploymentResources.size());
processApplication.undeploy();
assertEquals(0, repositoryService.createDeploymentQuery().count());
}
Aggregations