use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class EDeploymentTest method testUndeploy.
@Test
public void testUndeploy() {
DeploymentUnit basicKieJar = archive.deployBasicKieJar();
DeployedUnit deployed = deploymentService.getDeployedUnit(basicKieJar.getIdentifier());
Assertions.assertThat(deployed).isNotNull();
archive.undeployDeploymentUnit(basicKieJar);
DeployedUnit undeployed = deploymentService.getDeployedUnit(basicKieJar.getIdentifier());
Assertions.assertThat(undeployed).isNull();
}
use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.
the class ProcessServiceWithEntitiesTest 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 QueryServiceImplTest method cleanup.
@After
public void cleanup() {
System.clearProperty("org.jbpm.ht.callback");
System.clearProperty("org.jbpm.ht.custom.callback");
if (query != null) {
try {
queryService.unregisterQuery(query.getName());
} catch (QueryNotFoundException e) {
}
}
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 was already completed/aborted
}
}
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 RuntimeDataServiceImplTaskLookupTest method cleanup.
@After
public void cleanup() {
System.clearProperty("org.jbpm.ht.callback");
System.clearProperty("org.jbpm.ht.custom.callback");
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 was already completed/aborted
}
}
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 FilteredKModuleDeploymentServiceTest method testDeploymentOfProcessesFromOrderPackage.
@Test
public void testDeploymentOfProcessesFromOrderPackage() {
prepare("order.repo.processes.general");
assertNotNull(deploymentService);
DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION, "KBase-test", "ksession-test");
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
DeployedUnit deployed = deploymentService.getDeployedUnit(deploymentUnit.getIdentifier());
assertNotNull(deployed);
assertNotNull(deployed.getDeploymentUnit());
assertNotNull(deployed.getRuntimeManager());
assertEquals(GROUP_ID + ":" + ARTIFACT_ID + ":" + VERSION + ":" + "KBase-test" + ":" + "ksession-test", deployed.getDeploymentUnit().getIdentifier());
assertNotNull(runtimeDataService);
Collection<ProcessDefinition> processes = runtimeDataService.getProcesses(new QueryContext());
assertNotNull(processes);
assertEquals(1, processes.size());
processes = runtimeDataService.getProcessesByDeploymentId(deploymentUnit.getIdentifier(), new QueryContext());
assertNotNull(processes);
assertEquals(1, processes.size());
ProcessDefinition process = runtimeDataService.getProcessesByDeploymentIdProcessId(deploymentUnit.getIdentifier(), "Import");
assertNotNull(process);
}
Aggregations