public void scheduledRepeatingCommandOrder() {
// Arrange
i = j = 0;
final StringBuilder sb = new StringBuilder();
Scheduler.get().scheduleEntry(new RepeatingCommand() {
public boolean execute() {
sb.append("entry").append(i).append(" ");
return 3 > i++;
}
});
Scheduler.get().scheduleFinally(new RepeatingCommand() {
public boolean execute() {
sb.append("finally").append(j).append(" ");
Scheduler.get().scheduleEntry(new RepeatingCommand() {
public boolean execute() {
sb.append("subentry").append(j).append(" ");
return false;
}
});
Scheduler.get().scheduleFinally(new RepeatingCommand() {
public boolean execute() {
sb.append("subfinally").append(j).append(" ");
return false;
}