Examples of nameEquals()


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

        // error might be wrapped within a stream opener
        if (responseVerifier.nameEquals("stream")) {
            responseVerifier = response.getFirstInnerElement().getVerifier();
        }
       
        assertTrue(responseVerifier.nameEquals("error"));
        assertTrue("error", responseVerifier.subElementPresent(StreamErrorCondition.UNSUPPORTED_STANZA_TYPE.value()));
        assertTrue(sessionContext.isClosed());
    }
}
View Full Code Here

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

        sessionContext.setServerToServer();

        sessionContext.setSessionState(SessionState.INITIATED);
        Stanza responseStanza = executeStartTLSHandler(starttlsStanza, sessionContext);
        XMLElementVerifier verifier = responseStanza.getVerifier();
        assertTrue("session state to low failure", verifier.nameEquals("failure"));
        assertFalse("tls init", sessionContext.isSwitchToTLSCalled());

        sessionContext.setSessionState(SessionState.ENCRYPTION_STARTED);
        responseStanza = executeStartTLSHandler(starttlsStanza, sessionContext);
        verifier = responseStanza.getVerifier();
View Full Code Here

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

        assertFalse("tls init", sessionContext.isSwitchToTLSCalled());

        sessionContext.setSessionState(SessionState.ENCRYPTION_STARTED);
        responseStanza = executeStartTLSHandler(starttlsStanza, sessionContext);
        verifier = responseStanza.getVerifier();
        assertTrue("session state too high failure", verifier.nameEquals("failure"));
        assertFalse("tls init", sessionContext.isSwitchToTLSCalled());

        sessionContext.setSessionState(SessionState.STARTED);
        responseStanza = executeStartTLSHandler(starttlsStanza, sessionContext);
        verifier = responseStanza.getVerifier();
View Full Code Here

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

        assertFalse("tls init", sessionContext.isSwitchToTLSCalled());

        sessionContext.setSessionState(SessionState.STARTED);
        responseStanza = executeStartTLSHandler(starttlsStanza, sessionContext);
        verifier = responseStanza.getVerifier();
        assertTrue("session state ready", verifier.nameEquals("proceed"));
        assertEquals("session stat is encryption started", SessionState.ENCRYPTION_STARTED, sessionStateHolder
                .getState());
        assertTrue("tls init", sessionContext.isSwitchToTLSCalled());
    }
View Full Code Here

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

        TestSessionContext sessionContext = this.sessionContext;

        Stanza responseStanza = executeStartTLSHandler(wrongNSStanza, sessionContext);
        XMLElementVerifier verifier = responseStanza.getVerifier();
        assertTrue("namespace wrong failure", verifier.nameEquals("failure"));
        assertFalse("tls init", sessionContext.isSwitchToTLSCalled());

        responseStanza = executeStartTLSHandler(correctNSStanza, sessionContext);
        verifier = responseStanza.getVerifier();
        assertTrue("namespace correct proceed", verifier.nameEquals("proceed"));
View Full Code Here

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

        assertTrue("namespace wrong failure", verifier.nameEquals("failure"));
        assertFalse("tls init", sessionContext.isSwitchToTLSCalled());

        responseStanza = executeStartTLSHandler(correctNSStanza, sessionContext);
        verifier = responseStanza.getVerifier();
        assertTrue("namespace correct proceed", verifier.nameEquals("proceed"));
        assertTrue("tls init", sessionContext.isSwitchToTLSCalled());
    }

}
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()

                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;
View Full Code Here

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

        XMLElementVerifier queryVerifier = queryElement.getVerifier();
        assertTrue(queryVerifier.subElementsPresentExact(4));
        List<XMLElement> innerElements = queryElement.getInnerElements();
        XMLElement xmlElement = innerElements.get(innerElements.size() - 1);
        XMLElementVerifier xmlElementVerifier = xmlElement.getVerifier();
        assertTrue(xmlElementVerifier.nameEquals("x"));
    }

}
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
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.