Package rocks.xmpp.core.stanza.model.client

Examples of rocks.xmpp.core.stanza.model.client.Message


                messageReceived[0] = true;
                receivedId[0] = e.getMessageId();
            }
        });

        Message message = new Message(JULIET);
        message.setId("123");
        xmppSession1.send(message);

        Assert.assertTrue(messageReceived[0]);
        Assert.assertEquals(receivedId[0], "123");
    }
View Full Code Here


            public void messageDelivered(MessageDeliveredEvent e) {
                messageReceived[0] = true;
            }
        });

        Message message = new Message(JULIET);
        message.setId("123");
        xmppSession1.send(message);

        Assert.assertFalse(messageReceived[0]);
    }
View Full Code Here

            public void handle(MessageEvent e) {
                Assert.assertNull(e.getMessage().getExtension(Request.class));
            }
        });

        Message message = new Message(JULIET);
        xmppSession1.send(message);
    }
View Full Code Here

            public void handle(MessageEvent e) {
                Assert.assertNull(e.getMessage().getExtension(Request.class));
            }
        });

        Message message = new Message(JULIET);
        message.setType(Message.Type.ERROR);
        message.setId("123");
        xmppSession1.send(message);
    }
View Full Code Here

            public void handle(MessageEvent e) {
                Assert.assertNull(e.getMessage().getExtension(Request.class));
            }
        });

        Message message = new Message(JULIET);
        message.setId("123");
        xmppSession1.send(message);
    }
View Full Code Here

                "    to='romeo@example.net'\n" +
                "    type='chat'\n" +
                "    xml:lang='en'>\n" +
                "  <body>Wherefore art thou, Romeo?</body>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        Assert.assertEquals(message.getFrom().toString(), "juliet@example.com/balcony");
        Assert.assertEquals(message.getTo().toString(), "romeo@example.net");
        Assert.assertEquals(message.getType(), Message.Type.CHAT);
        Assert.assertEquals(message.getId(), "b4vs9km4");
        Assert.assertEquals(message.getLanguage(), "en");
        Assert.assertEquals(message.getBody(), "Wherefore art thou, Romeo?");
    }
View Full Code Here

                "    type='chat'\n" +
                "    xml:lang='en'>\n" +
                "  <body>Wherefore art thou, Romeo?</body>\n" +
                "  <body xml:lang='de'>Wo bist du, Romeo?</body>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        Assert.assertEquals(message.getFrom().toString(), "juliet@example.com/balcony");
        Assert.assertEquals(message.getTo().toString(), "romeo@example.net");
        Assert.assertEquals(message.getType(), Message.Type.CHAT);
        Assert.assertEquals(message.getId(), "z94nb37h");
        Assert.assertEquals(message.getLanguage(), "en");
        Assert.assertEquals(message.getBody(), "Wherefore art thou, Romeo?");
        Assert.assertEquals(message.getBodies().get(1).getText(), "Wo bist du, Romeo?");
    }
View Full Code Here

                "    type='chat'\n" +
                "    xml:lang='en'>\n" +
                "  <subject>I implore you!</subject>\n" +
                "  <body>Wherefore art thou, Romeo?</body>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        Assert.assertEquals(message.getFrom().toString(), "juliet@example.com/balcony");
        Assert.assertEquals(message.getTo().toString(), "romeo@example.net");
        Assert.assertEquals(message.getType(), Message.Type.CHAT);
        Assert.assertEquals(message.getId(), "c8xg3nf8");
        Assert.assertEquals(message.getLanguage(), "en");
        Assert.assertEquals(message.getSubject(), "I implore you!");
        Assert.assertEquals(message.getBody(), "Wherefore art thou, Romeo?");
    }
View Full Code Here

                "  <subject>I implore you!</subject>\n" +
                "  <subject xml:lang='de'>Ich flehe dich an!</subject>\n" +
                "  <body>Wherefore art thou, Romeo?</body>\n" +
                "  <body xml:lang='cs'>Wo bist du, Romeo?</body>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        Assert.assertEquals(message.getFrom().toString(), "juliet@example.com/balcony");
        Assert.assertEquals(message.getTo().toString(), "romeo@example.net");
        Assert.assertEquals(message.getType(), Message.Type.CHAT);
        Assert.assertEquals(message.getId(), "jk3v47gw");
        Assert.assertEquals(message.getLanguage(), "en");
        Assert.assertEquals(message.getSubject(), "I implore you!");
        Assert.assertEquals(message.getSubjects().get(1).getText(), "Ich flehe dich an!");
        Assert.assertEquals(message.getBody(), "Wherefore art thou, Romeo?");
        Assert.assertEquals(message.getBodies().get(1).getText(), "Wo bist du, Romeo?");
    }
View Full Code Here

                "    to='romeo@example.net'\n" +
                "    type='chat'\n" +
                "    xml:lang='en'>\n" +
                "  <thread parent='e0ffe42b28561960c6b12b944a092794b9683a38'>0e3141cd80894871a68e6fe6b1ec56fa</thread>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        Assert.assertEquals(message.getFrom().toString(), "juliet@example.com/balcony");
        Assert.assertEquals(message.getTo().toString(), "romeo@example.net");
        Assert.assertEquals(message.getType(), Message.Type.CHAT);
        Assert.assertNull(message.getId());
        Assert.assertEquals(message.getLanguage(), "en");
        Assert.assertEquals(message.getThread(), "0e3141cd80894871a68e6fe6b1ec56fa");
        Assert.assertEquals(message.getParentThread(), "e0ffe42b28561960c6b12b944a092794b9683a38");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.stanza.model.client.Message

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.