Examples of nameEquals()


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

        if (from == null) {
            if (stanza.getFrom() != null) return false;
        } else {
            if (!stanza.getFrom().equals(from)) return false;
        }
        if (!xmlElementVerifier.nameEquals("presence")) return false;
        if (presenceType == null && xmlElementVerifier.attributePresent("type")) return false;
        if (presenceType != null && !xmlElementVerifier.attributeEquals("type", presenceType.value())) return false;
        try {
            if (show != null && !xmlElementVerifier.subElementPresent("show")
                    && !stanza.getSingleInnerElementsNamed("show").getSingleInnerText().getText().equals(show)) {
View Full Code Here

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

        field.addOption(new Option("2.", "due"));
        form.addField(field);
       
        XMLElement formElement = new DataFormEncoder().getXML(form);
        XMLElementVerifier formElementVerifier = formElement.getVerifier();
        formElementVerifier.nameEquals("x");
        formElementVerifier.attributeEquals("type", "form");
        formElementVerifier.subElementsPresentExact(3);
        formElementVerifier.subElementPresent("title");
        formElementVerifier.subElementPresent("instructions");
        formElementVerifier.subElementPresent("field");
View Full Code Here

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

        Stanza stanza = new StanzaBuilder("ProtocolWorkerProcessTestCase", "testNSURI").build();
        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()

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.build(), sessionContext.getServerRuntimeContext(), true, sessionContext, null);
        Stanza responseStanza = responseStanzaContainer.getResponseStanza();
        XMLElementVerifier verifier = responseStanza.getVerifier();
        assertTrue("error", verifier.nameEquals("error"));
    }

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

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.getServerRuntimeContext(), true, sessionContext, null);
View Full Code Here

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

    private void assertIQError(Stanza stanza) {
        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()

        sessionContext.setXMLLang("fr");
        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
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.