Package rocks.xmpp.core.stream.model

Examples of rocks.xmpp.core.stream.model.StreamError


    public void unmarshalSystemShutdown() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <system-shutdown\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof SystemShutdown);
    }
View Full Code Here


    public void unmarshalUndefinedCondition() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <undefined-condition\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof UndefinedCondition);
    }
View Full Code Here

    public void unmarshalUnsupportedEncoding() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <unsupported-encoding\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof UnsupportedEncoding);
    }
View Full Code Here

    public void unmarshalUnsupportedFeature() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <unsupported-feature\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof UnsupportedFeature);
    }
View Full Code Here

    public void unmarshalUnsupportedStanzaType() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <unsupported-stanza-type\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof UnsupportedStanzaType);
    }
View Full Code Here

    public void shouldUnmarshalUnsupportedVersion() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <unsupported-version\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof UnsupportedVersion);
    }
View Full Code Here

                "     <host-unknown\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "     <text xmlns='urn:ietf:params:xml:ns:xmpp-streams'\n" +
                "           xml:lang='en'>OPTIONAL descriptive text</text>" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertEquals(streamError.getText(), "OPTIONAL descriptive text");
        Assert.assertEquals(streamError.getLanguage(), "en");
        Assert.assertTrue(streamError.getCondition() instanceof HostUnknown);
    }
View Full Code Here

    public void unmarshalBadFormat() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <bad-format\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof BadFormat);
    }
View Full Code Here

    public void unmarshalBadNamespacePrefix() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <bad-namespace-prefix\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof BadNamespacePrefix);
    }
View Full Code Here

    public void unmarshalConflict() throws JAXBException, XMLStreamException {
        String xml = "<stream:error>\n" +
                "     <conflict\n" +
                "         xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>\n" +
                "   </stream:error>";
        StreamError streamError = unmarshal(xml, StreamError.class);
        Assert.assertTrue(streamError.getCondition() instanceof Conflict);
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.stream.model.StreamError

Copyright © 2018 www.massapicom. 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.