Search in sources :

Example 1 with UnblockContactsIQ

use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.

the class UnblockContactsIQTest method checkUnblockContactIQStanza.

@Test
public void checkUnblockContactIQStanza() throws Exception {
    List<Jid> jids = new ArrayList<>();
    jids.add(JidCreate.from("romeo@montague.net"));
    jids.add(JidCreate.from("pepe@montague.net"));
    UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ(jids);
    unblockContactIQ.setStanzaId("unblock1");
    Assert.assertEquals(unblockContactIQExample, unblockContactIQ.toXML().toString());
}
Also used : Jid(org.jxmpp.jid.Jid) ArrayList(java.util.ArrayList) UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ) Test(org.junit.Test)

Example 2 with UnblockContactsIQ

use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.

the class UnblockContactsIQTest method checkUnblockContactPushIQ.

@Test
public void checkUnblockContactPushIQ() throws Exception {
    IQ iq = (IQ) PacketParserUtils.parseStanza(unblockContactPushIQExample);
    UnblockContactsIQ unblockContactIQ = (UnblockContactsIQ) iq;
    Assert.assertEquals(JidCreate.from("romeo@montague.net"), unblockContactIQ.getJids().get(0));
    Assert.assertEquals(JidCreate.from("pepe@montague.net"), unblockContactIQ.getJids().get(1));
}
Also used : UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ) IQ(org.jivesoftware.smack.packet.IQ) UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ) Test(org.junit.Test)

Example 3 with UnblockContactsIQ

use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.

the class UnblockContactsIQTest method checkUnblockAllPushIQ.

@Test
public void checkUnblockAllPushIQ() throws Exception {
    IQ iq = (IQ) PacketParserUtils.parseStanza(unblockAllPushIQExample);
    UnblockContactsIQ unblockAllIQ = (UnblockContactsIQ) iq;
    Assert.assertNull(unblockAllIQ.getJids());
}
Also used : UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ) IQ(org.jivesoftware.smack.packet.IQ) UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ) Test(org.junit.Test)

Example 4 with UnblockContactsIQ

use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.

the class BlockingCommandManager method unblockAll.

/**
     * Unblock all.
     * 
     * @throws NoResponseException
     * @throws XMPPErrorException
     * @throws NotConnectedException
     * @throws InterruptedException
     */
public void unblockAll() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ();
    connection().createStanzaCollectorAndSend(unblockContactIQ).nextResultOrThrow();
}
Also used : UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ)

Example 5 with UnblockContactsIQ

use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.

the class BlockingCommandManager method unblockContacts.

/**
     * Unblock contacts.
     * 
     * @param jids
     * @throws NoResponseException
     * @throws XMPPErrorException
     * @throws NotConnectedException
     * @throws InterruptedException
     */
public void unblockContacts(List<Jid> jids) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ(jids);
    connection().createStanzaCollectorAndSend(unblockContactIQ).nextResultOrThrow();
}
Also used : UnblockContactsIQ(org.jivesoftware.smackx.blocking.element.UnblockContactsIQ)

Aggregations

UnblockContactsIQ (org.jivesoftware.smackx.blocking.element.UnblockContactsIQ)6 Test (org.junit.Test)4 IQ (org.jivesoftware.smack.packet.IQ)2 ArrayList (java.util.ArrayList)1 Jid (org.jxmpp.jid.Jid)1