Search in sources :

Example 11 with Deployment

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()));
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 12 with Deployment

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));
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 13 with Deployment

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));
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 14 with Deployment

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();
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment)

Example 15 with Deployment

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());
}
Also used : Resource(org.camunda.bpm.engine.repository.Resource) Deployment(org.camunda.bpm.engine.repository.Deployment) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment)

Aggregations

Deployment (org.camunda.bpm.engine.repository.Deployment)137 Test (org.junit.Test)62 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)39 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)36 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)19 Resource (org.camunda.bpm.engine.repository.Resource)19 InputStream (java.io.InputStream)14 DeploymentBuilder (org.camunda.bpm.engine.repository.DeploymentBuilder)11 DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)11 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)10 UserOperationLogQuery (org.camunda.bpm.engine.history.UserOperationLogQuery)10 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)10 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)9 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)8 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)8 RepositoryService (org.camunda.bpm.engine.RepositoryService)4 Job (org.camunda.bpm.engine.runtime.Job)4 Response (com.jayway.restassured.response.Response)3 HashMap (java.util.HashMap)2 Authorization (org.camunda.bpm.engine.authorization.Authorization)2