fail();
}
@Test
public void testAsynActionExecOrder() {
builder.onExit("AsyncA").perform(new UntypedAnonymousAction() {
@Override
public void execute(Object from, Object to, Object event,
Object context, UntypedStateMachine stateMachine) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
}
@Override
public boolean isAsync() {
return true;
}
@Override
public String name() {
return "Exit-AsyncA";
}
});
builder.externalTransition().from("AsyncA").to("AsyncB")
.on("AsyncFirst").perform(new UntypedAnonymousAction() {
@Override
public void execute(Object from, Object to, Object event,
Object context, UntypedStateMachine stateMachine) {
try {
Thread.sleep(300);
} catch (InterruptedException e) {
}
}
@Override
public boolean isAsync() {
return true;
}
@Override
public String name() {
return "AsyncA-AsyncB";
}
});
builder.onEntry("AsyncB").perform(new UntypedAnonymousAction() {
@Override
public void execute(Object from, Object to, Object event,
Object context, UntypedStateMachine stateMachine) {
try {
Thread.sleep(100);