Package org.apache.vysper.xmpp.stanza

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.addAttribute()


    }

    public void testUnsupportedType() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "bogus");
        assertIQError(stanzaBuilder.build());
    }

    public void testGetAndSetSubelements() {
        // get and set must have exactly one subelement
View Full Code Here


        assertNotTwoSubs(type); // test with two
    }

    private void assertNotTwoSubs(String type) {
        StanzaBuilder stanzaTwoSubs = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaTwoSubs.addAttribute("id", "1");
        stanzaTwoSubs.addAttribute("type", type);
        stanzaTwoSubs.startInnerElement("firstSub").endInnerElement();
        stanzaTwoSubs.startInnerElement("secondSub").endInnerElement();
        assertIQError(stanzaTwoSubs.build());
    }
View Full Code Here

    }

    private void assertNotTwoSubs(String type) {
        StanzaBuilder stanzaTwoSubs = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaTwoSubs.addAttribute("id", "1");
        stanzaTwoSubs.addAttribute("type", type);
        stanzaTwoSubs.startInnerElement("firstSub").endInnerElement();
        stanzaTwoSubs.startInnerElement("secondSub").endInnerElement();
        assertIQError(stanzaTwoSubs.build());
    }
View Full Code Here

        assertIQError(stanzaTwoSubs.build());
    }

    private void assertAnySub(String type) {
        StanzaBuilder stanzaNoSub = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaNoSub.addAttribute("id", "1");
        stanzaNoSub.addAttribute("type", type);
        assertIQError(stanzaNoSub.build());
    }

    public void testGet() {
View Full Code Here

    }

    private void assertAnySub(String type) {
        StanzaBuilder stanzaNoSub = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaNoSub.addAttribute("id", "1");
        stanzaNoSub.addAttribute("type", type);
        assertIQError(stanzaNoSub.build());
    }

    public void testGet() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
View Full Code Here

        assertIQError(stanzaNoSub.build());
    }

    public void testGet() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        stanzaBuilder.startInnerElement("getRequest").endInnerElement();

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.build(), sessionContext.getServerRuntimeContext(), true, sessionContext, null);
View Full Code Here

    }

    public void testGet() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        stanzaBuilder.startInnerElement("getRequest").endInnerElement();

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.build(), sessionContext.getServerRuntimeContext(), true, sessionContext, null);
        IQStanza incomingStanza = iqHandler.getIncomingStanza();
View Full Code Here

        return buildStanza(name, namespaceURI, null);
    }
   
    private Stanza buildStanza(String name, String namespaceURI, String to) {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        if(to != null) {
            stanzaBuilder.addAttribute("to", to);
        }
        stanzaBuilder.startInnerElement(name, namespaceURI).endInnerElement();
View Full Code Here

    }
   
    private Stanza buildStanza(String name, String namespaceURI, String to) {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        if(to != null) {
            stanzaBuilder.addAttribute("to", to);
        }
        stanzaBuilder.startInnerElement(name, namespaceURI).endInnerElement();
        Stanza stanza = stanzaBuilder.build();
View Full Code Here

    private Stanza buildStanza(String name, String namespaceURI, String to) {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        if(to != null) {
            stanzaBuilder.addAttribute("to", to);
        }
        stanzaBuilder.startInnerElement(name, namespaceURI).endInnerElement();
        Stanza stanza = stanzaBuilder.build();
        return stanza;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.