summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-16 21:51:13 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-07-28 10:41:23 (GMT)
commit6f84f6a65b8b80e2f599dff76da0cd13fbead611 (patch)
tree9a4b503a82d58cfc4884817945fcd26a0c0f9ba4 /test/com/isode/stroke/serializer/AuthResponseSerializerTest.java
parent9a419f5fff0701e672e241a515ce3e91438b3e1b (diff)
downloadstroke-6f84f6a65b8b80e2f599dff76da0cd13fbead611.zip
stroke-6f84f6a65b8b80e2f599dff76da0cd13fbead611.tar.bz2
Update Serializers and Parsers.
Updates Serializers and Parsers along with one minor change in XMPPlayer. Update Non Payload Serializers to return SafeByteArray. Updates SafeByteArray to return SafeByteArray on append and plus method. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: None. Change-Id: I6fe665a26b10cac37b3e3acd9ec15c211ac9b8ab
Diffstat (limited to 'test/com/isode/stroke/serializer/AuthResponseSerializerTest.java')
-rw-r--r--test/com/isode/stroke/serializer/AuthResponseSerializerTest.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/com/isode/stroke/serializer/AuthResponseSerializerTest.java b/test/com/isode/stroke/serializer/AuthResponseSerializerTest.java
index 9b0fe71..a80dc81 100644
--- a/test/com/isode/stroke/serializer/AuthResponseSerializerTest.java
+++ b/test/com/isode/stroke/serializer/AuthResponseSerializerTest.java
@@ -16,6 +16,7 @@ import org.junit.Test;
import com.isode.stroke.serializer.AuthResponseSerializer;
import com.isode.stroke.elements.AuthResponse;
import com.isode.stroke.base.ByteArray;
+import com.isode.stroke.base.SafeByteArray;
public class AuthResponseSerializerTest {
@@ -30,12 +31,12 @@ public class AuthResponseSerializerTest {
public void testSerialize() {
AuthResponseSerializer testling = new AuthResponseSerializer();
AuthResponse authResponse = new AuthResponse();
- authResponse.setValue(new ByteArray("foo"));
+ authResponse.setValue(new SafeByteArray("foo"));
assertEquals(
- "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" +
+ new SafeByteArray("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" +
"Zm9v" +
- "</response>", testling.serialize(authResponse));
+ "</response>"), testling.serialize(authResponse));
}
@Test
@@ -44,19 +45,19 @@ public class AuthResponseSerializerTest {
AuthResponse authResponse = new AuthResponse();
assertEquals(
- "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" +
- "</response>", testling.serialize(authResponse));
+ new SafeByteArray("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" +
+ "</response>"), testling.serialize(authResponse));
}
@Test
public void testSerialize_EmptyMessage() {
AuthResponseSerializer testling = new AuthResponseSerializer();
AuthResponse authResponse = new AuthResponse();
- authResponse.setValue(new ByteArray());
+ authResponse.setValue(new SafeByteArray());
assertEquals(
- "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" +
+ new SafeByteArray("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" +
"" +
- "</response>", testling.serialize(authResponse));
+ "</response>"), testling.serialize(authResponse));
}
} \ No newline at end of file