|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.test.eventscheduler.StubEventScheduler
public class StubEventScheduler
EventScheduler implementation that uses it's own concept of "Current Time" for the purpose of testing. Instead of publishing events, it allows (test) classes to obtain a reference to scheduled events for a certain time frame.
To obtain scheduled events, the conceptual "current time" of the Scheduler must be advanced. All events that have been scheduled within the advanced time frame are returned. It is up to the calling class to decide what to do with these events.
| Constructor Summary | |
|---|---|
StubEventScheduler()
Creates an instance of the StubScheduler that uses the current date time as its conceptual "current time". |
|
StubEventScheduler(org.joda.time.ReadableInstant currentDateTime)
Creates an instance of the StubScheduler that uses the given currentDateTime as its conceptual
"current time". |
|
| Method Summary | |
|---|---|
List<org.axonframework.domain.EventMessage> |
advanceTime(org.joda.time.DateTime newDateTime)
Advance time to the given newDateTime and returns all events scheduled for publication until that
time. |
List<org.axonframework.domain.EventMessage> |
advanceTime(org.joda.time.Duration duration)
Advance time by the given duration and returns all events scheduled for publication until that
time. |
org.axonframework.domain.EventMessage |
advanceToNextTrigger()
Advances the "current time" of the scheduler to the next scheduled Event, and returns that event. |
void |
cancelSchedule(org.axonframework.eventhandling.scheduling.ScheduleToken scheduleToken)
|
org.joda.time.DateTime |
getCurrentDateTime()
Returns the "Current Date Time" as used by the scheduler. |
List<ScheduledItem> |
getScheduledItems()
Returns a view of all the scheduled Events at the time this method is called. |
org.axonframework.eventhandling.scheduling.ScheduleToken |
schedule(org.joda.time.DateTime triggerDateTime,
Object event)
|
org.axonframework.eventhandling.scheduling.ScheduleToken |
schedule(org.joda.time.Duration triggerDuration,
Object event)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StubEventScheduler()
public StubEventScheduler(org.joda.time.ReadableInstant currentDateTime)
currentDateTime as its conceptual
"current time".
currentDateTime - The instant to use as current Date and Time| Method Detail |
|---|
public org.axonframework.eventhandling.scheduling.ScheduleToken schedule(org.joda.time.DateTime triggerDateTime,
Object event)
schedule in interface org.axonframework.eventhandling.scheduling.EventScheduler
public org.axonframework.eventhandling.scheduling.ScheduleToken schedule(org.joda.time.Duration triggerDuration,
Object event)
schedule in interface org.axonframework.eventhandling.scheduling.EventSchedulerpublic void cancelSchedule(org.axonframework.eventhandling.scheduling.ScheduleToken scheduleToken)
cancelSchedule in interface org.axonframework.eventhandling.scheduling.EventSchedulerpublic List<ScheduledItem> getScheduledItems()
public org.joda.time.DateTime getCurrentDateTime()
public org.axonframework.domain.EventMessage advanceToNextTrigger()
public List<org.axonframework.domain.EventMessage> advanceTime(org.joda.time.DateTime newDateTime)
newDateTime and returns all events scheduled for publication until that
time.
newDateTime - The time to advance the "current time" of the scheduler to
public List<org.axonframework.domain.EventMessage> advanceTime(org.joda.time.Duration duration)
duration and returns all events scheduled for publication until that
time.
duration - The amount of time to advance the "current time" of the scheduler with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||