Examples of attributeEquals()


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

        } 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)) {
                return false;
            }
View Full Code Here

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

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

        Stanza receivedStanza = receiverUser.getNextStanza();
        XMLElementVerifier timestampVerifier = receivedStanza.getFirstInnerElement().getVerifier();
       
        assertTrue("stanza relayed to", receivedStanza.getVerifier().toAttributeEquals(receiverUser.getEntity().getFullQualifiedName()));
        assertTrue("stanza relayed inner", timestampVerifier.attributeEquals("value", timestamp));
        assertNotNull("from added", receivedStanza.getFrom());
        assertNotNull("from is full JID", receivedStanza.getFrom().equals(senderUser.getEntityFQ()));
        assertEquals("stanza relayed to correct receiver", receiverUser.getEntity(), receivedStanza.getTo());

    }
View Full Code Here

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

        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() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
View Full Code Here

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

        // 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.attributeEquals()

        // 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.attributeEquals()

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

    public void testProcessClientStreamOpeningResponse_XMLLang_fr() {
View Full Code Here

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

        XMPPVersion versionSent = XMPPVersion.VERSION_1_0;
        Stanza response = getVersionResponse(versionSent);

        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.attributeEquals("version", XMPPVersion.VERSION_1_0.toString()));
        assertTrue(responseVerifier.attributePresent("id"));
        assertFalse("no error", responseVerifier.subElementPresent("error"));
    }

    public void testProcessClientStreamOpeningResponse_NoVersion() {
View Full Code Here

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

        XMPPVersion versionSent = new XMPPVersion(1, 1);
        Stanza response = getVersionResponse(versionSent);

        XMLElementVerifier responseVerifier = response.getVerifier();
        assertTrue(responseVerifier.attributeEquals("version", XMPPVersion.VERSION_1_0.toString()));
        assertFalse("no error", responseVerifier.subElementPresent("error"));
    }

    protected class IllegalXMPPVersion extends XMPPVersion {
        protected String versionString;
View Full Code Here

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

        recordedResponse = sessionContext.getNextRecordedResponse();
        responseVerifier = recordedResponse.getVerifier();
        if (xmlLang == null) {
            assertFalse(responseVerifier.attributePresent(NamespaceURIs.XML, "lang"));
        } else {
            assertTrue(responseVerifier.attributeEquals(NamespaceURIs.XML, "lang", xmlLang));
        }
    }

    protected abstract SessionState getDefaultState();
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.