use of org.jbpm.test.listener.CountDownAsyncJobListener 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.test.listener.CountDownAsyncJobListener 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.test.listener.CountDownAsyncJobListener 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.test.listener.CountDownAsyncJobListener 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);
}
use of org.jbpm.test.listener.CountDownAsyncJobListener in project jbpm by kiegroup.
the class LogCleanupCommandTest method deleteAllLogsOlderThanYesterday.
@Test(timeout = 10000)
public void deleteAllLogsOlderThanYesterday() throws Exception {
CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1);
((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener);
deleteAllLogsOlderThan(getYesterday(), countDownListener);
Assertions.assertThat(getProcessLogSize(HELLO_WORLD_ID)).isPositive();
Assertions.assertThat(getNodeInstanceLogSize(HELLO_WORLD_ID)).isPositive();
}
Aggregations