diff --git a/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java b/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java index 9d8c68ad..0d4ef08d 100644 --- a/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java +++ b/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java @@ -37,6 +37,7 @@ public class ConversationReceiverTest extends AndroidTestCase implements Convers private boolean onConversationMessageCalled; private boolean onNewConversationCalled; private boolean onRemoveConversationCalled; + private boolean onClearConversationCalled; private ConversationReceiver receiver; private String testTarget = "#unittest"; @@ -47,6 +48,7 @@ public void setUp() onConversationMessageCalled = false; onNewConversationCalled = false; onRemoveConversationCalled = false; + onClearConversationCalled = false; receiver = new ConversationReceiver(serverId, this); } @@ -59,6 +61,7 @@ public void testMessageBroadcast() assertTrue(onConversationMessageCalled); assertFalse(onNewConversationCalled); assertFalse(onRemoveConversationCalled); + assertFalse(onClearConversationCalled); } public void testNewBroadcast() @@ -69,6 +72,7 @@ public void testNewBroadcast() assertFalse(onConversationMessageCalled); assertTrue(onNewConversationCalled); assertFalse(onRemoveConversationCalled); + assertFalse(onClearConversationCalled); } public void testRemoveBroadcast() @@ -79,6 +83,18 @@ public void testRemoveBroadcast() assertFalse(onConversationMessageCalled); assertFalse(onNewConversationCalled); assertTrue(onRemoveConversationCalled); + assertFalse(onClearConversationCalled); + } + + public void testClearBroadcast() + { + Intent intent = Broadcast.createConversationIntent(Broadcast.CONVERSATION_CLEAR, serverId, testTarget); + receiver.onReceive(getContext(), intent); + + assertFalse(onConversationMessageCalled); + assertFalse(onNewConversationCalled); + assertFalse(onRemoveConversationCalled); + assertTrue(onClearConversationCalled); } @Override @@ -110,4 +126,12 @@ public void onTopicChanged(String topic) { // XXX: Implement me! } + + @Override + public void onClearConversation(String target) + { + assertEquals(testTarget, target); + + onClearConversationCalled = true; + } }