Add getter on TimerTrigger for period and count
- Backport #533 - Relates to #549
This commit is contained in:
committed by
Janne Valkealahti
parent
889ad0c6f0
commit
eda6bfd38b
@@ -57,6 +57,14 @@ public class TimerTrigger<S, E> extends LifecycleObjectSupport implements Trigge
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public long getPeriod() {
|
||||
return period;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean evaluate(TriggerContext<S, E> context) {
|
||||
return false;
|
||||
|
||||
@@ -19,6 +19,7 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -52,6 +53,15 @@ public class TimerTriggerTests extends AbstractStateMachineTests {
|
||||
return new AnnotationConfigApplicationContext();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetter() {
|
||||
final long period = 1000;
|
||||
final int count = 1;
|
||||
final TimerTrigger timerTrigger = new TimerTrigger(period, count);
|
||||
assertEquals(period, timerTrigger.getPeriod());
|
||||
assertEquals(count, timerTrigger.getCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testListenerEvents() throws Exception {
|
||||
context.register(BaseConfig.class, Config1.class);
|
||||
|
||||
Reference in New Issue
Block a user