From 6a2c974581fca0d889fc5b9799ea7d9e7c2395c5 Mon Sep 17 00:00:00 2001 From: stleary Date: Sun, 12 Apr 2015 23:34:23 -0500 Subject: [PATCH] 90.9% coverage --- JSONObjectTest.java | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/JSONObjectTest.java b/JSONObjectTest.java index db4e153..824a674 100644 --- a/JSONObjectTest.java +++ b/JSONObjectTest.java @@ -650,39 +650,6 @@ public class JSONObjectTest { // TODO test wrap(package) } - @Test - public void jsonObjectEquals() { - String str = - "{"+ - "\"trueKey\":true,"+ - "\"falseKey\":false,"+ - "\"arrayKey\":[0,1,2],"+ - "\"objectKey\":{"+ - "\"myKey1\":\"myVal1\","+ - "\"myKey2\":\"myVal2\","+ - "\"myKey3\":\"myVal3\","+ - "\"myKey4\":\"myVal4\""+ - "}"+ - "}"; - String diffStr = - "{"+ - "\"arrayKey\":[0]"+ - "}"; - JSONObject jsonObject = new JSONObject(str); - JSONObject otherJsonObject = new JSONObject(str); - JSONObject unequalJsonObject = new JSONObject(diffStr); - assertTrue("equal JSONObjects should be equal", - jsonObject.equals(otherJsonObject)); - assertTrue("unequal JSONObjects should not be equal", - !jsonObject.equals(unequalJsonObject)); - - // make sure hashcode returns some interesting value - assertTrue("equal JSONObjects should have equal hashCode", - jsonObject.hashCode() == otherJsonObject.hashCode()); - assertTrue("unequal JSONObjects should have unequal hashCode", - jsonObject.hashCode() != unequalJsonObject.hashCode()); - } - @Test public void jsonObjectParsingErrors() { int tryCount = 0; @@ -869,13 +836,8 @@ public class JSONObjectTest { public void equals() { String str = "{\"key\":\"value\"}"; JSONObject aJsonObject = new JSONObject(str); - JSONObject bJsonObject = new JSONObject(str); assertTrue("Same JSONObject should be equal to itself", aJsonObject.equals(aJsonObject)); - assertTrue("JSONObjects with equal content should be equal", - aJsonObject.equals(bJsonObject)); - assertTrue("JSONObjects should not be equal to non J", - !aJsonObject.equals(new String())); } }