Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.Packet


        conn2.connect();

        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


        conn2.connect();

        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

    /**
     * Test of put and get methods of class SimpleMapper with XMLString.
     */
    @Test
    public void testPutGetXmlString() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        instance.addExtension(packet, testXmlString1);
        TestStringDocument result = instance.getExtension(packet);
        assertEquals("Get must return value which was put",
                     result.getTestString(), TEST_STRING1);
View Full Code Here

    /**
     * Test of get method for non-existent extension.
     */
    @Test
    public void testGetNonExisted1() throws Exception {
        Packet packet = new Message();
        SimpleMapper<TestStringDocument> instance = new SimpleMapper(TestStringDocument.class);
        TestStringDocument result = instance.getExtension(packet);
        assertNull("Extension was not put, so result of get must be null",
                result);
    }
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

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.