Search in sources :

Example 6 with MamPrefsIQ

use of org.jivesoftware.smackx.mam.element.MamPrefsIQ in project Smack by igniterealtime.

the class PreferencesTest method checkUpdatePrefsStanza.

@Test
public void checkUpdatePrefsStanza() throws Exception {
    List<Jid> alwaysJids = new ArrayList<>();
    alwaysJids.add(JidCreate.from("romeo@montague.lit"));
    alwaysJids.add(JidCreate.from("other@montague.lit"));
    List<Jid> neverJids = new ArrayList<>();
    neverJids.add(JidCreate.from("montague@montague.lit"));
    MamPrefsIQ mamPrefIQ = new MamPrefsIQ(alwaysJids, neverJids, DefaultBehavior.roster);
    mamPrefIQ.setStanzaId("sarasa");
    Assert.assertEquals(mamPrefIQ.toXML().toString(), updatePrefsStanzaExample);
}
Also used : MamPrefsIQ(org.jivesoftware.smackx.mam.element.MamPrefsIQ) Jid(org.jxmpp.jid.Jid) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 7 with MamPrefsIQ

use of org.jivesoftware.smackx.mam.element.MamPrefsIQ in project Smack by igniterealtime.

the class PreferencesTest method checkRetrievePrefsStanza.

@Test
public void checkRetrievePrefsStanza() throws Exception {
    MamPrefsIQ mamPrefIQ = new MamPrefsIQ();
    mamPrefIQ.setStanzaId("sarasa");
    Assert.assertEquals(mamPrefIQ.toXML().toString(), retrievePrefsStanzaExample);
}
Also used : MamPrefsIQ(org.jivesoftware.smackx.mam.element.MamPrefsIQ) Test(org.junit.Test)

Aggregations

MamPrefsIQ (org.jivesoftware.smackx.mam.element.MamPrefsIQ)7 Test (org.junit.Test)4 Jid (org.jxmpp.jid.Jid)3 ArrayList (java.util.ArrayList)1 XMPPConnection (org.jivesoftware.smack.XMPPConnection)1 IQ (org.jivesoftware.smack.packet.IQ)1 DefaultBehavior (org.jivesoftware.smackx.mam.element.MamPrefsIQ.DefaultBehavior)1 MamPrefsIQProvider (org.jivesoftware.smackx.mam.provider.MamPrefsIQProvider)1 XmlPullParser (org.xmlpull.v1.XmlPullParser)1