use of org.jivesoftware.smack.packet.Message in project Smack by igniterealtime.
the class ChatConnectionTest method validateMessageTypeWithDefaults2.
@Test
public void validateMessageTypeWithDefaults2() {
Message incomingChat = createChatPacket("134", true);
incomingChat.setType(Type.normal);
processServerMessage(incomingChat);
assertNotNull(listener.getNewChat());
}
use of org.jivesoftware.smack.packet.Message in project Smack by igniterealtime.
the class ChatConnectionTest method validateMessageTypeWithNoNormal2.
@Test
public void validateMessageTypeWithNoNormal2() {
cm.setNormalIncluded(false);
Message incomingChat = createChatPacket("134", true);
incomingChat.setType(Type.normal);
processServerMessage(incomingChat);
assertNull(listener.getNewChat());
}
use of org.jivesoftware.smack.packet.Message in project Smack by igniterealtime.
the class ChatConnectionTest method chatNotMatchedWithTypeNormal.
@Test
public void chatNotMatchedWithTypeNormal() {
cm.setNormalIncluded(false);
Message incomingChat = createChatPacket(null, false);
incomingChat.setType(Type.normal);
processServerMessage(incomingChat);
assertNull(listener.getNewChat());
}
use of org.jivesoftware.smack.packet.Message in project Smack by igniterealtime.
the class ChatConnectionTest method validateMessageTypeWithDefaults3.
@Test
public void validateMessageTypeWithDefaults3() {
Message incomingChat = createChatPacket("134", true);
incomingChat.setType(Type.groupchat);
processServerMessage(incomingChat);
assertNull(listener.getNewChat());
}
use of org.jivesoftware.smack.packet.Message in project Smack by igniterealtime.
the class DeliveryReceiptTest method receiptManagerListenerTest.
@Test
public void receiptManagerListenerTest() throws Exception {
DummyConnection c = new DummyConnection();
c.connect();
DeliveryReceiptManager drm = DeliveryReceiptManager.getInstanceFor(c);
TestReceiptReceivedListener rrl = new TestReceiptReceivedListener();
drm.addReceiptReceivedListener(rrl);
Message m = new Message(JidCreate.from("romeo@montague.com"), Message.Type.normal);
m.setFrom(JidCreate.from("julia@capulet.com"));
m.setStanzaId("reply-id");
m.addExtension(new DeliveryReceipt("original-test-id"));
c.processStanza(m);
rrl.waitUntilInvocationOrTimeout();
}
Aggregations