summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Young <consult.awy@gmail.com>2016-09-13 08:47:18 (GMT)
committerAlan Young <consult.awy@gmail.com>2016-09-13 09:42:12 (GMT)
commit0794a4c6cc50b087bf12622ed6830f93e9250481 (patch)
treebd1aed3c117c209ae42258444ef5f6c0fc53b944 /test/com/isode/stroke/jid/JIDTest.java
parent4e70a84a8a792cfeae96bf7a0cb4c9b549e44d29 (diff)
downloadstroke-0794a4c6cc50b087bf12622ed6830f93e9250481.zip
stroke-0794a4c6cc50b087bf12622ed6830f93e9250481.tar.bz2
Rework JID class internal representation of resource presence.
Remove explicit hasResource_ boolean and use non-null status of resource_ instead. Mostly test this with isBare(). Tidy up compare() method. A JID is valid by default. Remove extraneous setting of valid_ and centralize testing of validity to nameprepAndSetComponents(). Ensure that resource_ is initialized to null by default so that it is correct when a JID instance is restored using some sort of serialization, including com.google.gson.Gson which is used by Swift. All JID test cases pass, including ones using invalid "x@y/" test string representations. Change-Id: Ib77a7cde03e8390c405633cddea5939aa9e0b576
Diffstat (limited to 'test/com/isode/stroke/jid/JIDTest.java')
-rw-r--r--test/com/isode/stroke/jid/JIDTest.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/com/isode/stroke/jid/JIDTest.java b/test/com/isode/stroke/jid/JIDTest.java
index 69bee05..758bd5f 100644
--- a/test/com/isode/stroke/jid/JIDTest.java
+++ b/test/com/isode/stroke/jid/JIDTest.java
@@ -51,7 +51,7 @@ public class JIDTest {
public void testConstructorWithString_EmptyResource() {
JID testling = new JID("bar/");
- assertTrue(testling.isValid());
+ assertFalse(testling.isValid());
assertFalse(testling.isBare());
}