use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class DeploymentStoreTest method testEnableAndGetActiveDeployments.
@Test
public void testEnableAndGetActiveDeployments() {
Collection<DeploymentUnit> enabled = store.getEnabledDeploymentUnits();
assertNotNull(enabled);
assertEquals(0, enabled.size());
KModuleDeploymentUnit unit = new KModuleDeploymentUnit("org.jbpm", "test", "1.0");
store.enableDeploymentUnit(unit);
enabled = store.getEnabledDeploymentUnits();
assertNotNull(enabled);
assertEquals(1, enabled.size());
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class ProcessInstanceAdminServiceImplTest method cleanup.
@After
public void cleanup() {
cleanupSingletonSessionId();
if (processInstanceId != null) {
try {
// let's abort process instance to leave the system in clear state
processService.abortProcessInstance(processInstanceId);
ProcessInstance pi = processService.getProcessInstance(processInstanceId);
assertNull(pi);
} catch (ProcessInstanceNotFoundException e) {
// ignore it as it might already be completed/aborted
}
}
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
try {
deploymentService.undeploy(unit);
} catch (Exception e) {
// do nothing in case of some failed tests to avoid next test to fail as well
}
}
units.clear();
}
close();
CountDownListenerFactory.clear();
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class ProcessInstanceMigrationServiceImplTest method cleanup.
@After
public void cleanup() {
cleanupSingletonSessionId();
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
try {
deploymentService.undeploy(unit);
} catch (Exception e) {
// do nothing in case of some failed tests to avoid next test to fail as well
}
}
units.clear();
}
close();
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class BPMN2DataServicesReferencesTest method cleanup.
@After
public void cleanup() {
for (long procInstId : procInstIds) {
try {
processService.abortProcessInstance(procInstId);
} catch (Exception e) {
// ignore if it fails..
}
}
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 testHumanTaskProcessBeforeAndAfterUndeploy.
@Test
public void testHumanTaskProcessBeforeAndAfterUndeploy() throws IOException {
assertNotNull(deploymentService);
DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
String processId = "org.jbpm.writedocument";
ProcessDefinition procDef = bpmn2Service.getProcessDefinition(deploymentUnit.getIdentifier(), processId);
assertNotNull(procDef);
assertEquals(procDef.getId(), "org.jbpm.writedocument");
assertEquals(procDef.getName(), "humanTaskSample");
assertEquals(procDef.getKnowledgeType(), "PROCESS");
assertEquals(procDef.getPackageName(), "defaultPackage");
assertEquals(procDef.getType(), "RuleFlow");
assertEquals(procDef.getVersion(), "3");
// now let's undeploy the unit
deploymentService.undeploy(deploymentUnit);
try {
bpmn2Service.getProcessDefinition(deploymentUnit.getIdentifier(), processId);
fail("DeploymentNotFoundException was not thrown");
} catch (DeploymentNotFoundException e) {
// expected
}
}
Aggregations