Search in sources :

Example 26 with DeploymentBuilder

use of org.camunda.bpm.engine.repository.DeploymentBuilder in project camunda-bpm-platform by camunda.

the class RepositoryServiceTest method testDeleteDeploymentWithoutSkipIoMappings.

public void testDeleteDeploymentWithoutSkipIoMappings() {
    DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/repository/RepositoryServiceTest.testDeleteDeploymentSkipIoMappings.bpmn20.xml");
    String deploymentId = deploymentBuilder.deploy().getId();
    runtimeService.startProcessInstanceByKey("ioMappingProcess");
    // Try to delete the deployment
    try {
        repositoryService.deleteDeployment(deploymentId, true, false, false);
        fail("Exception expected");
    } catch (Exception e) {
        // Exception expected when deleting deployment with running process
        // assert (e.getMessage().contains("Exception when output mapping is executed"));
        assertTextPresent("Exception when output mapping is executed", e.getMessage());
    }
    repositoryService.deleteDeployment(deploymentId, true, false, true);
}
Also used : DeploymentBuilder(org.camunda.bpm.engine.repository.DeploymentBuilder) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) NotValidException(org.camunda.bpm.engine.exception.NotValidException) BadUserRequestException(org.camunda.bpm.engine.BadUserRequestException) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) IOException(java.io.IOException)

Aggregations

DeploymentBuilder (org.camunda.bpm.engine.repository.DeploymentBuilder)26 Test (org.junit.Test)14 Deployment (org.camunda.bpm.engine.repository.Deployment)11 InputStream (java.io.InputStream)10 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)10 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)8 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)4 IdentityLink (org.camunda.bpm.engine.task.IdentityLink)4 IOException (java.io.IOException)3 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)2 RepositoryService (org.camunda.bpm.engine.RepositoryService)2 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)2 NotValidException (org.camunda.bpm.engine.exception.NotValidException)2 Method (java.lang.reflect.Method)1 ZipInputStream (java.util.zip.ZipInputStream)1 Deployment (org.camunda.bpm.engine.test.Deployment)1 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)1 ByteArrayResource (org.springframework.core.io.ByteArrayResource)1 ContextResource (org.springframework.core.io.ContextResource)1