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

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


        new Data(null);
    }

    @Test
    public void shouldBeOfIQTypeSET() {
        DataPacketExtension dpe = mock(DataPacketExtension.class);
        Data data = new Data(dpe);
        assertEquals(IQ.Type.SET, data.getType());
    }
View Full Code Here


                .a("seq", "0")
                .a("sid", "i781hf64")
                .t(encodedData)
            .asString(outputProperties);

        DataPacketExtension dpe = mock(DataPacketExtension.class);
        String dataTag = XMLBuilder.create("data")
            .a("xmlns", "http://jabber.org/protocol/ibb")
            .a("seq", "0")
            .a("sid", "i781hf64")
            .t(encodedData)
            .asString(outputProperties);
        when(dpe.toXML()).thenReturn(dataTag);
        Data data = new Data(dpe);
        data.setFrom("romeo@montague.lit/orchard");
        data.setTo("juliet@capulet.lit/balcony");
        data.setPacketID("kr91n475");
       
View Full Code Here

        // insert data to read
        InputStream inputStream = session.getInputStream();
        PacketListener listener = Whitebox.getInternalState(inputStream, PacketListener.class);
        String base64Data = StringUtils.encodeBase64("Data");
        DataPacketExtension dpe = new DataPacketExtension(sessionID, 0, base64Data);
        Data data = new Data(dpe);
        listener.processPacket(data);

        // verify no packet send
        protocol.verifyAll();
View Full Code Here

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

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

        listener.processPacket(data);

        protocol.verifyAll();
View Full Code Here

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

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

        // notify listener
        listener.processPacket(data1);
View Full Code Here

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

        // build data packets
        DataPacketExtension dpe = new DataPacketExtension(sessionID, 0, "AA=BB");
        Data data = new Data(dpe);

        // notify listener
        listener.processPacket(data);
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);
        Data data = new Data(dpe);

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

        // set data packet acknowledgment and notify listener
        for (int i = 0; i < controlData.length / blockSize; i++) {
            protocol.addResponse(resultIQ);
            String base64Data = StringUtils.encodeBase64(controlData, i * blockSize, blockSize,
                            false);
            DataPacketExtension dpe = new DataPacketExtension(sessionID, i, base64Data);
            Data data = new Data(dpe);
            listener.processPacket(data);
        }

        byte[] bytes = new byte[3 * blockSize];
 
View Full Code Here

        // set data packet acknowledgment and notify listener
        for (int i = 0; i < controlData.length / blockSize; i++) {
            protocol.addResponse(resultIQ);
            String base64Data = StringUtils.encodeBase64(controlData, i * blockSize, blockSize,
                            false);
            DataPacketExtension dpe = new DataPacketExtension(sessionID, i, base64Data);
            Data data = new Data(dpe);
            listener.processPacket(data);
        }

        // read data
View Full Code Here

        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

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.