Make tests more reliable

This commit is contained in:
Janne Valkealahti
2016-05-18 18:59:05 +01:00
parent 962c76e91d
commit 6b93760535

View File

@@ -40,8 +40,17 @@ public class StateMachineTests {
private StateMachine<String, String> stateMachine;
@Before
public void setup() {
public void setup() throws Exception {
stateMachine = stateMachineFactory.getStateMachine();
// plan don't know how to wait if machine is started
// automatically so wait here.
for (int i = 0; i < 10; i++) {
if (stateMachine.getState() != null) {
break;
} else {
Thread.sleep(200);
}
}
}
@Test