mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Change Element.toXml() to toXml(String enclosingNamespace)
This commit is contained in:
parent
380f9a2b72
commit
5ab2903c32
229 changed files with 634 additions and 536 deletions
|
@ -211,19 +211,19 @@ public class MultipleRecipientManager {
|
|||
if (to != null) {
|
||||
for (Jid jid : to) {
|
||||
packet.setTo(jid);
|
||||
connection.sendStanza(new PacketCopy(packet.toXML()));
|
||||
connection.sendStanza(new PacketCopy(packet.toXML(null)));
|
||||
}
|
||||
}
|
||||
if (cc != null) {
|
||||
for (Jid jid : cc) {
|
||||
packet.setTo(jid);
|
||||
connection.sendStanza(new PacketCopy(packet.toXML()));
|
||||
connection.sendStanza(new PacketCopy(packet.toXML(null)));
|
||||
}
|
||||
}
|
||||
if (bcc != null) {
|
||||
for (Jid jid : bcc) {
|
||||
packet.setTo(jid);
|
||||
connection.sendStanza(new PacketCopy(packet.toXML()));
|
||||
connection.sendStanza(new PacketCopy(packet.toXML(null)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,13 +309,13 @@ public class MultipleRecipientManager {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return toXML().toString();
|
||||
return toXML(null).toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -118,12 +118,12 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.rightAngleBracket();
|
||||
// Loop through all the addresses and append them to the string buffer
|
||||
for (Address address : addresses) {
|
||||
buf.append(address.toXML());
|
||||
buf.append(address.toXML(null));
|
||||
}
|
||||
buf.closeElement(this);
|
||||
return buf;
|
||||
|
@ -194,7 +194,7 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder();
|
||||
buf.halfOpenElement(this).attribute("type", type);
|
||||
buf.optAttribute("jid", jid);
|
||||
|
|
|
@ -154,7 +154,7 @@ public class AMPExtension implements ExtensionElement {
|
|||
* Returns the XML representation of a XHTML extension according the specification.
|
||||
**/
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append('"');
|
||||
if (status != null) {
|
||||
|
|
|
@ -69,7 +69,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append('<').append(getElementName()).append(" xmlns=\"").append(
|
||||
getNamespace()).append("\"/>");
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BlockedErrorExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.closeEmptyElement();
|
||||
return xml;
|
||||
|
|
|
@ -68,7 +68,7 @@ public class BoBExtension extends XHTMLExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this));
|
||||
xml.closeElement(this);
|
||||
return xml;
|
||||
|
|
|
@ -232,11 +232,11 @@ public class Bytestream extends IQ {
|
|||
xml.rightAngleBracket();
|
||||
if (getToActivate() == null) {
|
||||
for (StreamHost streamHost : getStreamHosts()) {
|
||||
xml.append(streamHost.toXML());
|
||||
xml.append(streamHost.toXML(null));
|
||||
}
|
||||
}
|
||||
else {
|
||||
xml.append(getToActivate().toXML());
|
||||
xml.append(getToActivate().toXML(null));
|
||||
}
|
||||
break;
|
||||
case result:
|
||||
|
@ -246,7 +246,7 @@ public class Bytestream extends IQ {
|
|||
// constructions mechanisms of Bytestream
|
||||
// A result from the server can also contain stream hosts
|
||||
for (StreamHost host : streamHosts) {
|
||||
xml.append(host.toXML());
|
||||
xml.append(host.toXML(null));
|
||||
}
|
||||
break;
|
||||
case get:
|
||||
|
@ -325,7 +325,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("jid", getJID());
|
||||
xml.attribute("host", getAddress());
|
||||
|
@ -375,7 +375,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("jid", getJID());
|
||||
xml.closeEmptyElement();
|
||||
|
@ -418,7 +418,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.escape(getTarget());
|
||||
|
|
|
@ -132,7 +132,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
private static void writeInfoToFile(File file, DiscoverInfo info) throws IOException {
|
||||
DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
|
||||
try {
|
||||
dos.writeUTF(info.toXML().toString());
|
||||
dos.writeUTF(info.toXML(null).toString());
|
||||
} finally {
|
||||
dos.close();
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class CapsExtension implements ExtensionElement {
|
|||
*
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("hash", hash).attribute("node", node).attribute("ver", ver);
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ChatStateExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.closeEmptyElement();
|
||||
return xml;
|
||||
|
|
|
@ -95,7 +95,7 @@ public class AdHocCommandData extends IQ {
|
|||
}
|
||||
|
||||
if (form != null) {
|
||||
xml.append(form.toXML());
|
||||
xml.append(form.toXML(null));
|
||||
}
|
||||
|
||||
for (AdHocCommandNote note : notes) {
|
||||
|
@ -264,7 +264,7 @@ public class AdHocCommandData extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('<').append(getElementName());
|
||||
buf.append(" xmlns=\"").append(getNamespace()).append("\"/>");
|
||||
|
|
|
@ -102,7 +102,7 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("stamp", XmppDateTime.formatXEP0082Date(stamp));
|
||||
xml.optAttribute("from", from);
|
||||
|
|
|
@ -66,11 +66,11 @@ public class Forwarded implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement(getDelayInformation());
|
||||
xml.append(forwardedPacket.toXML());
|
||||
xml.append(forwardedPacket.toXML(null));
|
||||
xml.closeElement(this);
|
||||
return xml;
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ public final class GeoLocation implements Serializable, ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement("accuracy", accuracy);
|
||||
|
|
|
@ -115,7 +115,7 @@ public class Registration extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
return '<' + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ public final class JingleContent implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute(CREATOR_ATTRIBUTE_NAME, creator);
|
||||
xml.optAttribute(DISPOSITION_ATTRIBUTE_NAME, disposition);
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
addExtraAttributes(xml);
|
||||
xml.rightAngleBracket();
|
||||
|
|
|
@ -66,7 +66,7 @@ public abstract class JingleContentTransport implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
addExtraAttributes(xml);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class JingleError implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.closeEmptyElement();
|
||||
return xml;
|
||||
|
|
|
@ -114,7 +114,7 @@ public class JingleReason implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
@ -143,7 +143,7 @@ public class JingleReason implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ public final class UnknownJingleContentDescription extends JingleContentDescript
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
return standardExtensionElement.toXML();
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
return standardExtensionElement.toXML(null);
|
||||
}
|
||||
|
||||
public StandardExtensionElement getStandardExtensionElement() {
|
||||
|
|
|
@ -41,8 +41,8 @@ public final class UnknownJingleContentTransport extends JingleContentTransport
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
return standardExtensionElement.toXML();
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
return standardExtensionElement.toXML(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -86,6 +86,6 @@ public class JingleIBBTransport extends JingleContentTransport {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.toXML().toString().hashCode();
|
||||
return this.toXML(null).toString().hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ public final class JingleS5BTransportCandidate extends JingleContentTransportCan
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.attribute(ATTR_CID, cid);
|
||||
|
|
|
@ -38,7 +38,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public final XmlStringBuilder toXML() {
|
||||
public final XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.attribute(ATTR_CID, getCandidateId());
|
||||
|
@ -53,7 +53,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
JingleS5BCandidateTransportInfo otherCandidateTransportInfo = (JingleS5BCandidateTransportInfo) other;
|
||||
return toXML().equals(otherCandidateTransportInfo.toXML());
|
||||
return toXML(null).equals(otherCandidateTransportInfo.toXML(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -102,7 +102,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.closeEmptyElement();
|
||||
|
@ -116,7 +116,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toXML().toString().hashCode();
|
||||
return toXML(null).toString().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.closeEmptyElement();
|
||||
|
@ -148,7 +148,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toXML().toString().hashCode();
|
||||
return toXML(null).toString().hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public class JivePropertiesExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
// Loop through all properties and write them out.
|
||||
|
|
|
@ -93,7 +93,7 @@ public class IdleElement implements ExtensionElement {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
return new XmlStringBuilder(this)
|
||||
.attribute(ATTR_SINCE, since)
|
||||
.closeEmptyElement();
|
||||
|
|
|
@ -68,7 +68,7 @@ public class MessageCorrectExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute(ID_TAG, getIdInitialMessage());
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
@ -161,7 +161,7 @@ public final class MultiUserChatManager extends Manager {
|
|||
if (mucUser.getInvite() != null) {
|
||||
EntityBareJid mucJid = message.getFrom().asEntityBareJidIfPossible();
|
||||
if (mucJid == null) {
|
||||
LOGGER.warning("Invite to non bare JID: '" + message.toXML() + "'");
|
||||
LOGGER.warning("Invite to non bare JID: '" + message.toXML(null) + "'");
|
||||
return;
|
||||
}
|
||||
// Fire event for invitation listeners
|
||||
|
|
|
@ -152,7 +152,7 @@ public class RoomInfo {
|
|||
if (!identities.isEmpty()) {
|
||||
this.name = identities.get(0).getName();
|
||||
} else {
|
||||
LOGGER.warning("DiscoverInfo does not contain any Identity: " + info.toXML());
|
||||
LOGGER.warning("DiscoverInfo does not contain any Identity: " + info.toXML(null));
|
||||
this.name = "";
|
||||
}
|
||||
String subject = "";
|
||||
|
|
|
@ -69,7 +69,7 @@ public class Destroy implements NamedElement, Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("jid", getJid());
|
||||
xml.rightAngleBracket();
|
||||
|
|
|
@ -104,7 +104,7 @@ public class GroupChatInvitation implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("jid", getRoomAddress());
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
@ -71,7 +71,7 @@ public class MUCAdmin extends IQ {
|
|||
|
||||
synchronized (items) {
|
||||
for (MUCItem item : items) {
|
||||
xml.append(item.toXML());
|
||||
xml.append(item.toXML(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class MUCInitialPresence implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement("password", getPassword());
|
||||
|
@ -286,7 +286,7 @@ public class MUCInitialPresence implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optIntAttribute("maxchars", getMaxChars());
|
||||
xml.optIntAttribute("maxstanzas", getMaxStanzas());
|
||||
|
|
|
@ -161,7 +161,7 @@ public class MUCItem implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("affiliation", getAffiliation());
|
||||
xml.optAttribute("jid", getJid());
|
||||
|
|
|
@ -93,7 +93,7 @@ public class MUCOwner extends IQ {
|
|||
|
||||
synchronized (items) {
|
||||
for (MUCItem item : items) {
|
||||
xml.append(item.toXML());
|
||||
xml.append(item.toXML(null));
|
||||
}
|
||||
}
|
||||
xml.optElement(getDestroy());
|
||||
|
|
|
@ -61,7 +61,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement(getInvite());
|
||||
|
@ -301,7 +301,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("to", getTo());
|
||||
xml.optAttribute("from", getFrom());
|
||||
|
@ -369,7 +369,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("to", getTo());
|
||||
xml.optAttribute("from", getFrom());
|
||||
|
@ -439,7 +439,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("code", getCode());
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
@ -87,7 +87,7 @@ public class Nick implements ExtensionElement {
|
|||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
final StringBuilder buf = new StringBuilder();
|
||||
|
||||
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(
|
||||
|
|
|
@ -82,7 +82,7 @@ public class OfflineMessageInfo implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
|
||||
"\">");
|
||||
|
|
|
@ -174,7 +174,7 @@ public class Affiliation implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("node", node);
|
||||
xml.optAttribute("jid", jid);
|
||||
|
|
|
@ -61,9 +61,9 @@ public class AffiliationsExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
if ((items == null) || (items.size() == 0)) {
|
||||
return super.toXML();
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
else {
|
||||
// Can't use XmlStringBuilder(this), because we don't want the namespace to be included
|
||||
|
|
|
@ -76,10 +76,10 @@ public class EventElement implements EmbeddedPacketExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.append(ext.toXML());
|
||||
xml.append(ext.toXML(null));
|
||||
xml.closeElement(this);
|
||||
return xml;
|
||||
}
|
||||
|
|
|
@ -69,9 +69,9 @@ public class FormNode extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
if (configForm == null) {
|
||||
return super.toXML();
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
else {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
|
@ -84,7 +84,7 @@ public class FormNode extends NodeExtension {
|
|||
}
|
||||
else
|
||||
builder.append('>');
|
||||
builder.append(configForm.getDataFormToSend().toXML());
|
||||
builder.append(configForm.getDataFormToSend().toXML(null));
|
||||
builder.append("</");
|
||||
builder.append(getElementName() + '>');
|
||||
return builder.toString();
|
||||
|
|
|
@ -54,7 +54,7 @@ public class GetItemsRequest extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(getElementName());
|
||||
xml.attribute("node", getNode());
|
||||
|
|
|
@ -147,7 +147,7 @@ public class Item extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = getCommonXml();
|
||||
|
||||
xml.closeEmptyElement();
|
||||
|
@ -166,7 +166,7 @@ public class Item extends NodeExtension {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + " | Content [" + toXML() + "]";
|
||||
return getClass().getName() + " | Content [" + toXML(null) + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -149,9 +149,9 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
if ((items == null) || (items.size() == 0)) {
|
||||
return super.toXML();
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
else {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
|
@ -169,7 +169,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
else {
|
||||
builder.append("'>");
|
||||
for (NamedElement item : items) {
|
||||
builder.append(item.toXML());
|
||||
builder.append(item.toXML(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "Content [" + toXML() + "]";
|
||||
return getClass().getName() + "Content [" + toXML(null) + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -78,12 +78,12 @@ public class NodeExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
return '<' + getElementName() + (node == null ? "" : " node='" + node + '\'') + "/>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + " - content [" + toXML() + "]";
|
||||
return getClass().getName() + " - content [" + toXML(null) + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class OptionsExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(getElementName());
|
||||
xml.attribute("jid", jid);
|
||||
|
|
|
@ -130,11 +130,11 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = getCommonXml();
|
||||
|
||||
xml.rightAngleBracket();
|
||||
xml.append(payload.toXML());
|
||||
xml.append(payload.toXML(null));
|
||||
xml.closeElement(this);
|
||||
|
||||
return xml;
|
||||
|
@ -142,6 +142,6 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + " | Content [" + toXML() + "]";
|
||||
return getClass().getName() + " | Content [" + toXML(null) + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class PublishItem<T extends Item> extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
builder.append(getElementName());
|
||||
builder.append(" node='");
|
||||
|
@ -59,7 +59,7 @@ public class PublishItem<T extends Item> extends NodeExtension {
|
|||
builder.append("'>");
|
||||
|
||||
for (Item item : items) {
|
||||
builder.append(item.toXML());
|
||||
builder.append(item.toXML(null));
|
||||
}
|
||||
builder.append("</publish>");
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class RetractItem implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
return "<retract id='" + id + "'/>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,12 +93,12 @@ public class SimplePayload implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
return payload;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "payload [" + toXML() + "]";
|
||||
return getClass().getName() + "payload [" + toXML(null) + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class SubscribeExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
builder.append(getElementName());
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ public class Subscription extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder builder = new XmlStringBuilder(this);
|
||||
builder.attribute("jid", jid);
|
||||
|
||||
|
|
|
@ -91,9 +91,9 @@ public class SubscriptionsExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML() {
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
if ((items == null) || (items.size() == 0)) {
|
||||
return super.toXML();
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
else {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
|
@ -107,7 +107,7 @@ public class SubscriptionsExtension extends NodeExtension {
|
|||
builder.append('>');
|
||||
|
||||
for (Subscription item : items) {
|
||||
builder.append(item.toXML());
|
||||
builder.append(item.toXML(null));
|
||||
}
|
||||
|
||||
builder.append("</");
|
||||
|
|
|
@ -51,7 +51,7 @@ public class UnsubscribeExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(getElementName());
|
||||
xml.attribute("jid", jid);
|
||||
|
|
|
@ -59,7 +59,7 @@ public class DeliveryReceipt implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("id", id);
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
@ -47,7 +47,7 @@ public class DeliveryReceiptRequest implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
return "<request xmlns='" + DeliveryReceipt.NAMESPACE + "'/>";
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ public class RSMSet implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement("after", after);
|
||||
|
|
|
@ -55,7 +55,7 @@ public class Header implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
// Upcast to NamedElement since we don't want a xmlns attribute
|
||||
XmlStringBuilder xml = new XmlStringBuilder((NamedElement) this);
|
||||
xml.attribute("name", name);
|
||||
|
|
|
@ -59,7 +59,7 @@ public class HeadersExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.append(headers);
|
||||
|
|
|
@ -146,7 +146,7 @@ public class StreamInitiation extends IQ {
|
|||
buf.rightAngleBracket();
|
||||
|
||||
// Add the file section if there is one.
|
||||
buf.optAppend(file.toXML());
|
||||
buf.optAppend(file.toXML(null));
|
||||
break;
|
||||
case result:
|
||||
buf.rightAngleBracket();
|
||||
|
@ -155,7 +155,7 @@ public class StreamInitiation extends IQ {
|
|||
throw new IllegalArgumentException("IQ Type not understood");
|
||||
}
|
||||
if (featureNegotiation != null) {
|
||||
buf.append(featureNegotiation.toXML());
|
||||
buf.append(featureNegotiation.toXML(null));
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ public class StreamInitiation extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
|
||||
buffer.append('<').append(getElementName()).append(" xmlns=\"")
|
||||
|
@ -405,11 +405,11 @@ public class StreamInitiation extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML() {
|
||||
public String toXML(String enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf
|
||||
.append("<feature xmlns=\"http://jabber.org/protocol/feature-neg\">");
|
||||
buf.append(data.toXML());
|
||||
buf.append(data.toXML(null));
|
||||
buf.append("</feature>");
|
||||
return buf.toString();
|
||||
}
|
||||
|
|
|
@ -400,7 +400,7 @@ public class FormField implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
// Add attributes
|
||||
buf.optAttribute("label", getLabel());
|
||||
|
@ -416,7 +416,7 @@ public class FormField implements NamedElement {
|
|||
}
|
||||
// Loop through all the values and append them to the string buffer
|
||||
for (Option option : getOptions()) {
|
||||
buf.append(option.toXML());
|
||||
buf.append(option.toXML(null));
|
||||
}
|
||||
buf.optElement(validateElement);
|
||||
buf.closeElement(this);
|
||||
|
@ -434,12 +434,12 @@ public class FormField implements NamedElement {
|
|||
|
||||
FormField other = (FormField) obj;
|
||||
|
||||
return toXML().equals(other.toXML());
|
||||
return toXML(null).equals(other.toXML(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toXML().hashCode();
|
||||
return toXML(null).hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -492,7 +492,7 @@ public class FormField implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
// Add attribute
|
||||
xml.optAttribute("label", getLabel());
|
||||
|
|
|
@ -291,7 +291,7 @@ public class DataForm implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.attribute("type", getType());
|
||||
buf.rightAngleBracket();
|
||||
|
@ -310,10 +310,10 @@ public class DataForm implements ExtensionElement {
|
|||
}
|
||||
// Loop through all the form fields and append them to the string buffer
|
||||
for (FormField field : getFields()) {
|
||||
buf.append(field.toXML());
|
||||
buf.append(field.toXML(null));
|
||||
}
|
||||
for (Element element : extensionElements) {
|
||||
buf.append(element.toXML());
|
||||
buf.append(element.toXML(null));
|
||||
}
|
||||
buf.closeElement(this);
|
||||
return buf;
|
||||
|
@ -358,7 +358,7 @@ public class DataForm implements ExtensionElement {
|
|||
buf.openElement(ELEMENT);
|
||||
// Loop through all the form items and append them to the string buffer
|
||||
for (FormField field : getFields()) {
|
||||
buf.append(field.toXML());
|
||||
buf.append(field.toXML(null));
|
||||
}
|
||||
buf.closeElement(ELEMENT);
|
||||
return buf;
|
||||
|
@ -394,7 +394,7 @@ public class DataForm implements ExtensionElement {
|
|||
buf.openElement(ELEMENT);
|
||||
// Loop through all the form items and append them to the string buffer
|
||||
for (FormField field : getFields()) {
|
||||
buf.append(field.toXML());
|
||||
buf.append(field.toXML(null));
|
||||
}
|
||||
buf.closeElement(ELEMENT);
|
||||
return buf;
|
||||
|
|
|
@ -91,7 +91,7 @@ public class DataLayout implements ExtensionElement {
|
|||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optAttribute("label", getLabel());
|
||||
buf.rightAngleBracket();
|
||||
|
@ -109,7 +109,7 @@ public class DataLayout implements ExtensionElement {
|
|||
*/
|
||||
private static void walkList(XmlStringBuilder buf, List<DataFormLayoutElement> pageLayout) {
|
||||
for (DataFormLayoutElement object : pageLayout) {
|
||||
buf.append(object.toXML());
|
||||
buf.append(object.toXML(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ public class DataLayout implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.attribute("var", getVar());
|
||||
buf.closeEmptyElement();
|
||||
|
@ -187,7 +187,7 @@ public class DataLayout implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optAttribute("label", getLabel());
|
||||
buf.rightAngleBracket();
|
||||
|
@ -218,7 +218,7 @@ public class DataLayout implements ExtensionElement {
|
|||
public static final String ELEMENT = "reportedref";
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.closeEmptyElement();
|
||||
return buf;
|
||||
|
@ -244,7 +244,7 @@ public class DataLayout implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder();
|
||||
buf.element(ELEMENT, getText());
|
||||
return buf;
|
||||
|
|
|
@ -83,7 +83,7 @@ public abstract class ValidateElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optAttribute("datatype", datatype);
|
||||
buf.rightAngleBracket();
|
||||
|
@ -346,7 +346,7 @@ public abstract class ValidateElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optLongAttribute("min", getMin());
|
||||
buf.optLongAttribute("max", getMax());
|
||||
|
|
|
@ -81,7 +81,7 @@ public class XHTMLExtension implements ExtensionElement {
|
|||
*
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML() {
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
// Loop through all the bodies and append them to the string buffer
|
||||
|
|
|
@ -59,7 +59,7 @@ public class AMPExtensionTest {
|
|||
ext.addRule(new AMPExtension.Rule(AMPExtension.Action.notify, new AMPMatchResourceCondition(AMPMatchResourceCondition.Value.exact)));
|
||||
ext.addRule(new AMPExtension.Rule(AMPExtension.Action.notify, new AMPMatchResourceCondition(AMPMatchResourceCondition.Value.other)));
|
||||
|
||||
assertEquals(correctStanza, ext.toXML());
|
||||
assertEquals(correctStanza, ext.toXML(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -47,7 +47,7 @@ public class BlockContactsIQTest {
|
|||
BlockContactsIQ blockContactIQ = new BlockContactsIQ(jids);
|
||||
blockContactIQ.setStanzaId("block1");
|
||||
|
||||
Assert.assertEquals(blockContactIQExample, blockContactIQ.toXML().toString());
|
||||
Assert.assertEquals(blockContactIQExample, blockContactIQ.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -42,7 +42,7 @@ public class GetBlockingListTest {
|
|||
BlockListIQ getBlockListIQ = new BlockListIQ(null);
|
||||
getBlockListIQ.setType(Type.get);
|
||||
getBlockListIQ.setStanzaId("blocklist1");
|
||||
Assert.assertEquals(getBlockingListIQExample, getBlockListIQ.toXML().toString());
|
||||
Assert.assertEquals(getBlockingListIQExample, getBlockListIQ.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -53,7 +53,7 @@ public class UnblockContactsIQTest {
|
|||
UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ(jids);
|
||||
unblockContactIQ.setStanzaId("unblock1");
|
||||
|
||||
Assert.assertEquals(unblockContactIQExample, unblockContactIQ.toXML().toString());
|
||||
Assert.assertEquals(unblockContactIQExample, unblockContactIQ.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -68,7 +68,7 @@ public class UnblockContactsIQTest {
|
|||
public void checkUnblockAllIQStanza() throws Exception {
|
||||
UnblockContactsIQ unblockAllIQ = new UnblockContactsIQ(null);
|
||||
unblockAllIQ.setStanzaId("unblock2");
|
||||
Assert.assertEquals(unblockAllIQExample, unblockAllIQ.toXML().toString());
|
||||
Assert.assertEquals(unblockAllIQExample, unblockAllIQ.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -45,7 +45,7 @@ public class BoBIQTest extends SmackTestSuite {
|
|||
createdBoBIQ.setTo(JidCreate.from("ladymacbeth@shakespeare.lit/castle"));
|
||||
createdBoBIQ.setType(Type.get);
|
||||
|
||||
Assert.assertEquals(sampleBoBIQRequest, createdBoBIQ.toXML().toString());
|
||||
Assert.assertEquals(sampleBoBIQRequest, createdBoBIQ.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -65,7 +65,7 @@ public class BoBIQTest extends SmackTestSuite {
|
|||
Assert.assertEquals(bobIQ.getBoBData().getMaxAge(), createdBoBIQ.getBoBData().getMaxAge());
|
||||
Assert.assertEquals(bobIQ.getBoBData().getType(), createdBoBIQ.getBoBData().getType());
|
||||
Assert.assertEquals(bobIQ.getBoBData().getContentBase64Encoded(), createdBoBIQ.getBoBData().getContentBase64Encoded());
|
||||
Assert.assertEquals(bobIQ.toXML().toString(), createdBoBIQ.toXML().toString());
|
||||
Assert.assertEquals(bobIQ.toXML(null).toString(), createdBoBIQ.toXML(null).toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class CloseTest extends InitExtensions {
|
|||
close.setTo(JidCreate.from("juliet@capulet.lit/balcony"));
|
||||
close.setStanzaId("us71g45j");
|
||||
|
||||
assertXMLEqual(control, close.toXML().toString());
|
||||
assertXMLEqual(control, close.toXML(null).toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class DataPacketExtensionTest extends InitExtensions {
|
|||
.asString(outputProperties);
|
||||
|
||||
DataPacketExtension data = new DataPacketExtension("i781hf64", 0, "DATA");
|
||||
assertXMLEqual(control, data.toXML().toString());
|
||||
assertXMLEqual(control, data.toXML(null).toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class DataTest extends InitExtensions {
|
|||
data.setTo(JidCreate.from("juliet@capulet.lit/balcony"));
|
||||
data.setStanzaId("kr91n475");
|
||||
|
||||
assertXMLEqual(control, data.toXML().toString());
|
||||
assertXMLEqual(control, data.toXML(null).toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ public class OpenTest extends InitExtensions {
|
|||
open.setTo(JidCreate.from("juliet@capulet.lit/balcony"));
|
||||
open.setStanzaId("jn3h8g65");
|
||||
|
||||
assertXMLEqual(control, open.toXML().toString());
|
||||
assertXMLEqual(control, open.toXML(null).toString());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public class EntityCapsManagerTest extends InitExtensions {
|
|||
|
||||
DiscoverInfo restored_di = EntityCapsManager.getDiscoveryInfoByNodeVer(nodeVer);
|
||||
assertNotNull(restored_di);
|
||||
assertEquals(di.toXML().toString(), restored_di.toXML().toString());
|
||||
assertEquals(di.toXML(null).toString(), restored_di.toXML(null).toString());
|
||||
}
|
||||
|
||||
private static DiscoverInfo createComplexSamplePacket() throws XmppStringprepException {
|
||||
|
|
|
@ -56,7 +56,7 @@ public class FileTransferNegotiatorTest extends InitExtensions {
|
|||
// We do not expect an answer. This unit test only checks the request sent.
|
||||
}
|
||||
Stanza packet = connection.getSentPacket();
|
||||
String xml = packet.toXML().toString();
|
||||
String xml = packet.toXML(null).toString();
|
||||
assertTrue(xml.indexOf("var='stream-method' type='list-single'") != -1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class GeoLocationTest extends InitExtensions {
|
|||
GeoLocation geoLocation = messageWithGeoLocation.getExtension(GeoLocation.ELEMENT,
|
||||
GeoLocation.NAMESPACE);
|
||||
assertNotNull(geoLocation);
|
||||
assertNotNull(geoLocation.toXML());
|
||||
assertNotNull(geoLocation.toXML(null));
|
||||
|
||||
GeoLocation constructedGeoLocation = GeoLocation.builder().setAccuracy(23d).setAlt(1000d).setAltAccuracy(10d).setArea("Delhi").setBearing(
|
||||
10d).setBuilding("Small Building").setCountry("India").setCountryCode("IN").setDescription(
|
||||
|
@ -129,7 +129,7 @@ public class GeoLocationTest extends InitExtensions {
|
|||
"Wall Street").setText("Unit Testing GeoLocation").setTimestamp(
|
||||
XmppDateTime.parseDate("2004-02-19")).setTzo("+5:30").setUri(new URI("http://xmpp.org")).build();
|
||||
|
||||
assertEquals(constructedGeoLocation.toXML().toString(), geoLocation.toXML().toString());
|
||||
assertEquals(constructedGeoLocation.toXML(null).toString(), geoLocation.toXML(null).toString());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -65,12 +65,12 @@ public class JingleContentTest extends SmackTestSuite {
|
|||
builder.setDisposition("session");
|
||||
JingleContent content1 = builder.build();
|
||||
assertEquals("session", content1.getDisposition());
|
||||
assertNotSame(content.toXML().toString(), content1.toXML().toString());
|
||||
assertEquals(content1.toXML().toString(), builder.build().toXML().toString());
|
||||
assertNotSame(content.toXML(null).toString(), content1.toXML(null).toString());
|
||||
assertEquals(content1.toXML(null).toString(), builder.build().toXML(null).toString());
|
||||
|
||||
String xml =
|
||||
"<content creator='initiator' disposition='session' name='A name' senders='both'>" +
|
||||
"</content>";
|
||||
assertEquals(xml, content1.toXML().toString());
|
||||
assertEquals(xml, content1.toXML(null).toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,28 +34,28 @@ public class JingleErrorTest extends SmackTestSuite {
|
|||
public void tieBreakTest() throws Exception {
|
||||
String xml = "<tie-break xmlns='urn:xmpp:jingle:errors:1'/>";
|
||||
JingleError error = new JingleErrorProvider().parse(TestUtils.getParser(xml));
|
||||
assertEquals(xml, error.toXML().toString());
|
||||
assertEquals(xml, error.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unknownSessionTest() throws Exception {
|
||||
String xml = "<unknown-session xmlns='urn:xmpp:jingle:errors:1'/>";
|
||||
JingleError error = new JingleErrorProvider().parse(TestUtils.getParser(xml));
|
||||
assertEquals(xml, error.toXML().toString());
|
||||
assertEquals(xml, error.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unsupportedInfoTest() throws Exception {
|
||||
String xml = "<unsupported-info xmlns='urn:xmpp:jingle:errors:1'/>";
|
||||
JingleError error = new JingleErrorProvider().parse(TestUtils.getParser(xml));
|
||||
assertEquals(xml, error.toXML().toString());
|
||||
assertEquals(xml, error.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void outOfOrderTest() throws Exception {
|
||||
String xml = "<out-of-order xmlns='urn:xmpp:jingle:errors:1'/>";
|
||||
JingleError error = new JingleErrorProvider().parse(TestUtils.getParser(xml));
|
||||
assertEquals(xml, error.toXML().toString());
|
||||
assertEquals(xml, error.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
|
|
|
@ -32,39 +32,39 @@ public class JingleReasonTest extends SmackTestSuite {
|
|||
@Test
|
||||
public void parserTest() {
|
||||
assertEquals("<reason><success/></reason>",
|
||||
JingleReason.Success.toXML().toString());
|
||||
JingleReason.Success.toXML(null).toString());
|
||||
assertEquals("<reason><busy/></reason>",
|
||||
JingleReason.Busy.toXML().toString());
|
||||
JingleReason.Busy.toXML(null).toString());
|
||||
assertEquals("<reason><cancel/></reason>",
|
||||
JingleReason.Cancel.toXML().toString());
|
||||
JingleReason.Cancel.toXML(null).toString());
|
||||
assertEquals("<reason><connectivity-error/></reason>",
|
||||
JingleReason.ConnectivityError.toXML().toString());
|
||||
JingleReason.ConnectivityError.toXML(null).toString());
|
||||
assertEquals("<reason><decline/></reason>",
|
||||
JingleReason.Decline.toXML().toString());
|
||||
JingleReason.Decline.toXML(null).toString());
|
||||
assertEquals("<reason><expired/></reason>",
|
||||
JingleReason.Expired.toXML().toString());
|
||||
JingleReason.Expired.toXML(null).toString());
|
||||
assertEquals("<reason><unsupported-transports/></reason>",
|
||||
JingleReason.UnsupportedTransports.toXML().toString());
|
||||
JingleReason.UnsupportedTransports.toXML(null).toString());
|
||||
assertEquals("<reason><failed-transport/></reason>",
|
||||
JingleReason.FailedTransport.toXML().toString());
|
||||
JingleReason.FailedTransport.toXML(null).toString());
|
||||
assertEquals("<reason><general-error/></reason>",
|
||||
JingleReason.GeneralError.toXML().toString());
|
||||
JingleReason.GeneralError.toXML(null).toString());
|
||||
assertEquals("<reason><gone/></reason>",
|
||||
JingleReason.Gone.toXML().toString());
|
||||
JingleReason.Gone.toXML(null).toString());
|
||||
assertEquals("<reason><media-error/></reason>",
|
||||
JingleReason.MediaError.toXML().toString());
|
||||
JingleReason.MediaError.toXML(null).toString());
|
||||
assertEquals("<reason><security-error/></reason>",
|
||||
JingleReason.SecurityError.toXML().toString());
|
||||
JingleReason.SecurityError.toXML(null).toString());
|
||||
assertEquals("<reason><unsupported-applications/></reason>",
|
||||
JingleReason.UnsupportedApplications.toXML().toString());
|
||||
JingleReason.UnsupportedApplications.toXML(null).toString());
|
||||
assertEquals("<reason><timeout/></reason>",
|
||||
JingleReason.Timeout.toXML().toString());
|
||||
JingleReason.Timeout.toXML(null).toString());
|
||||
assertEquals("<reason><failed-application/></reason>",
|
||||
JingleReason.FailedApplication.toXML().toString());
|
||||
JingleReason.FailedApplication.toXML(null).toString());
|
||||
assertEquals("<reason><incompatible-parameters/></reason>",
|
||||
JingleReason.IncompatibleParameters.toXML().toString());
|
||||
JingleReason.IncompatibleParameters.toXML(null).toString());
|
||||
assertEquals("<reason><alternative-session><sid>1234</sid></alternative-session></reason>",
|
||||
JingleReason.AlternativeSession("1234").toXML().toString());
|
||||
JingleReason.AlternativeSession("1234").toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
|
|
|
@ -76,6 +76,6 @@ public class JingleTest extends SmackTestSuite {
|
|||
"action='session-initiate' " +
|
||||
"sid='" + sessionId + "'>" +
|
||||
"</jingle>";
|
||||
assertTrue(jingle.toXML().toString().contains(xml));
|
||||
assertTrue(jingle.toXML(null).toString().contains(xml));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class JingleIBBTransportTest extends SmackTestSuite {
|
|||
String xml = "<transport xmlns='urn:xmpp:jingle:transports:ibb:1' block-size='8192' sid='" + sid + "'/>";
|
||||
|
||||
JingleIBBTransport transport = new JingleIBBTransport(size, sid);
|
||||
assertEquals(xml, transport.toXML().toString());
|
||||
assertEquals(xml, transport.toXML(null).toString());
|
||||
assertEquals(size, transport.getBlockSize());
|
||||
assertEquals(sid, transport.getSessionId());
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class JingleIBBTransportTest extends SmackTestSuite {
|
|||
.parse(TestUtils.getParser(xml));
|
||||
assertEquals(transport, parsed);
|
||||
assertTrue(transport.equals(parsed));
|
||||
assertEquals(xml, parsed.toXML().toString());
|
||||
assertEquals(xml, parsed.toXML(null).toString());
|
||||
|
||||
JingleIBBTransport transport1 = new JingleIBBTransport((short) 1024);
|
||||
assertEquals((short) 1024, transport1.getBlockSize());
|
||||
|
|
|
@ -113,7 +113,7 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
|||
assertEquals(7878787, candidate3.getPriority());
|
||||
assertEquals(JingleS5BTransportCandidate.Type.proxy, candidate3.getType());
|
||||
|
||||
assertEquals(xml, transport.toXML().toString());
|
||||
assertEquals(xml, transport.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -129,7 +129,7 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
|||
assertEquals("vj3hs98y", candidateErrorTransport.getStreamId());
|
||||
assertEquals(JingleS5BTransportInfo.CandidateError.INSTANCE,
|
||||
candidateErrorTransport.getInfo());
|
||||
assertEquals(candidateError, candidateErrorTransport.toXML().toString());
|
||||
assertEquals(candidateError, candidateErrorTransport.toXML(null).toString());
|
||||
|
||||
String proxyError =
|
||||
"<transport xmlns='urn:xmpp:jingle:transports:s5b:1' sid='vj3hs98y'>" +
|
||||
|
@ -143,7 +143,7 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
|||
assertEquals("vj3hs98y", proxyErrorTransport.getStreamId());
|
||||
assertEquals(JingleS5BTransportInfo.ProxyError.INSTANCE,
|
||||
proxyErrorTransport.getInfo());
|
||||
assertEquals(proxyError, proxyErrorTransport.toXML().toString());
|
||||
assertEquals(proxyError, proxyErrorTransport.toXML(null).toString());
|
||||
|
||||
String candidateUsed =
|
||||
"<transport xmlns='urn:xmpp:jingle:transports:s5b:1' sid='vj3hs98y'>" +
|
||||
|
@ -157,7 +157,7 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
|||
assertEquals("hr65dqyd",
|
||||
((JingleS5BTransportInfo.CandidateUsed)
|
||||
candidateUsedTransport.getInfo()).getCandidateId());
|
||||
assertEquals(candidateUsed, candidateUsedTransport.toXML().toString());
|
||||
assertEquals(candidateUsed, candidateUsedTransport.toXML(null).toString());
|
||||
|
||||
String candidateActivated =
|
||||
"<transport xmlns='urn:xmpp:jingle:transports:s5b:1' sid='vj3hs98y'>" +
|
||||
|
@ -173,7 +173,7 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
|||
assertEquals("hr65dqyd",
|
||||
((JingleS5BTransportInfo.CandidateActivated)
|
||||
candidateActivatedTransport.getInfo()).getCandidateId());
|
||||
assertEquals(candidateActivated, candidateActivatedTransport.toXML().toString());
|
||||
assertEquals(candidateActivated, candidateActivatedTransport.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
|
@ -216,7 +216,7 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
|||
assertEquals(host, candidate.getHost());
|
||||
assertEquals(port, candidate.getPort());
|
||||
|
||||
assertEquals(streamHost.toXML().toString(), candidate.getStreamHost().toXML().toString());
|
||||
assertEquals(streamHost.toXML(null).toString(), candidate.getStreamHost().toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
|
|
|
@ -44,7 +44,7 @@ public class IdleTest extends SmackTestSuite {
|
|||
assertEquals(date, parsed.getSince());
|
||||
|
||||
IdleElement element = new IdleElement(date);
|
||||
assertXMLEqual("<idle xmlns='urn:xmpp:idle:1' since='1969-07-21T02:56:15.000+00:00'/>", element.toXML().toString());
|
||||
assertXMLEqual("<idle xmlns='urn:xmpp:idle:1' since='1969-07-21T02:56:15.000+00:00'/>", element.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -42,11 +42,11 @@ public class MessageCorrectExtensionTest {
|
|||
Message initialMessage = PacketParserUtils.parseStanza(initialMessageXml);
|
||||
MessageCorrectExtension messageCorrectExtension = new MessageCorrectExtension(idInitialMessage);
|
||||
|
||||
Assert.assertEquals(messageCorrectExtension.toXML().toString(), messageCorrectionXml);
|
||||
Assert.assertEquals(messageCorrectExtension.toXML(null).toString(), messageCorrectionXml);
|
||||
|
||||
initialMessage.addExtension(messageCorrectExtension);
|
||||
|
||||
Assert.assertEquals(initialMessage.toXML(), expectedXml);
|
||||
Assert.assertEquals(initialMessage.toXML(null), expectedXml);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public class AffiliationsExtensionTest {
|
|||
|
||||
AffiliationsExtension affiliationsExtension = new AffiliationsExtension(affiliationsList, "testNode");
|
||||
|
||||
CharSequence xml = affiliationsExtension.toXML();
|
||||
CharSequence xml = affiliationsExtension.toXML(null);
|
||||
|
||||
assertXMLEqual("<affiliations node='testNode'><affiliation xmlns='http://jabber.org/protocol/pubsub#owner' jid='one@exampleone.org' affiliation='member'/></affiliations>",
|
||||
xml.toString());
|
||||
|
|
|
@ -62,15 +62,15 @@ public class ItemValidationTest extends InitExtensions {
|
|||
public void verifyBasicItem() throws Exception {
|
||||
Item simpleItem = new Item();
|
||||
String simpleCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' />";
|
||||
assertXMLEqual(simpleCtrl, simpleItem.toXML().toString());
|
||||
assertXMLEqual(simpleCtrl, simpleItem.toXML(null).toString());
|
||||
|
||||
Item idItem = new Item("uniqueid");
|
||||
String idCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' id='uniqueid'/>";
|
||||
assertXMLEqual(idCtrl, idItem.toXML().toString());
|
||||
assertXMLEqual(idCtrl, idItem.toXML(null).toString());
|
||||
|
||||
Item itemWithNodeId = new Item("testId", "testNode");
|
||||
String nodeIdCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' id='testId' node='testNode' />";
|
||||
assertXMLEqual(nodeIdCtrl, itemWithNodeId.toXML().toString());
|
||||
assertXMLEqual(nodeIdCtrl, itemWithNodeId.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -78,16 +78,16 @@ public class ItemValidationTest extends InitExtensions {
|
|||
SimplePayload payload = new SimplePayload("<data xmlns='https://example.org'>This is the payload</data>");
|
||||
|
||||
PayloadItem<SimplePayload> simpleItem = new PayloadItem<>(payload);
|
||||
String simpleCtrl = "<item xmlns='http://jabber.org/protocol/pubsub'>" + payload.toXML() + "</item>";
|
||||
assertXMLEqual(simpleCtrl, simpleItem.toXML().toString());
|
||||
String simpleCtrl = "<item xmlns='http://jabber.org/protocol/pubsub'>" + payload.toXML(null) + "</item>";
|
||||
assertXMLEqual(simpleCtrl, simpleItem.toXML(null).toString());
|
||||
|
||||
PayloadItem<SimplePayload> idItem = new PayloadItem<>("uniqueid", payload);
|
||||
String idCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' id='uniqueid'>" + payload.toXML() + "</item>";
|
||||
assertXMLEqual(idCtrl, idItem.toXML().toString());
|
||||
String idCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' id='uniqueid'>" + payload.toXML(null) + "</item>";
|
||||
assertXMLEqual(idCtrl, idItem.toXML(null).toString());
|
||||
|
||||
PayloadItem<SimplePayload> itemWithNodeId = new PayloadItem<>("testId", "testNode", payload);
|
||||
String nodeIdCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' id='testId' node='testNode'>" + payload.toXML() + "</item>";
|
||||
assertXMLEqual(nodeIdCtrl, itemWithNodeId.toXML().toString());
|
||||
String nodeIdCtrl = "<item xmlns='http://jabber.org/protocol/pubsub' id='testId' node='testNode'>" + payload.toXML(null) + "</item>";
|
||||
assertXMLEqual(nodeIdCtrl, itemWithNodeId.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -145,7 +145,7 @@ public class ItemValidationTest extends InitExtensions {
|
|||
SimplePayload payload = (SimplePayload) item.getPayload();
|
||||
assertEquals("foo", payload.getElementName());
|
||||
assertEquals("smack:test", payload.getNamespace());
|
||||
assertXMLEqual(itemContent, payload.toXML().toString());
|
||||
assertXMLEqual(itemContent, payload.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -191,7 +191,7 @@ public class ItemValidationTest extends InitExtensions {
|
|||
SimplePayload payload = (SimplePayload) item.getPayload();
|
||||
assertEquals("entry", payload.getElementName());
|
||||
assertEquals("http://www.w3.org/2005/Atom", payload.getNamespace());
|
||||
assertXMLEqual(itemContent, payload.toXML().toString());
|
||||
assertXMLEqual(itemContent, payload.toXML(null).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -226,6 +226,6 @@ public class ItemValidationTest extends InitExtensions {
|
|||
assertEquals("testid1", item.getId());
|
||||
assertTrue(item.getPayload() instanceof SimplePayload);
|
||||
|
||||
assertXMLEqual(itemContent, item.getPayload().toXML().toString());
|
||||
assertXMLEqual(itemContent, item.getPayload().toXML(null).toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class PubSubNodeTest extends SmackTestSuite {
|
|||
assertEquals("http://jabber.org/protocol/pubsub#owner", request.getChildElementNamespace());
|
||||
assertEquals("pubsub", request.getChildElementName());
|
||||
|
||||
XmlPullParser parser = TestUtils.getIQParser(request.toXML().toString());
|
||||
XmlPullParser parser = TestUtils.getIQParser(request.toXML(null).toString());
|
||||
PubSub pubsubResult = (PubSub) PacketParserUtils.parseIQ(parser);
|
||||
SubscriptionsExtension subElem = pubsubResult.getExtension(PubSubElementType.SUBSCRIPTIONS_OWNER);
|
||||
List<Subscription> subscriptions = subElem.getSubscriptions();
|
||||
|
|
|
@ -29,6 +29,6 @@ public class SimplePayloadTest {
|
|||
|
||||
assertEquals("element", simplePayload.getElementName());
|
||||
assertEquals("https://example.org", simplePayload.getNamespace());
|
||||
assertEquals(xmlPayload, simplePayload.toXML());
|
||||
assertEquals(xmlPayload, simplePayload.toXML(null));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,8 +57,8 @@ public class DataFormTest {
|
|||
FormField field = new FormField("testField1");
|
||||
df.addField(field);
|
||||
|
||||
assertNotNull(df.toXML());
|
||||
String output = df.toXML().toString();
|
||||
assertNotNull(df.toXML(null));
|
||||
String output = df.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_1, output);
|
||||
|
||||
XmlPullParser parser = PacketParserUtils.getParserFor(output);
|
||||
|
@ -70,8 +70,8 @@ public class DataFormTest {
|
|||
assertEquals(1 , df.getFields().size());
|
||||
assertEquals(1 , df.getInstructions().size());
|
||||
|
||||
assertNotNull(df.toXML());
|
||||
output = df.toXML().toString();
|
||||
assertNotNull(df.toXML(null));
|
||||
output = df.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_1, output);
|
||||
}
|
||||
|
||||
|
@ -95,8 +95,8 @@ public class DataFormTest {
|
|||
df.addExtensionElement(layout);
|
||||
|
||||
|
||||
assertNotNull(df.toXML());
|
||||
String output = df.toXML().toString();
|
||||
assertNotNull(df.toXML(null));
|
||||
String output = df.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_2, output);
|
||||
|
||||
XmlPullParser parser = PacketParserUtils.getParserFor(output);
|
||||
|
@ -112,8 +112,8 @@ public class DataFormTest {
|
|||
|
||||
assertEquals(3 , layout.getPageLayout().size());
|
||||
|
||||
assertNotNull(df.toXML());
|
||||
output = df.toXML().toString();
|
||||
assertNotNull(df.toXML(null));
|
||||
output = df.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_2, output);
|
||||
}
|
||||
|
||||
|
@ -129,8 +129,8 @@ public class DataFormTest {
|
|||
ValidateElement dv = new RangeValidateElement("xs:integer","1111", "9999");
|
||||
field.setValidateElement(dv);
|
||||
|
||||
assertNotNull(df.toXML());
|
||||
String output = df.toXML().toString();
|
||||
assertNotNull(df.toXML(null));
|
||||
String output = df.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_3, output);
|
||||
|
||||
XmlPullParser parser = PacketParserUtils.getParserFor(output);
|
||||
|
@ -146,8 +146,8 @@ public class DataFormTest {
|
|||
|
||||
assertEquals("xs:integer" , dv.getDatatype());
|
||||
|
||||
assertNotNull(df.toXML());
|
||||
output = df.toXML().toString();
|
||||
assertNotNull(df.toXML(null));
|
||||
output = df.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_3, output);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,8 +80,8 @@ public class DataLayoutTest {
|
|||
layout.getPageLayout().add(section);
|
||||
layout.getPageLayout().add(new Text("PageText"));
|
||||
|
||||
assertNotNull(layout.toXML());
|
||||
String output = layout.toXML().toString();
|
||||
assertNotNull(layout.toXML(null));
|
||||
String output = layout.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_2, output);
|
||||
|
||||
XmlPullParser parser = PacketParserUtils.getParserFor(output);
|
||||
|
@ -91,8 +91,8 @@ public class DataLayoutTest {
|
|||
assertEquals(3 , layout.getPageLayout().size());
|
||||
assertEquals("Label", layout.getLabel());
|
||||
|
||||
assertNotNull(layout.toXML());
|
||||
output = layout.toXML().toString();
|
||||
assertNotNull(layout.toXML(null));
|
||||
output = layout.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_2, output);
|
||||
}
|
||||
|
||||
|
@ -114,8 +114,8 @@ public class DataLayoutTest {
|
|||
layout.getPageLayout().add(new Text("<html><font color='red'><em>DO NOT DELAY</em></font><br/>supply further information</html>"));
|
||||
|
||||
|
||||
assertNotNull(layout.toXML());
|
||||
String output = layout.toXML().toString();
|
||||
assertNotNull(layout.toXML(null));
|
||||
String output = layout.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_SPECIAL, output);
|
||||
|
||||
XmlPullParser parser = PacketParserUtils.getParserFor(output);
|
||||
|
@ -134,8 +134,8 @@ public class DataLayoutTest {
|
|||
assertEquals("<html><font color='red'><em>DO NOT DELAY</em></font><br/>supply further information</html>", text.getText());
|
||||
|
||||
|
||||
assertNotNull(layout.toXML());
|
||||
output = layout.toXML().toString();
|
||||
assertNotNull(layout.toXML(null));
|
||||
output = layout.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_SPECIAL, output);
|
||||
}
|
||||
|
||||
|
@ -165,8 +165,8 @@ public class DataLayoutTest {
|
|||
assertEquals("<html><font color='red'><em>DO NOT DELAY</em></font><br/>supply further information</html>", text.getText());
|
||||
|
||||
|
||||
assertNotNull(layout.toXML());
|
||||
String output = layout.toXML().toString();
|
||||
assertNotNull(layout.toXML(null));
|
||||
String output = layout.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_SPECIAL, output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ public class DataValidationTest {
|
|||
|
||||
ValidateElement dv = new BasicValidateElement(null);
|
||||
|
||||
assertNotNull(dv.toXML());
|
||||
String output = dv.toXML().toString();
|
||||
assertNotNull(dv.toXML(null));
|
||||
String output = dv.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_MIN, output);
|
||||
|
||||
XmlPullParser parser = getParser(TEST_INPUT_MIN);
|
||||
|
@ -64,8 +64,8 @@ public class DataValidationTest {
|
|||
assertEquals("xs:string", dv.getDatatype());
|
||||
assertTrue(dv instanceof BasicValidateElement);
|
||||
|
||||
assertNotNull(dv.toXML());
|
||||
output = dv.toXML().toString();
|
||||
assertNotNull(dv.toXML(null));
|
||||
output = dv.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_MIN, output);
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,8 @@ public class DataValidationTest {
|
|||
ListRange listRange = new ListRange(111L, 999L);
|
||||
dv.setListRange(listRange);
|
||||
|
||||
assertNotNull(dv.toXML());
|
||||
String output = dv.toXML().toString();
|
||||
assertNotNull(dv.toXML(null));
|
||||
String output = dv.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_RANGE, output);
|
||||
|
||||
XmlPullParser parser = getParser(output);
|
||||
|
@ -96,8 +96,8 @@ public class DataValidationTest {
|
|||
assertEquals(999, rdv.getListRange().getMax().intValue());
|
||||
|
||||
|
||||
assertNotNull(dv.toXML());
|
||||
output = dv.toXML().toString();
|
||||
assertNotNull(dv.toXML(null));
|
||||
output = dv.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_RANGE, output);
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,8 @@ public class DataValidationTest {
|
|||
|
||||
ValidateElement dv = new RangeValidateElement(null, null, null);
|
||||
|
||||
assertNotNull(dv.toXML());
|
||||
String output = dv.toXML().toString();
|
||||
assertNotNull(dv.toXML(null));
|
||||
String output = dv.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_RANGE2, output);
|
||||
|
||||
XmlPullParser parser = getParser(output);
|
||||
|
@ -121,8 +121,8 @@ public class DataValidationTest {
|
|||
assertEquals(null, rdv.getMin());
|
||||
assertEquals(null, rdv.getMax());
|
||||
|
||||
assertNotNull(rdv.toXML());
|
||||
output = rdv.toXML().toString();
|
||||
assertNotNull(rdv.toXML(null));
|
||||
output = rdv.toXML(null).toString();
|
||||
assertEquals(TEST_OUTPUT_RANGE2, output);
|
||||
}
|
||||
|
||||
|
|
|
@ -131,10 +131,10 @@ public class Protocol {
|
|||
|
||||
if (printProtocol) {
|
||||
System.out.println("------------------- Request -------------\n");
|
||||
System.out.println(XmlUtil.prettyFormatXml(request.toXML()));
|
||||
System.out.println(XmlUtil.prettyFormatXml(request.toXML(null)));
|
||||
System.out.println("------------------- Response ------------\n");
|
||||
if (response != null) {
|
||||
System.out.println(XmlUtil.prettyFormatXml(response.toXML()));
|
||||
System.out.println(XmlUtil.prettyFormatXml(response.toXML(null)));
|
||||
}
|
||||
else {
|
||||
System.out.println("No response");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue