Package org.apache.vysper.xmpp.stanza

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


       
        assertNull("future is create on execute", asyncIQGetHandler.getWaitingRunnableFuture());

        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(new EntityImpl("test", "vysper.org", null), null, IQStanzaType.GET, "id1");
        stanzaBuilder.startInnerElement("query").endInnerElement();
        Stanza iqStanza = stanzaBuilder.build();

        ResponseStanzaContainer container = asyncIQGetHandler.execute(iqStanza, sessionContext.getServerRuntimeContext(), true, sessionContext, sessionStateHolder);
        assertTrue(container == null || container.hasNoResponse());

        TriggeredRunnableFuture runnableFuture = asyncIQGetHandler.getWaitingRunnableFuture();
View Full Code Here


        sessionContext = new TestSessionContext(sessionStateHolder);
    }

    public void testAppropriateSessionState() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
        Stanza starttlsStanza = stanzaBuilder.build();

        TestSessionContext sessionContext = this.sessionContext;
        sessionContext.setServerToServer();

        sessionContext.setSessionState(SessionState.INITIATED);
View Full Code Here

   
    public void testNamespace() {
        sessionContext.setSessionState(SessionState.STARTED);
       
        StanzaBuilder stanzaBuilder = new StanzaBuilder("starttls", NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS);
        Stanza wrongNSStanza = stanzaBuilder.build();

        stanzaBuilder = new StanzaBuilder("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
        Stanza correctNSStanza = stanzaBuilder.build();

        TestSessionContext sessionContext = this.sessionContext;
View Full Code Here

       
        StanzaBuilder stanzaBuilder = new StanzaBuilder("starttls", NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS);
        Stanza wrongNSStanza = stanzaBuilder.build();

        stanzaBuilder = new StanzaBuilder("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
        Stanza correctNSStanza = stanzaBuilder.build();

        TestSessionContext sessionContext = this.sessionContext;

        Stanza responseStanza = executeStartTLSHandler(wrongNSStanza, sessionContext);
        XMLElementVerifier verifier = responseStanza.getVerifier();
View Full Code Here

        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

    public void testNotAcceptRegularStanzaBeyondAuthenticatedState_IQ() throws Exception {

        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        Stanza stanza = stanzaBuilder.build();

        assertNotAuthorized(stanza);
    }

    public void testNotAcceptRegularStanzaBeyondAuthenticatedState_Presence() throws Exception {
View Full Code Here

    public void testNotAcceptRegularStanzaBeyondAuthenticatedState_Presence() throws Exception {

        StanzaBuilder stanzaBuilder = new StanzaBuilder("presence", NamespaceURIs.JABBER_CLIENT);
        // TODO? add more presence specifics
        Stanza stanza = stanzaBuilder.build();

        assertNotAuthorized(stanza);
    }

    public void testNotAcceptRegularStanzaBeyondAuthenticatedState_Message() throws Exception {
View Full Code Here

    public void testNotAcceptRegularStanzaBeyondAuthenticatedState_Message() throws Exception {

        StanzaBuilder stanzaBuilder = new StanzaBuilder("message", NamespaceURIs.JABBER_CLIENT);
        // TODO? add more message specifics
        Stanza stanza = stanzaBuilder.build();

        assertNotAuthorized(stanza);
    }

    private void assertNotAuthorized(Stanza stanza) throws Exception {
View Full Code Here

        buildInnerElement(client, pubsub, stanzaBuilder, node);

        stanzaBuilder.endInnerElement();

        return stanzaBuilder.build();
    }
}
View Full Code Here

            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
            stanzaBuilder.startInnerElement("query", getNamespace());

            stanzaBuilder.endInnerElement();

            return stanzaBuilder.build();
        }
       
        @Override
        public Stanza getStanza(Entity client, Entity pubsub, String id, String node) {
            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
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.