Package org.jivesoftware.smackx.bytestreams.ibb.packet

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension


        InputStream inputStream = session.getInputStream();
        PacketListener listener = Whitebox.getInternalState(inputStream, PacketListener.class);

        // build data packet
        String base64Data = StringUtils.encodeBase64("Data");
        DataPacketExtension dpe = new DataPacketExtension(sessionID, 0, base64Data);
        Data data = new Data(dpe);

        // add data packets
        listener.processPacket(data);
View Full Code Here


        final InputStream inputStream = session.getInputStream();
        PacketListener listener = Whitebox.getInternalState(inputStream, PacketListener.class);

        // build data packet
        String base64Data = StringUtils.encodeBase64("Data");
        DataPacketExtension dpe = new DataPacketExtension(sessionID, 0, base64Data);
        Data data = new Data(dpe);

        // add data packets
        listener.processPacket(data);
View Full Code Here

        incrementingSequence = new Verification<Message, IQ>() {

            long lastSeq = 0;

            public void verify(Message request, IQ response) {
                DataPacketExtension dpe = (DataPacketExtension) request.getExtension(
                                DataPacketExtension.ELEMENT_NAME, InBandBytestreamManager.NAMESPACE);
                assertEquals(lastSeq++, dpe.getSeq());
            }

        };

    }
View Full Code Here

        InputStream inputStream = session.getInputStream();
        PacketListener listener = Whitebox.getInternalState(inputStream, PacketListener.class);

        // build invalid packet with out of order sequence
        String base64Data = StringUtils.encodeBase64("Data");
        DataPacketExtension dpe = new DataPacketExtension(sessionID, 123, base64Data);
        Message dataMessage = new Message();
        dataMessage.addExtension(dpe);

        // add data packets
        listener.processPacket(dataMessage);
View Full Code Here

        // verify data packet and notify listener
        for (int i = 0; i < controlData.length / blockSize; i++) {
            String base64Data = StringUtils.encodeBase64(controlData, i * blockSize, blockSize,
                            false);
            DataPacketExtension dpe = new DataPacketExtension(sessionID, i, base64Data);
            Message dataMessage = new Message();
            dataMessage.addExtension(dpe);
            listener.processPacket(dataMessage);
        }

View Full Code Here

        // verify data packet and notify listener
        for (int i = 0; i < controlData.length / blockSize; i++) {
            String base64Data = StringUtils.encodeBase64(controlData, i * blockSize, blockSize,
                            false);
            DataPacketExtension dpe = new DataPacketExtension(sessionID, i, base64Data);
            Message dataMessage = new Message();
            dataMessage.addExtension(dpe);
            listener.processPacket(dataMessage);
        }

View Full Code Here

*/
public class DataPacketExtensionTest {

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotInstantiateWithInvalidArgument1() {
        new DataPacketExtension(null, 0, "data");
    }
View Full Code Here

        new DataPacketExtension(null, 0, "data");
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotInstantiateWithInvalidArgument2() {
        new DataPacketExtension("", 0, "data");
    }
View Full Code Here

        new DataPacketExtension("", 0, "data");
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotInstantiateWithInvalidArgument3() {
        new DataPacketExtension("sessionID", -1, "data");
    }
View Full Code Here

        new DataPacketExtension("sessionID", -1, "data");
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotInstantiateWithInvalidArgument4() {
        new DataPacketExtension("sessionID", 70000, "data");
    }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.