mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 10:49:41 +02:00
Rework Smack Provider design
this is the first stop towards fixing "SMACK-65: parsing should look for depth", by providing the initial parsing depth to the provider. Some methods (.e.g parseMessage) now use the depth as abort condition, instead of a unclean String equals check. parseIQ() and parseExtension() where both renamed to parse. This also restricts the Exceptions thrown by the parse method, to just XmlPullParserException, IOException and SmackException (not really a big victory, but nevertheless a slight improvement). StreamFeatureProvider is now gone, we simply use PacketExtensionProvider for stream features.
This commit is contained in:
parent
d04517cd08
commit
6980c8e63d
137 changed files with 1101 additions and 841 deletions
|
@ -125,7 +125,7 @@ public class PrivacyProviderTest extends SmackTestCase {
|
|||
// Create the xml parser
|
||||
XmlPullParser parser = getParserFromXML(xml);
|
||||
// Create a packet from the xml
|
||||
Privacy packet = (Privacy) (new PrivacyProvider()).parseIQ(parser);
|
||||
Privacy packet = (Privacy) (new PrivacyProvider()).parse(parser);
|
||||
|
||||
// check if it exist
|
||||
assertNotNull(packet);
|
||||
|
@ -317,7 +317,7 @@ public class PrivacyProviderTest extends SmackTestCase {
|
|||
// Create the xml parser
|
||||
XmlPullParser parser = getParserFromXML(xml);
|
||||
// Create a packet from the xml
|
||||
Privacy packet = (Privacy) (new PrivacyProvider()).parseIQ(parser);
|
||||
Privacy packet = (Privacy) (new PrivacyProvider()).parse(parser);
|
||||
|
||||
assertNotNull(packet);
|
||||
assertNotNull(packet.getChildElementXML());
|
||||
|
@ -356,7 +356,7 @@ public class PrivacyProviderTest extends SmackTestCase {
|
|||
// Create the xml parser
|
||||
XmlPullParser parser = getParserFromXML(xml);
|
||||
// Create a packet from the xml
|
||||
Privacy packet = (Privacy) (new PrivacyProvider()).parseIQ(parser);
|
||||
Privacy packet = (Privacy) (new PrivacyProvider()).parse(parser);
|
||||
|
||||
assertNotNull(packet);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue