mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-10 07:01:07 +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:
parent
beecb8a675
commit
3647a7fce5
24 changed files with 215 additions and 291 deletions
|
|
@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals;
|
|||
import java.util.Properties;
|
||||
|
||||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
import org.jivesoftware.smack.test.util.TestUtils;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
import org.jivesoftware.smackx.carbons.packet.CarbonExtension;
|
||||
import org.jivesoftware.smackx.carbons.provider.CarbonManagerProvider;
|
||||
import org.jivesoftware.smackx.forward.Forwarded;
|
||||
|
|
@ -58,7 +58,7 @@ public class CarbonTest {
|
|||
.a("from", "romeo@montague.com")
|
||||
.asString(outputProperties);
|
||||
|
||||
parser = TestUtils.getParser(control, "sent");
|
||||
parser = PacketParserUtils.getParserFor(control);
|
||||
cc = (CarbonExtension) new CarbonManagerProvider().parseExtension(parser);
|
||||
fwd = cc.getForwarded();
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ public class CarbonTest {
|
|||
.a("from", "romeo@montague.com")
|
||||
.asString(outputProperties);
|
||||
|
||||
parser = TestUtils.getParser(control, "received");
|
||||
parser = PacketParserUtils.getParserFor(control);
|
||||
cc = (CarbonExtension) new CarbonManagerProvider().parseExtension(parser);
|
||||
|
||||
assertEquals(CarbonExtension.Direction.received, cc.getDirection());
|
||||
|
|
@ -108,7 +108,7 @@ public class CarbonTest {
|
|||
.a("xmlns", "urn:xmpp:forwarded:0")
|
||||
.asString(outputProperties);
|
||||
|
||||
parser = TestUtils.getParser(control, "sent");
|
||||
parser = PacketParserUtils.getParserFor(control);
|
||||
new CarbonManagerProvider().parseExtension(parser);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue