use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.
the class RedeploymentTest method testRedeployProcessApplicationDeploymentResumePreviousVersions.
public void testRedeployProcessApplicationDeploymentResumePreviousVersions() {
// given
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
// first deployment
BpmnModelInstance model = createProcessWithServiceTask(PROCESS_KEY);
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name(DEPLOYMENT_NAME).addModelInstance(RESOURCE_NAME, model).enableDuplicateFiltering(true).deploy();
Resource resource1 = getResourceByName(deployment1.getId(), RESOURCE_NAME);
// second deployment
model = createProcessWithUserTask(PROCESS_KEY);
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(DEPLOYMENT_NAME).addModelInstance(RESOURCE_NAME, model).enableDuplicateFiltering(true).deploy();
// when
ProcessApplicationDeployment deployment3 = repositoryService.createDeployment(processApplication.getReference()).name(DEPLOYMENT_NAME).resumePreviousVersions().addDeploymentResourceById(deployment1.getId(), resource1.getId()).deploy();
// then
// old deployments was resumed
ProcessApplicationRegistration registration = deployment3.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(3, deploymentIds.size());
deleteDeployments(deployment1, deployment2, deployment3);
}
use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.
the class EnvScriptCachingTest method testDisabledPaEnvScriptCaching.
public void testDisabledPaEnvScriptCaching() {
// given
processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(false);
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
// when
executeScript(processApplication);
// then
Map<String, List<ExecutableScript>> environmentScripts = processApplication.getEnvironmentScripts();
assertNotNull(environmentScripts);
assertNull(environmentScripts.get(SCRIPT_LANGUAGE));
repositoryService.deleteDeployment(deployment.getId(), true);
processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(true);
}
use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.
the class ScriptEngineCachingTest method testDisableFetchScriptEngineFromProcessApplication.
public void testDisableFetchScriptEngineFromProcessApplication() {
// when
processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(false);
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
// when
ScriptEngine engine = getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication);
// then
assertNotNull(engine);
assertEquals(engine, getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication));
// not cached in pa
assertFalse(engine.equals(processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, true)));
repositoryService.deleteDeployment(deployment.getId(), true);
processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(true);
}
use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.
the class ScriptEngineCachingTest method testDisableCachingOfScriptEngineInProcessApplication.
public void testDisableCachingOfScriptEngineInProcessApplication() {
// given
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
// when
ScriptEngine engine = processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, false);
// then
assertNotNull(engine);
assertFalse(engine.equals(processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, false)));
}
use of org.camunda.bpm.application.impl.EmbeddedProcessApplication in project camunda-bpm-platform by camunda.
the class EnvScriptCachingTest method testEnabledPaEnvScriptCaching.
public void testEnabledPaEnvScriptCaching() {
// given
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
// when
executeScript(processApplication);
// then
Map<String, List<ExecutableScript>> environmentScripts = processApplication.getEnvironmentScripts();
assertNotNull(environmentScripts);
List<ExecutableScript> groovyEnvScripts = environmentScripts.get(SCRIPT_LANGUAGE);
assertNotNull(groovyEnvScripts);
assertFalse(groovyEnvScripts.isEmpty());
assertEquals(processEngineConfiguration.getEnvScriptResolvers().size(), groovyEnvScripts.size());
repositoryService.deleteDeployment(deployment.getId(), true);
}
Aggregations