|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jivesoftware.util.ConnectionUtils
public class ConnectionUtils
A collection of utility methods to create mocked XMPP connections.
| Constructor Summary | |
|---|---|
ConnectionUtils()
|
|
| Method Summary | |
|---|---|
static Connection |
createMockedConnection(Protocol protocol,
java.lang.String initiatorJID,
java.lang.String xmppServer)
Creates a mocked XMPP connection that stores every packet that is send over this connection in the given protocol instance and returns the predefined answer packets form the protocol instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionUtils()
| Method Detail |
|---|
public static Connection createMockedConnection(Protocol protocol,
java.lang.String initiatorJID,
java.lang.String xmppServer)
This mocked connection can used to collect packets that require a reply using a PacketCollector.
PacketCollector collector = connection.createPacketCollector(new PacketFilter());
connection.sendPacket(packet);
Packet reply = collector.nextResult();
protocol - protocol helper containing answer packetsinitiatorJID - the user associated to the XMPP connectionxmppServer - the XMPP server associated to the XMPP connection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||