use of org.jbpm.services.api.ListenerSupport 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.services.api.ListenerSupport in project jbpm by kiegroup.
the class DeploymentServiceWithSyncTest method configureListener.
protected CoundDownDeploymentListener configureListener(int threads, boolean deploy, boolean undeploy, boolean activate, boolean deactivate) {
CoundDownDeploymentListener countDownListener = new CoundDownDeploymentListener(threads);
((ListenerSupport) deploymentService).addListener(countDownListener);
return countDownListener;
}
use of org.jbpm.services.api.ListenerSupport in project jbpm by kiegroup.
the class DeploymentServiceEJBWithSyncIntegrationTest method configureListener.
protected CoundDownDeploymentListener configureListener(int threads) {
CoundDownDeploymentListener countDownListener = new CoundDownDeploymentListener(threads);
((ListenerSupport) deploymentService).addListener(countDownListener);
return countDownListener;
}
Aggregations