StateMachine1 sm1 = new StateMachine1("sm1");
if (sm1.isDbg()) Log.d(TAG, "testStateMachine1 E");
synchronized (sm1) {
// Send two messages
sm1.sendMessage(sm1.obtainMessage(TEST_WHAT_1));
sm1.sendMessage(sm1.obtainMessage(TEST_WHAT_2));
try {
// wait for the messages to be handled
sm1.wait();
} catch (InterruptedException e) {
Log.e(TAG, "testStateMachine1: exception while waiting " + e.getMessage());
}
}
assertTrue(mDidEnter);
assertTrue(mDidExit);
assertTrue(mGotMessagesWhat.size() == 2);
assertTrue(mGotMessagesWhat.get(0) == TEST_WHAT_1);
assertTrue(mGotMessagesWhat.get(1) == TEST_WHAT_2);
if (sm1.isDbg()) Log.d(TAG, "testStateMachine1 X");