Search in sources :

Example 1 with ChatManagerListener

use of org.jivesoftware.smack.chat.ChatManagerListener in project Smack by igniterealtime.

the class ChatTest method chatManagerTest.

@SuppressWarnings("deprecation")
@SmackIntegrationTest
public void chatManagerTest() {
    ChatManagerListener listener = new ChatManagerListener() {

        @Override
        public void chatCreated(org.jivesoftware.smack.chat.Chat chat, boolean createdLocally) {
            invoked = true;
        }
    };
    try {
        chatManagerOne.addChatListener(listener);
        chatManagerOne.createChat(conTwo.getUser());
        assertTrue("TestChatManagerListener wasn't invoked", invoked);
    } finally {
        chatManagerOne.removeChatListener(listener);
    }
}
Also used : ChatManagerListener(org.jivesoftware.smack.chat.ChatManagerListener) AbstractSmackIntegrationTest(org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest) SmackIntegrationTest(org.igniterealtime.smack.inttest.SmackIntegrationTest)

Aggregations

AbstractSmackIntegrationTest (org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest)1 SmackIntegrationTest (org.igniterealtime.smack.inttest.SmackIntegrationTest)1 ChatManagerListener (org.jivesoftware.smack.chat.ChatManagerListener)1