summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Clayton <alex.clayton@isode.com>2016-03-21 15:41:42 (GMT)
committerAlex Clayton <alex.clayton@isode.com>2016-03-22 11:24:06 (GMT)
commit0ec7a2d8ab803b0e2df2c616f61d2b69b042561f (patch)
treec4c03f68cc001294a304ed23c923c6b8c37d0cb2 /test
parentaa5444b24c46f1e3a83682a59e71c780e2523160 (diff)
downloadstroke-0ec7a2d8ab803b0e2df2c616f61d2b69b042561f.zip
stroke-0ec7a2d8ab803b0e2df2c616f61d2b69b042561f.tar.bz2
Don't allow JIDs with explicitly empty resources
As per swiften patch of same name (6159c580884583bad0e17d4e96ea9ffc7e0be29a). A JID may have no resource, but may not have an empty resource. Mark such JIDs as invalid. Test-information: New unit test passes. Change-Id: I66ec7810ac29cb3963470b08f0d9f4901d2307f3
Diffstat (limited to 'test')
-rw-r--r--test/com/isode/stroke/jid/JIDTest.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/com/isode/stroke/jid/JIDTest.java b/test/com/isode/stroke/jid/JIDTest.java
index 96de429..69bee05 100644
--- a/test/com/isode/stroke/jid/JIDTest.java
+++ b/test/com/isode/stroke/jid/JIDTest.java
@@ -12,12 +12,10 @@
package com.isode.stroke.jid;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+
import org.junit.Test;
-import com.isode.stroke.jid.JID;
public class JIDTest {
@@ -155,6 +153,12 @@ public class JIDTest {
assertFalse(testling.isValid());
}
+
+ @Test
+ public void testConstructorWithStrings_EmptyResource() {
+ JID testling = new JID("foo","bar","");
+ assertFalse(testling.isValid());
+ }
@Test