use of org.jbpm.kie.services.impl.store.DeploymentStore 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());
}
use of org.jbpm.kie.services.impl.store.DeploymentStore 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.impl.store.DeploymentStore in project jbpm by kiegroup.
the class DeploymentServiceCDIImplWithSyncTest method configureDeploymentSync.
@Override
protected void configureDeploymentSync() {
store = new DeploymentStore();
store.setCommandService(commandService);
}
use of org.jbpm.kie.services.impl.store.DeploymentStore in project jbpm by kiegroup.
the class DeploymentSynchronizerEJBImpl method configure.
@PostConstruct
public void configure() {
DeploymentStore store = new DeploymentStore();
store.setCommandService(commandService);
setDeploymentStore(store);
if (DEPLOY_SYNC_ENABLED) {
ScheduleExpression schedule = new ScheduleExpression();
schedule.hour("*");
schedule.minute("*");
schedule.second("*/" + DEPLOY_SYNC_INTERVAL);
timer = timerService.createCalendarTimer(schedule, new TimerConfig(null, false));
}
}
use of org.jbpm.kie.services.impl.store.DeploymentStore 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