use of org.jbpm.executor.impl.ExecutorServiceImpl in project jbpm by kiegroup.
the class JmsAvaiableJobExecutorTest method configureListener.
protected CountDownAsyncJobListener configureListener(int threads) {
CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(threads);
((ExecutorServiceImpl) executorService).addAsyncJobListener(countDownListener);
return countDownListener;
}
use of org.jbpm.executor.impl.ExecutorServiceImpl in project jbpm by kiegroup.
the class LogCleanupCommandTest method skipProcessLog.
@Test(timeout = 10000)
public void skipProcessLog() throws Exception {
CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1);
((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener);
// Generate data
KieSession kieSession = createKSession(HELLO_WORLD);
startProcess(kieSession, HELLO_WORLD_ID, 1);
// Verify presence of data
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isEqualTo(1);
Assertions.assertThat(getNodeInstanceLogSize(HELLO_WORLD_ID)).isPositive();
// Schedule cleanup job
scheduleLogCleanup(true, false, false, getTomorrow(), null, HELLO_WORLD_ID);
countDownListener.waitTillCompleted();
// Verify that the process log has not been touched
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isEqualTo(1);
Assertions.assertThat(getNodeInstanceLogSize(HELLO_WORLD_ID)).isPositive();
}
use of org.jbpm.executor.impl.ExecutorServiceImpl in project jbpm by kiegroup.
the class LogCleanupCommandTest method deleteAllLogsOlderThanNow.
@Ignore
@Test(timeout = 10000)
@BZ("1190881")
public void deleteAllLogsOlderThanNow() throws Exception {
CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1);
((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener);
deleteAllLogsOlderThan(null, countDownListener);
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isZero();
Assertions.assertThat(getNodeInstanceLogSize(HELLO_WORLD_ID)).isZero();
}
use of org.jbpm.executor.impl.ExecutorServiceImpl in project jbpm by kiegroup.
the class LogCleanupCommandTest method deleteAllLogsOlderThanTomorrow.
@Ignore
@Test(timeout = 10000)
public void deleteAllLogsOlderThanTomorrow() throws Exception {
CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1);
((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener);
deleteAllLogsOlderThan(getTomorrow(), countDownListener);
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isZero();
Assertions.assertThat(getNodeInstanceLogSize(HELLO_WORLD_ID)).isZero();
}
use of org.jbpm.executor.impl.ExecutorServiceImpl in project jbpm by kiegroup.
the class LogCleanupCommandTest method deleteAllLogsOlderThanPeriod.
@Ignore
@Test(timeout = 10000)
@BZ("1190881")
public void deleteAllLogsOlderThanPeriod() throws Exception {
CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1);
((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener);
// Generate data
KieSession kieSession = createKSession(HELLO_WORLD);
startProcess(kieSession, HELLO_WORLD_ID, 3);
countDownListener.waitTillCompleted();
startProcess(kieSession, HELLO_WORLD_ID, 2);
// Verify presence of data
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isEqualTo(5);
Assertions.assertThat(getNodeInstanceLogSize(HELLO_WORLD_ID)).isPositive();
// Schedule cleanup job
scheduleLogCleanup(false, false, false, null, "8s", HELLO_WORLD_ID);
countDownListener.waitTillCompleted();
// Verify absence of data
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isEqualTo(2);
}
Aggregations