Examples of MXParser


Examples of org.xmlpull.mxp1.MXParser

    @Test(timeout=5000)
    public void testEmptyGroupRosterPush() throws Throwable {
        final String contactJID = "nurse@example.com";
        final Roster roster = connection.getRoster();
        assertNotNull("Can't get the roster from the provided connection!", roster);
        final MXParser parser = new MXParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
        final StringBuilder sb = new StringBuilder();
        sb.append("<iq id=\"rostertest2\" type=\"set\" ")
                .append("to=\"").append(connection.getUser()).append("\">")
                .append("<query xmlns=\"jabber:iq:roster\">")
                .append("<item jid=\"").append(contactJID).append("\">")
                .append("<group></group>")
                .append("</item>")
                .append("</query>")
                .append("</iq>");
        parser.setInput(new StringReader(sb.toString()));
        parser.next();
        final IQ rosterPush = PacketParserUtils.parseIQ(parser, connection);
        initRoster(connection, roster);
        rosterListener.reset();

        // Simulate receiving the roster push
View Full Code Here

Examples of org.xmlpull.mxp1.MXParser

            log.debug("Received empty transferobject. Discarding transferObject:"
                + transferObject.toString() + ")");
            return;
        }

        MXParser parser = new MXParser();
        PacketExtension extension = null;

        try {
            parser.setInput(new ByteArrayInputStream(data), "UTF-8");
            /*
             * We have to skip the empty start tag because Smack expects a
             * parser that already has started parsing.
             */
            parser.next();
            extension = provider.parseExtension(parser);

        } catch (XmlPullParserException e) {
            log.error("Unexpected encoding error:", e);
            return;
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.