提交 f6bba712 编写于 作者: S Saeid Mirzaei 提交者: Joram Barrez
上级 a8c8d6ef
......@@ -18,6 +18,7 @@ import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.activiti.engine.delegate.event.ActivitiEventType;
import org.activiti.engine.impl.test.PluggableActivitiTestCase;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.Deployment;
/**
......@@ -27,10 +28,9 @@ import org.activiti.engine.test.Deployment;
public class StartTimerEventRepeatWithoutN extends PluggableActivitiTestCase {
protected long counter = 0;
protected StartEventListener startEventListener;
long counter = 0;
class StartEventListener implements ActivitiEventListener {
class startEventListener implements ActivitiEventListener {
@Override
public void onEvent(ActivitiEvent event) {
......@@ -50,31 +50,26 @@ public class StartTimerEventRepeatWithoutN extends PluggableActivitiTestCase {
protected void setUp() throws Exception {
super.setUp();
startEventListener = new StartEventListener();
processEngineConfiguration.getEventDispatcher().addEventListener(startEventListener);
startEventListener listener = new startEventListener();
processEngineConfiguration.getEventDispatcher().addEventListener(
listener);
}
@Override
protected void tearDown() throws Exception {
processEngineConfiguration.getEventDispatcher().removeEventListener(startEventListener);
super.tearDown();
}
@Deployment
@Deployment
public void testStartTimerEventRepeatWithoutN() {
counter = 0;
Boolean exceptionOccured = false;
try {
waitForJobExecutorToProcessAllJobs(5500, 500);
fail("job is finished sooner than expected");
waitForJobExecutorToProcessAllJobs(12000, 100);
} catch (ActivitiException e) {
assertTrue(e.getMessage().startsWith("time limit"));
assertTrue(counter >= 2);
assertEquals(2, counter);
exceptionOccured = true;
}
if (!exceptionOccured)
fail("job is finished sooner than expected");
}
}
......@@ -3,7 +3,7 @@
<process id="testProcess" isExecutable="true">
<startEvent id="timerstartevent1" name="Timer start">
<timerEventDefinition>
<timeCycle>R/PT2S</timeCycle>
<timeCycle>R/PT5S</timeCycle>
</timerEventDefinition>
</startEvent>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册