1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-15 03:59:38 +02:00

Make XHMTMLExtensionProvider use parseElement()

which makes the whole provider much simpler.

Also use CharSequence as Base for XHTML-IM bodies.
This commit is contained in:
Florian Schmaus 2014-07-05 15:04:35 +02:00
parent 94a16ba41e
commit 54b18e3575
5 changed files with 25 additions and 109 deletions

View file

@ -17,11 +17,11 @@
package org.jivesoftware.smackx.xhtmlim.provider;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.xhtmlim.packet.XHTMLExtension;
import org.junit.Test;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException;
@ -36,8 +36,7 @@ public class XHTMLExtensionProviderTest {
@Test
public void parsesWell() throws IOException, XmlPullParserException {
XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
XmlPullParser parser = PacketParserUtils.newXmppParser();
parser.setInput(getClass().getResourceAsStream(XHTML_EXTENSION_SAMPLE_RESOURCE_NAME), "UTF-8");
parser.next();