Examples of nameEquals()


Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        IQHandler iqHandler = new IQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanza, sessionContext
                .getServerRuntimeContext(), true, sessionContext, null);
        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
        XMLElementVerifier verifier = responseStanza.getVerifier();
        assertTrue("error", verifier.nameEquals("error")); // response is _not_ IQ stanza
    }

    private void assertIQError(Stanza stanza) {
        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanza, sessionContext
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanza, sessionContext
                .getServerRuntimeContext(), true, sessionContext, null);
        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
        XMLElementVerifier verifier = responseStanza.getVerifier();
        assertTrue("iq", verifier.nameEquals("iq"));
        assertTrue("error type", verifier.attributeEquals("type", IQStanzaType.ERROR.value()));
        assertTrue("iq-error", verifier.subElementPresent("error"));
    }

    public void testMissingType() {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        assertTrue("iq-type-get", verifier.attributeEquals("type", "get"));

        // response is "result"
        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
        XMLElementVerifier responseVerifier = responseStanza.getVerifier();
        assertTrue("iq", responseVerifier.nameEquals("iq"));
        assertTrue("iq-id", responseVerifier.attributeEquals("id", "1"));
        assertTrue("iq-type-result", responseVerifier.attributeEquals("type", "result"));
    }

}
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza,
                sessionStateHolder);

        Stanza recordedResponse = sessionContext.getNextRecordedResponse();
        XMLElementVerifier verifier = recordedResponse.getVerifier();
        assertTrue("error", verifier.nameEquals("error"));
        assertTrue("unsupported stanza type", verifier.subElementPresent(StreamErrorCondition.UNSUPPORTED_STANZA_TYPE
                .value()));
    }

    public void testProcessStanzaNoResponse() {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        openClientSession();

        Stanza recordedResponse = sessionContext.getNextRecordedResponse();
        XMLElementVerifier responseVerifier = recordedResponse.getVerifier();

        assertTrue(responseVerifier.nameEquals("stream"));

        assertTrue(responseVerifier.attributeEquals(NamespaceURIs.XML, "lang", "fr"));

        assertTrue("initiated => started", sessionContext.getState() == SessionState.STARTED);
    }
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        XMPPVersion versionSent = new IllegalXMPPVersion("IllV1.0");
        Stanza response = getVersionResponse(versionSent);

        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.nameEquals("error"));
        assertTrue("error", responseVerifier.subElementPresent(StreamErrorCondition.UNSUPPORTED_VERSION.value()));
    }

    public void testProcessClientStreamOpeningResponse_Version_2_0() {
        sessionContext.setSessionState(getDefaultState());
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

        XMPPVersion versionSent = new XMPPVersion(2, 0);
        Stanza response = getVersionResponse(versionSent);

        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.nameEquals("error"));
        assertTrue("error", responseVerifier.subElementPresent(StreamErrorCondition.UNSUPPORTED_VERSION.value()));
    }

    protected Stanza getVersionResponse(XMPPVersion versionSent) {
        Stanza stanza = new ServerResponses().getStreamOpener(true, testFrom, null, versionSent, null).build();
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

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

        Stanza response = sessionContext.getNextRecordedResponse();
        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.nameEquals("error"));
        assertTrue("error", responseVerifier.subElementPresent(StreamErrorCondition.INVALID_NAMESPACE.value()));

    }

    public void testDontAcceptIQStanzaWhileNotAuthenticated() {
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

            Stanza response = sessionContext.getNextRecordedResponse();
            XMLElementVerifier xmlElementVerifier = response.getVerifier();

            // RFC3920/4.3: response must be "not-authorized"
            assertTrue("error stanza", xmlElementVerifier.nameEquals("error"));
            assertTrue("error stanza not-authorized", xmlElementVerifier
                    .subElementPresent(StanzaErrorCondition.NOT_AUTHORIZED.value()));
            assertTrue("writer had been closed", sessionContext.isClosed());
            assertEquals("session closed", SessionState.CLOSED, sessionContext.getState());
        }
View Full Code Here

Examples of org.apache.vysper.xml.fragment.XMLElementVerifier.nameEquals()

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

        Stanza response = sessionContext.getNextRecordedResponse();
        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.nameEquals("error"));
        assertTrue("error", responseVerifier.subElementPresent(StreamErrorCondition.NOT_AUTHORIZED.value()));
        assertTrue(sessionContext.isClosed());
    }

    /**
 
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.