use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeploymentServiceEJBWithSyncIntegrationTest method testDeploymentOfProcessesBySync.
@Test
public void testDeploymentOfProcessesBySync() throws Exception {
CoundDownDeploymentListener countDownListener = configureListener(1);
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);
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 testDeactivateAndActivateOfProcessesBySync.
@Test
public void testDeactivateAndActivateOfProcessesBySync() throws Exception {
CoundDownDeploymentListener countDownListener = configureListener(2, false, false, true, true);
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());
assertTrue(deployed.iterator().next().isActive());
store.deactivateDeploymentUnit(unit);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
assertFalse(deployed.iterator().next().isActive());
store.activateDeploymentUnit(unit);
countDownListener.reset(1);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
assertTrue(deployed.iterator().next().isActive());
}
use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener 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.kie.services.test.objects.CoundDownDeploymentListener 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;
}
use of org.jbpm.kie.services.test.objects.CoundDownDeploymentListener in project jbpm by kiegroup.
the class DeploymentServiceEJBWithSyncIntegrationTest method testDeactivateAndActivateOfProcessesBySync.
@Test
public void testDeactivateAndActivateOfProcessesBySync() 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());
assertTrue(deployed.iterator().next().isActive());
store.deactivateDeploymentUnit(unit);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
assertFalse(deployed.iterator().next().isActive());
store.activateDeploymentUnit(unit);
countDownListener.reset(1);
countDownListener.waitTillCompleted(10000);
deployed = deploymentService.getDeployedUnits();
assertNotNull(deployed);
assertEquals(1, deployed.size());
assertTrue(deployed.iterator().next().isActive());
}
Aggregations