Search in sources :

Example 1 with ReceivedProvider

use of org.jivesoftware.smackx.chat_markers.provider.ReceivedProvider in project Smack by igniterealtime.

the class ReceivedExtensionTest method checkReceivedProvider.

@Test
public void checkReceivedProvider() throws Exception {
    XmlPullParser parser = PacketParserUtils.getParserFor(receivedExtension);
    ReceivedExtension receivedExtension1 = new ReceivedProvider().parse(parser);
    Assert.assertEquals("message-1", receivedExtension1.getId());
    Message message = (Message) PacketParserUtils.parseStanza(receivedMessageStanza);
    ReceivedExtension receivedExtension2 = ReceivedExtension.from(message);
    Assert.assertEquals("message-1", receivedExtension2.getId());
}
Also used : ReceivedExtension(org.jivesoftware.smackx.chat_markers.element.ChatMarkersElements.ReceivedExtension) Message(org.jivesoftware.smack.packet.Message) XmlPullParser(org.xmlpull.v1.XmlPullParser) ReceivedProvider(org.jivesoftware.smackx.chat_markers.provider.ReceivedProvider) Test(org.junit.Test)

Aggregations

Message (org.jivesoftware.smack.packet.Message)1 ReceivedExtension (org.jivesoftware.smackx.chat_markers.element.ChatMarkersElements.ReceivedExtension)1 ReceivedProvider (org.jivesoftware.smackx.chat_markers.provider.ReceivedProvider)1 Test (org.junit.Test)1 XmlPullParser (org.xmlpull.v1.XmlPullParser)1