Package rocks.xmpp.extensions.httpbind.model

Examples of rocks.xmpp.extensions.httpbind.model.Body


        String xml = "<body condition='see-other-uri'\n" +
                "      type='terminate'\n" +
                "      xmlns='http://jabber.org/protocol/httpbind'>\n" +
                "  <uri>https://secure.jabber.org/xmppcm</uri>\n" +
                "</body>";
        Body body = unmarshal(xml, Body.class);
        Assert.assertEquals(body.getUri().toString(), "https://secure.jabber.org/xmppcm");
        Assert.assertEquals(body.getType(), Body.Type.TERMINATE);
        Assert.assertEquals(body.getCondition(), Body.Condition.SEE_OTHER_URI);
    }
View Full Code Here


    @Test
    public void unmarshalSystemShutdown() throws XMLStreamException, JAXBException {
        String xml = "<body type='terminate'\n" +
                "      condition='system-shutdown'\n" +
                "      xmlns='http://jabber.org/protocol/httpbind'/>";
        Body body = unmarshal(xml, Body.class);
        Assert.assertEquals(body.getType(), Body.Type.TERMINATE);
        Assert.assertEquals(body.getCondition(), Body.Condition.SYSTEM_SHUTDOWN);
    }
View Full Code Here

    @Test
    public void unmarshalUndefinedCondition() throws XMLStreamException, JAXBException {
        String xml = "<body type='terminate'\n" +
                "      condition='undefined-condition'\n" +
                "      xmlns='http://jabber.org/protocol/httpbind'/>";
        Body body = unmarshal(xml, Body.class);
        Assert.assertEquals(body.getType(), Body.Type.TERMINATE);
        Assert.assertEquals(body.getCondition(), Body.Condition.UNDEFINED_CONDITION);
    }
View Full Code Here

    @Test
    public void marshalBodyWithMultipleStanzas() throws XMLStreamException, JAXBException {
        IQ iq = new IQ("1", IQ.Type.GET);
        iq.setExtension(new Roster());
        Body body = Body.builder()
                .wrappedObjects(Arrays.<Object>asList(iq, new Presence())).build();

        Assert.assertEquals(marshal(body), "<body xmlns=\"http://jabber.org/protocol/httpbind\"><iq xmlns=\"jabber:client\" id=\"1\" type=\"get\"><query xmlns=\"jabber:iq:roster\"></query></iq><presence xmlns=\"jabber:client\"></presence></body>");
    }
View Full Code Here

    @Test
    public void testInsertionOrder() {

        BoshConnection boshConnection = new BoshConnection(new TestXmppSession(), BoshConnectionConfiguration.getDefault());

        Body body1 = Body.builder().build();
        boshConnection.unacknowledgedRequests.put(1L, body1);

        Body body2 = Body.builder().build();
        boshConnection.unacknowledgedRequests.put(2L, body2);

        Body body3 = Body.builder().build();
        boshConnection.unacknowledgedRequests.put(3L, body3);

        Body body4 = Body.builder().build();
        boshConnection.unacknowledgedRequests.put(4L, body4);

        Body body5 = Body.builder().build();
        boshConnection.unacknowledgedRequests.put(5L, body5);

        int i = 0;
        for (Body body : boshConnection.unacknowledgedRequests.values()) {
            switch (i) {
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.httpbind.model.Body

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.