use of org.jivesoftware.smack.ThreadedDummyConnection in project Smack by igniterealtime.
the class PingTest method checkUnuccessfulDiscoRequest.
@Test
public void checkUnuccessfulDiscoRequest() throws Exception {
ThreadedDummyConnection con = getAuthentiactedDummyConnection();
DiscoverInfo info = new DiscoverInfo();
info.addFeature(Ping.NAMESPACE);
//@formatter:off
String reply = "<iq type='result' id='qrzSp-16' to='test@myserver.com'>" + "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' type='pc' name='Pidgin'/>" + "<feature var='urn:xmpp:noping'/>" + "</query></iq>";
//@formatter:on
IQ discoReply = (IQ) PacketParserUtils.parseStanza(reply);
con.addIQReply(discoReply);
PingManager pinger = PingManager.getInstanceFor(con);
boolean pingSupported = pinger.isPingSupported(DUMMY_AT_EXAMPLE_ORG);
assertFalse(pingSupported);
}
Aggregations