summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-03-10 20:00:51 (GMT)
committerKevin Smith <git@kismith.co.uk>2015-03-12 21:48:21 (GMT)
commit158a5ca03eea87054c4cb19d7f0de872059c6000 (patch)
tree3a0955b3726526c11786b83783dde30154be81bd /test
parent91a69677c1ab752b867613c4f5666a5d97ba94f7 (diff)
downloadstroke-158a5ca03eea87054c4cb19d7f0de872059c6000.zip
stroke-158a5ca03eea87054c4cb19d7f0de872059c6000.tar.bz2
Add functionality for CapsInfo
Adds the Element, Parser, Serializer and CapsInfoSerializerTest. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Ported serializer test from Swiften, which passes. Change-Id: Iefc10f49732c835f1f17e5da00dabed899da975e
Diffstat (limited to 'test')
-rw-r--r--test/com/isode/stroke/serializer/payloadserializers/CapsInfoSerializerTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/com/isode/stroke/serializer/payloadserializers/CapsInfoSerializerTest.java b/test/com/isode/stroke/serializer/payloadserializers/CapsInfoSerializerTest.java
new file mode 100644
index 0000000..babaad1
--- /dev/null
+++ b/test/com/isode/stroke/serializer/payloadserializers/CapsInfoSerializerTest.java
@@ -0,0 +1,19 @@
+package com.isode.stroke.serializer.payloadserializers;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import src.com.isode.stroke.elements.CapsInfo;
+import src.com.isode.stroke.serializer.payloadserializers.CapsInfoSerializer;
+
+public class CapsInfoSerializerTest {
+
+ @Test
+ public void testSerialize() {
+ CapsInfoSerializer testling = new CapsInfoSerializer();
+ CapsInfo priority = new CapsInfo("http://swift.im", "myversion", "sha-1");
+ String expected = "<c hash=\"sha-1\" node=\"http://swift.im\" ver=\"myversion\" xmlns=\"http://jabber.org/protocol/caps\"/>";
+ assertEquals(expected, testling.serialize(priority));
+ }
+} \ No newline at end of file