use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeploymentServiceWithSyncTest method testDeploymentOfProcessesBySyncWithDisabledAttribute.
@Test
public void testDeploymentOfProcessesBySyncWithDisabledAttribute() throws Exception {
CoundDownDeploymentListener countDownListener = configureListener(1, true, false, false, false);
Collection<DeployedUnit> deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
KModuleDeploymentUnit unit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
unit.addAttribute("sync", "false");
store.enableDeploymentUnit(unit);
units.add(unit);
countDownListener.waitTillCompleted(4000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
}
use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeactivateDeploymentServiceWithSyncTest method testDeactivateDeploymentBySync.
@Test
public void testDeactivateDeploymentBySync() throws Exception {
Collection<DeployedUnit> deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
KModuleDeploymentUnit unit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(unit);
deploymentService.deactivate(unit.getIdentifier());
((KModuleDeploymentService) deploymentService).shutdown();
sync.clear();
AtomicBoolean deploymentActive = new AtomicBoolean(true);
CoundDownDeploymentListener countDownListener = new CoundDownDeploymentListener(1) {
@Override
public void onDeploy(DeploymentEvent event) {
// This used to use a specific listener for setting the active state
deploymentActive.set(event.getDeployedUnit().isActive());
super.onDeploy(event);
}
};
countDownListener.setDeploy(true);
((ListenerSupport) deploymentService).addListener(countDownListener);
invoker.start();
countDownListener.waitTillCompleted();
assertFalse("Deployment should be deactivated", deploymentActive.get());
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
}
use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeploymentServiceWithSyncTest method testDeploymentOfProcessesBySync.
@Test
public void testDeploymentOfProcessesBySync() throws Exception {
CoundDownDeploymentListener countDownListener = configureListener(1, true, false, false, false);
Collection<DeployedUnit> deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
KModuleDeploymentUnit unit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
store.enableDeploymentUnit(unit);
units.add(unit);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
}
use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeploymentServiceWithSyncTest method testUndeploymentOfProcessesBySync.
@Test
public void testUndeploymentOfProcessesBySync() throws Exception {
CoundDownDeploymentListener countDownListener = configureListener(1, false, true, false, false);
Collection<DeployedUnit> deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
KModuleDeploymentUnit unit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(unit);
units.add(unit);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
countDownListener.waitTillCompleted(1000);
store.disableDeploymentUnit(unit);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
}
use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeploymentServiceEJBWithSyncIntegrationTest method testUndeploymentOfProcessesBySync.
@Test
public void testUndeploymentOfProcessesBySync() throws Exception {
CoundDownDeploymentListener countDownListener = configureListener(2);
DeploymentStore store = new DeploymentStore();
store.setCommandService(commandService);
Collection<DeployedUnit> deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
KModuleDeploymentUnit unit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
deploymentService.deploy(unit);
units.add(unit);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
countDownListener.waitTillCompleted(1000);
store.disableDeploymentUnit(unit);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(0, deployed.size());
}
Aggregations