Package org.apache.vysper.xmpp.stanza

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


     * call from a test method in subclass
     */
    protected void skeleton_testDontAcceptArbitraryStanzaWhileNotAuthenticated() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("arbitrary", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");

        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanzaBuilder.build(), sessionStateHolder);

        Stanza response = sessionContext.getNextRecordedResponse();
       
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", NamespaceURIs.JABBER_CLIENT).endInnerElement();
        stanzaTwoSubs.startInnerElement("secondSub", NamespaceURIs.JABBER_CLIENT).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", NamespaceURIs.JABBER_CLIENT).endInnerElement();

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.build(), sessionContext
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", NamespaceURIs.JABBER_CLIENT).endInnerElement();

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

    private static final String CLIENT_JID = "test@vysper.org/test";

    public void testStanzaError() throws ParsingException {
        StanzaBuilder builder = new StanzaBuilder("iq");
        builder.addAttribute("to", SERVER_JID);
        builder.addAttribute("from", CLIENT_JID);
        builder.startInnerElement("ping", NamespaceURIs.URN_XMPP_PING);
        builder.endInnerElement();

        Stanza request = builder.build();
View Full Code Here

    private static final String CLIENT_JID = "test@vysper.org/test";

    public void testStanzaError() throws ParsingException {
        StanzaBuilder builder = new StanzaBuilder("iq");
        builder.addAttribute("to", SERVER_JID);
        builder.addAttribute("from", CLIENT_JID);
        builder.startInnerElement("ping", NamespaceURIs.URN_XMPP_PING);
        builder.endInnerElement();

        Stanza request = builder.build();
        IQStanza requestIq = new IQStanza(request);
View Full Code Here

                from = new EntityImpl(sessionContext.getInitiatingEntity(), resource);
                StanzaBuilder stanzaBuilder = new StanzaBuilder(stanza.getName());
                for (Attribute attribute : stanza.getAttributes()) {
                    if ("from".equals(attribute.getName()))
                        continue;
                    stanzaBuilder.addAttribute(attribute);
                }
                stanzaBuilder.addAttribute("from", from.getFullQualifiedName());
                for (XMLElement preparedElement : stanza.getInnerElements()) {
                    stanzaBuilder.addPreparedElement(preparedElement);
                }
View Full Code Here

                for (Attribute attribute : stanza.getAttributes()) {
                    if ("from".equals(attribute.getName()))
                        continue;
                    stanzaBuilder.addAttribute(attribute);
                }
                stanzaBuilder.addAttribute("from", from.getFullQualifiedName());
                for (XMLElement preparedElement : stanza.getInnerElements()) {
                    stanzaBuilder.addPreparedElement(preparedElement);
                }
                stanza = XMPPCoreStanza.getWrapper(stanzaBuilder.build());
            }
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.