use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class PostDeploymentServiceTest method testDuplicatedDeployment.
@Test
public void testDuplicatedDeployment() {
assertNotNull(deploymentService);
((KModuleDeploymentService) deploymentService).addListener(new DeploymentEventListener() {
@Override
public void onUnDeploy(DeploymentEvent event) {
}
@Override
public void onDeploy(DeploymentEvent event) {
throw new IllegalArgumentException("On purpose");
}
@Override
public void onActivate(DeploymentEvent event) {
}
@Override
public void onDeactivate(DeploymentEvent event) {
}
});
DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION, "KBase-test", "ksession-test");
try {
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
fail("Deployment should fail due to post process failuer - see ThrowExceptionOnDeploymentEvent");
} catch (RuntimeException e) {
}
DeployedUnit deployedGeneral = deploymentService.getDeployedUnit(deploymentUnit.getIdentifier());
assertNull(deployedGeneral);
assertFalse(RuntimeManagerRegistry.get().isRegistered(deploymentUnit.getIdentifier()));
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class TaskVariablesQueryServiceTest method cleanup.
@After
public void cleanup() {
cleanupSingletonSessionId();
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
deploymentService.undeploy(unit);
}
units.clear();
}
close();
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class BPMN2DataServicesTest method testObjectVariable.
@Test
public void testObjectVariable() throws IOException {
assertNotNull(deploymentService);
DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
String processId = "ObjectVariableProcess";
ProcessDefinition procDef = bpmn2Service.getProcessDefinition(deploymentUnit.getIdentifier(), processId);
assertNotNull(procDef);
assertEquals(procDef.getId(), "ObjectVariableProcess");
assertEquals(procDef.getName(), "ObjectVariableProcess");
assertEquals(procDef.getKnowledgeType(), "PROCESS");
assertEquals(procDef.getPackageName(), "defaultPackage");
assertEquals(procDef.getType(), "RuleFlow");
assertEquals(procDef.getVersion(), "1");
Map<String, String> processData = bpmn2Service.getProcessVariables(deploymentUnit.getIdentifier(), processId);
assertEquals("String", processData.get("type"));
assertEquals("Object", processData.get("myobject"));
assertEquals(2, processData.keySet().size());
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class BPMN2DataServicesTest method testFindReusableSubProcesses.
@Test
public void testFindReusableSubProcesses() {
assertNotNull(deploymentService);
DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
String theString = "ParentProcess";
assertNotNull(theString);
Collection<String> reusableProcesses = bpmn2Service.getReusableSubProcesses(deploymentUnit.getIdentifier(), theString);
assertNotNull(reusableProcesses);
assertEquals(1, reusableProcesses.size());
assertEquals("org.jbpm.signal", reusableProcesses.iterator().next());
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class BPMN2DataServicesTest method testGetProcessDefinitionInvalidProcessId.
@Test(expected = ProcessDefinitionNotFoundException.class)
public void testGetProcessDefinitionInvalidProcessId() throws IOException {
assertNotNull(deploymentService);
DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
bpmn2Service.getProcessDefinition(deploymentUnit.getIdentifier(), "org.jbpm.invalidId");
}
Aggregations