@Test
public void testJobAddedGuardForTwoEnginesSameAcquisition() throws InterruptedException {
// configure and build a process engine
StandaloneProcessEngineConfiguration engineConfiguration1 = new StandaloneInMemProcessEngineConfiguration();
engineConfiguration1.setProcessEngineName(getClass().getName() + "-engine1");
engineConfiguration1.setJdbcUrl("jdbc:h2:mem:activiti1");
engineConfiguration1.setJobExecutorActivate(false);
engineConfiguration1.setJobExecutor(jobExecutor);
ProcessEngine engine1 = engineConfiguration1.buildProcessEngine();
// and a second one
StandaloneProcessEngineConfiguration engineConfiguration2 = new StandaloneInMemProcessEngineConfiguration();
engineConfiguration2.setProcessEngineName(getClass().getName() + "engine2");
engineConfiguration2.setJdbcUrl("jdbc:h2:mem:activiti2");
engineConfiguration2.setJobExecutorActivate(false);
engineConfiguration1.setJobExecutor(jobExecutor);
ProcessEngine engine2 = engineConfiguration2.buildProcessEngine();
jobExecutor.registerProcessEngine((ProcessEngineImpl) engine1);
jobExecutor.registerProcessEngine((ProcessEngineImpl) engine2);
// stop the acquisition