Package rocks.xmpp.extensions.messagecorrect.model

Examples of rocks.xmpp.extensions.messagecorrect.model.Replace


        }
        if (message == null) {
            throw new IllegalArgumentException("message must not be null");
        }

        message.getExtensions().add(new Replace(id));
        xmppSession.send(message);
    }
View Full Code Here


        String xml = "<message to='juliet@capulet.net/balcony' id='good1'>\n" +
                "  <body>But soft, what light through yonder window breaks?</body>\n" +
                "  <replace id='bad1' xmlns='urn:xmpp:message-correct:0'/>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        Replace replace = message.getExtension(Replace.class);
        Assert.assertNotNull(replace);
        Assert.assertEquals(replace.getId(), "bad1");
    }
View Full Code Here

        Assert.assertEquals(replace.getId(), "bad1");
    }

    @Test
    public void marshalReplace() throws JAXBException, XMLStreamException {
        String xml = marshal(new Replace("test"));
        Assert.assertEquals(xml, "<replace xmlns=\"urn:xmpp:message-correct:0\" id=\"test\"></replace>");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.messagecorrect.model.Replace

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.