Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.Packet


         * SOCKS5 initiation listener must ignore next SOCKS5 Bytestream request with given session
         * ID
         */
        this.manager.ignoreBytestreamRequestOnce(initiation.getSessionID());

        Packet streamInitiation = initiateIncomingStream(this.connection, initiation);
        return negotiateIncomingStream(streamInitiation);
    }
View Full Code Here


         * In-Band Bytestream initiation listener must ignore next in-band
         * bytestream request with given session ID
         */
        this.manager.ignoreBytestreamRequestOnce(initiation.getSessionID());

        Packet streamInitiation = initiateIncomingStream(this.connection, initiation);
        return negotiateIncomingStream(streamInitiation);
    }
View Full Code Here

        NegotiatorService(PacketCollector collector) {
            this.collector = collector;
        }

        public InputStream call() throws Exception {
            Packet streamInitiation = collector.nextResult(
                    SmackConfiguration.getPacketReplyTimeout() * 2);
            if (streamInitiation == null) {
                throw new XMPPException("No response from remote client");
            }
            StreamNegotiator negotiator = determineNegotiator(streamInitiation);
View Full Code Here

    /**
     * Test of getExtensions method of class SimpleMapper with XMLString.
     */
    @Test
    public void testGetExtensions() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        instance.addExtension(packet, testXmlString1);
        instance.addExtension(packet, testXmlString2);
        Collection <TestStringDocument> result = instance.getExtensions(packet);
        assertEquals("getExtensions must return values which were put", 2,
View Full Code Here

    /**
     * Test of get method for non-existed extension.
     */
    @Test
    public void testGetNonExisted2() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        instance.addExtension(packet, testXmlString1);

        SimpleMapper<TestIntegerDocument> instanceForGet = new
                SimpleMapper(TestIntegerDocument.class);
View Full Code Here

    /**
     * Test of put method of class SimpleMapper with null value.
     */
    @Test
    public void testPutNull() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        instance.addExtension(packet, testXmlString1);
        instance.addExtension(packet, null);
        TestStringDocument result = instance.getExtension(packet);
        assertEquals("getExtension must return value which was put",
View Full Code Here

    /**
     * Test of addExtension method of class SimpleMapper.
     */
    @Test
    public void testAdd() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        instance.addExtension(packet, testXmlString1);
        instance.addExtension(packet, testXmlString2);
        TestStringDocument result = instance.getExtension(packet);
        assertEquals("getExtension must return first value which was put",
View Full Code Here

    /**
     * Test of get method of class SimpleMapper with null packet argument.
     */
    @Test
    public void testFailGetNullPacket() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        instance.addExtension(packet, testXmlString1);
        try {
            TestStringDocument result = instance.getExtension(null);
        } catch (NullPointerException npe) {
View Full Code Here

    /**
     * Test of the put method of class SimpleMapper with null packet argument.
     */
    @Test
    public void testFailPutNullPacket() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);

        try {
            instance.addExtension(null, testXmlString1);
        } catch (NullPointerException npe) {
View Full Code Here

        PacketCollector pc = conn2.createPacketCollector(new PacketTypeFilter(Message.class));
       
        conn2.login(XMPP_LOGIN2, XMPP_PASSWORD2);

        Packet p = pc.nextResult();

        TestStringDocument result = instance.getExtension(p);
        assertEquals(TEST_STRING1, result.getTestString());

        conn2.disconnect();
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.packet.Packet

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.