use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment 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.engine.repository.ProcessApplicationDeployment 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);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ScriptEngineCachingTest method testFetchScriptEngineFromPaEnableCaching.
public void testFetchScriptEngineFromPaEnableCaching() {
// then
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));
// cached in pa
assertEquals(engine, processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, true));
repositoryService.deleteDeployment(deployment.getId(), true);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ScriptEngineCachingTest method testFetchScriptEngineFromPaDisableCaching.
public void testFetchScriptEngineFromPaDisableCaching() {
// then
processEngineConfiguration.setEnableScriptEngineCaching(false);
getScriptingEngines().setEnableScriptEngineCaching(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);
assertFalse(engine.equals(getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication)));
// not cached in pa
assertFalse(engine.equals(processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, false)));
repositoryService.deleteDeployment(deployment.getId(), true);
processEngineConfiguration.setEnableScriptEngineCaching(true);
getScriptingEngines().setEnableScriptEngineCaching(true);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testPartialChangesResumePreviousVersionByDeploymentName.
public void testPartialChangesResumePreviousVersionByDeploymentName() {
BpmnModelInstance model1 = Bpmn.createExecutableProcess("process1").done();
BpmnModelInstance model2 = Bpmn.createExecutableProcess("process2").done();
// create initial deployment
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addModelInstance("process1.bpmn20.xml", model1).deploy();
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(true).resumePreviousVersions().resumePreviousVersionsBy(ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME).addModelInstance("process1.bpmn20.xml", model1).addModelInstance("process2.bpmn20.xml", model2).deploy();
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
assertEquals(2, registration.getDeploymentIds().size());
deleteDeployments(deployment1, deployment2);
}
Aggregations