use of org.jivesoftware.smack.packet.Message in project Smack by igniterealtime.
the class MessageCorrectExtensionTest method checkStanzas.
@Test
public void checkStanzas() throws Exception {
Message initialMessage = (Message) PacketParserUtils.parseStanza(initialMessageXml);
MessageCorrectExtension messageCorrectExtension = new MessageCorrectExtension(idInitialMessage);
Assert.assertEquals(messageCorrectExtension.toXML().toString(), messageCorrectionXml);
initialMessage.addExtension(messageCorrectExtension);
Assert.assertEquals(initialMessage.toXML(), expectedXml);
}
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());
}
Aggregations