1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-12 14:01:08 +01:00

Improve parsing. Add method for de-serializing Strings

Move some duplicate code from XMPP(TCP|BOSH)Connection to
PacketParserUtils. Remove TestUtils as the method now part of Smack's
public API in PacketParserUtils.
This commit is contained in:
Florian Schmaus 2014-05-25 23:31:58 +02:00
parent beecb8a675
commit 3647a7fce5
24 changed files with 215 additions and 291 deletions

View file

@ -23,7 +23,6 @@ import static org.junit.Assert.assertTrue;
import org.jivesoftware.smack.ThreadedDummyConnection;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.test.util.TestUtils;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
@ -95,7 +94,7 @@ public class ItemValidationTest extends InitExtensions {
@Test
public void parseBasicItem() throws Exception
{
XmlPullParser parser = TestUtils.getMessageParser(
XmlPullParser parser = PacketParserUtils.getParserFor(
"<message from='pubsub.myserver.com' to='francisco@denmark.lit' id='foo'>" +
"<event xmlns='http://jabber.org/protocol/pubsub#event'>" +
"<items node='testNode'>" +
@ -124,7 +123,7 @@ public class ItemValidationTest extends InitExtensions {
{
String itemContent = "<foo xmlns='smack:test'>Some text</foo>";
XmlPullParser parser = TestUtils.getMessageParser(
XmlPullParser parser = PacketParserUtils.getParserFor(
"<message from='pubsub.myserver.com' to='francisco@denmark.lit' id='foo'>" +
"<event xmlns='http://jabber.org/protocol/pubsub#event'>" +
"<items node='testNode'>" +
@ -171,7 +170,7 @@ public class ItemValidationTest extends InitExtensions {
"<updated>2003-12-13T18:30:02Z</updated>" +
"</entry>";
XmlPullParser parser = TestUtils.getMessageParser(
XmlPullParser parser = PacketParserUtils.getParserFor(
"<message from='pubsub.myserver.com' to='francisco@denmark.lit' id='foo'>" +
"<event xmlns='http://jabber.org/protocol/pubsub#event'>" +
"<items node='testNode'>" +
@ -204,7 +203,7 @@ public class ItemValidationTest extends InitExtensions {
{
String itemContent = "<foo xmlns='smack:test'><bar/></foo>";
XmlPullParser parser = TestUtils.getMessageParser(
XmlPullParser parser = PacketParserUtils.getParserFor(
"<message from='pubsub.myserver.com' to='francisco@denmark.lit' id='foo'>" +
"<event xmlns='http://jabber.org/protocol/pubsub#event'>" +
"<items node='testNode'>" +