mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 11:05:28 -04:00
Updates tests to have updated message expectations
This commit is contained in:
parent
a642329314
commit
beae279b21
@ -412,7 +412,7 @@ public class JSONArrayTest {
|
||||
assertTrue("expected getBoolean to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[4] is not a boolean.",e.getMessage());
|
||||
"JSONArray[4] is not a boolean (class java.lang.String : hello).",e.getMessage());
|
||||
}
|
||||
try {
|
||||
jsonArray.get(-1);
|
||||
@ -426,42 +426,42 @@ public class JSONArrayTest {
|
||||
assertTrue("expected getDouble to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[4] is not a double.",e.getMessage());
|
||||
"JSONArray[4] is not a double (class java.lang.String : hello).",e.getMessage());
|
||||
}
|
||||
try {
|
||||
jsonArray.getInt(4);
|
||||
assertTrue("expected getInt to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[4] is not a int.",e.getMessage());
|
||||
"JSONArray[4] is not a int (class java.lang.String : hello).",e.getMessage());
|
||||
}
|
||||
try {
|
||||
jsonArray.getJSONArray(4);
|
||||
assertTrue("expected getJSONArray to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[4] is not a JSONArray.",e.getMessage());
|
||||
"JSONArray[4] is not a JSONArray (class java.lang.String : hello).",e.getMessage());
|
||||
}
|
||||
try {
|
||||
jsonArray.getJSONObject(4);
|
||||
assertTrue("expected getJSONObject to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[4] is not a JSONObject.",e.getMessage());
|
||||
"JSONArray[4] is not a JSONObject (class java.lang.String : hello).",e.getMessage());
|
||||
}
|
||||
try {
|
||||
jsonArray.getLong(4);
|
||||
assertTrue("expected getLong to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[4] is not a long.",e.getMessage());
|
||||
"JSONArray[4] is not a long (class java.lang.String : hello).",e.getMessage());
|
||||
}
|
||||
try {
|
||||
jsonArray.getString(5);
|
||||
assertTrue("expected getString to fail", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expected an exception message",
|
||||
"JSONArray[5] is not a String.",e.getMessage());
|
||||
"JSONArray[5] is not a String (class java.math.BigDecimal : 0.002345).",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class JSONMLTest {
|
||||
assertTrue("Expecting an exception", false);
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONArray[0] is not a String.",
|
||||
"JSONArray[0] is not a String (class org.json.JSONArray).",
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -1090,7 +1090,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a Boolean.",
|
||||
"JSONObject[\"stringKey\"] is not a Boolean (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1106,7 +1106,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"trueKey\"] is not a string.",
|
||||
"JSONObject[\"trueKey\"] is not a string (class java.lang.Boolean : true).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1122,7 +1122,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a double.",
|
||||
"JSONObject[\"stringKey\"] is not a double (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1138,7 +1138,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a float.",
|
||||
"JSONObject[\"stringKey\"] is not a float (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1154,7 +1154,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a int.",
|
||||
"JSONObject[\"stringKey\"] is not a int (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1170,7 +1170,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a long.",
|
||||
"JSONObject[\"stringKey\"] is not a long (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1186,7 +1186,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a JSONArray.",
|
||||
"JSONObject[\"stringKey\"] is not a JSONArray (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
try {
|
||||
@ -1202,7 +1202,7 @@ public class JSONObjectTest {
|
||||
fail("Expected an exception");
|
||||
} catch (JSONException e) {
|
||||
assertEquals("Expecting an exception message",
|
||||
"JSONObject[\"stringKey\"] is not a JSONObject.",
|
||||
"JSONObject[\"stringKey\"] is not a JSONObject (class java.lang.String : hello world!).",
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user