use of org.jivesoftware.smack.DummyConnection in project Smack by igniterealtime.
the class RosterTest method setUp.
@Before
public void setUp() throws Exception {
connection = new DummyConnection();
connection.connect();
connection.login();
rosterListener = new TestRosterListener();
roster = Roster.getInstanceFor(connection);
roster.addRosterListener(rosterListener);
connection.setReplyTimeout(1000 * 60 * 5);
}
use of org.jivesoftware.smack.DummyConnection in project Smack by igniterealtime.
the class RosterVersioningTest method setUp.
@Before
public void setUp() throws Exception {
DirectoryRosterStore store = DirectoryRosterStore.init(tmpFolder.newFolder("store"));
populateStore(store);
Builder<?, ?> builder = DummyConnection.getDummyConfigurationBuilder();
connection = new DummyConnection(builder.build());
connection.connect();
connection.login();
rosterListener = new TestRosterListener();
roster = Roster.getInstanceFor(connection);
roster.setRosterStore(store);
roster.addRosterListener(rosterListener);
roster.reload();
}
use of org.jivesoftware.smack.DummyConnection in project Smack by igniterealtime.
the class SubscriptionPreApprovalTest method setUp.
@Before
public void setUp() throws Exception {
connection = new DummyConnection();
connection.connect();
connection.login();
rosterListener = new TestRosterListener();
roster = Roster.getInstanceFor(connection);
roster.addRosterListener(rosterListener);
connection.setReplyTimeout(1000 * 60 * 5);
}
use of org.jivesoftware.smack.DummyConnection in project Smack by igniterealtime.
the class DeliveryReceiptTest method receiptManagerAutoReplyTest.
@Test
public void receiptManagerAutoReplyTest() throws Exception {
DummyConnection c = new DummyConnection();
c.connect();
DeliveryReceiptManager drm = DeliveryReceiptManager.getInstanceFor(c);
drm.setAutoReceiptMode(AutoReceiptMode.always);
assertEquals(AutoReceiptMode.always, drm.getAutoReceiptMode());
// test auto-receipts
Message m = new Message(JidCreate.from("julia@capulet.com"), Message.Type.normal);
m.setFrom(JidCreate.from("romeo@montague.com"));
m.setStanzaId("test-receipt-request");
DeliveryReceiptRequest.addTo(m);
// the DRM will send a reply-packet
c.processStanza(m);
Stanza reply = c.getSentPacket();
DeliveryReceipt r = DeliveryReceipt.from((Message) reply);
assertThat("romeo@montague.com", equalsCharSequence(reply.getTo()));
assertEquals("test-receipt-request", r.getId());
}
use of org.jivesoftware.smack.DummyConnection in project Smack by igniterealtime.
the class PingTest method getAuthenticatedDummyConnectionWithoutIqReplies.
/**
* The returned connection won't send replies to IQs
*
* @return
* @throws XMPPException
* @throws IOException
* @throws SmackException
* @throws InterruptedException
*/
private static DummyConnection getAuthenticatedDummyConnectionWithoutIqReplies() throws SmackException, IOException, XMPPException, InterruptedException {
DummyConnection con = new DummyConnection();
con.setReplyTimeout(500);
con.connect();
con.login();
return con;
}
Aggregations