Examples of nameEquals()


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

            .addAttribute("version", XMPPVersion.VERSION_1_0.toString());
        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()

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

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

    private Stanza executeStartTLSHandler(Stanza starttlsStanza, TestSessionContext sessionContext) {
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()

            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

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

        Stanza response = sessionContext.getNextRecordedResponse();
       
        XMLElementVerifier responseVerifier = response.getVerifier();
        // 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()));
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.