use of org.jivesoftware.smackx.mam.provider.MamPrefsIQProvider in project Smack by igniterealtime.
the class MamPrefIQProviderTest method checkMamPrefsIQProvider.
@Test
public void checkMamPrefsIQProvider() throws Exception {
XmlPullParser parser1 = PacketParserUtils.getParserFor(exampleMamPrefsIQ1);
MamPrefsIQ mamPrefIQ1 = new MamPrefsIQProvider().parse(parser1);
Assert.assertEquals(IQ.Type.set, mamPrefIQ1.getType());
Assert.assertEquals(mamPrefIQ1.getAlwaysJids().get(0), "romeo@montague.lit");
Assert.assertEquals(mamPrefIQ1.getNeverJids().get(0), "montague@montague.lit");
XmlPullParser parser2 = PacketParserUtils.getParserFor(exampleMamPrefsIQ2);
MamPrefsIQ mamPrefIQ2 = new MamPrefsIQProvider().parse(parser2);
Assert.assertEquals(IQ.Type.set, mamPrefIQ2.getType());
Assert.assertEquals(mamPrefIQ2.getAlwaysJids().get(0), "romeo@montague.lit");
Assert.assertEquals(mamPrefIQ2.getAlwaysJids().get(1), "montague@montague.lit");
Assert.assertTrue(mamPrefIQ2.getNeverJids().isEmpty());
XmlPullParser parser3 = PacketParserUtils.getParserFor(exampleMamPrefsIQ3);
MamPrefsIQ mamPrefIQ3 = new MamPrefsIQProvider().parse(parser3);
Assert.assertEquals(IQ.Type.set, mamPrefIQ3.getType());
}
Aggregations