use of org.jivesoftware.util.Protocol in project Smack by igniterealtime.
the class InBandBytestreamSessionTest method setup.
/**
* Initialize fields used in the tests.
* @throws XMPPException
* @throws SmackException
* @throws InterruptedException
*/
@Before
public void setup() throws XMPPException, SmackException, InterruptedException {
// build protocol verifier
protocol = new Protocol();
// create mocked XMPP connection
connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID, xmppServer);
// initialize InBandBytestreamManager to get the InitiationListener
byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection);
// create a In-Band Bytestream open packet
initBytestream = new Open(sessionID, blockSize);
initBytestream.setFrom(initiatorJID);
initBytestream.setTo(targetJID);
incrementingSequence = new Verification<Data, IQ>() {
long lastSeq = 0;
@Override
public void verify(Data request, IQ response) {
assertEquals(lastSeq++, request.getDataPacketExtension().getSeq());
}
};
}
Aggregations