summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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