public interface JSONComparator
| Modifier and Type | Method and Description |
|---|---|
JSONCompareResult |
compareJSON(org.json.JSONArray expected,
org.json.JSONArray actual)
Compares two
JSONArrays and returns the result of the comparison in a JSONCompareResult object. |
JSONCompareResult |
compareJSON(org.json.JSONObject expected,
org.json.JSONObject actual)
Compares two
JSONObjects and returns the result of the comparison in a JSONCompareResult object. |
void |
compareJSON(String prefix,
org.json.JSONObject expected,
org.json.JSONObject actual,
JSONCompareResult result)
Compares two
JSONObjects on the provided path represented by prefix and
updates the result of the comparison in the result JSONCompareResult object. |
void |
compareJSONArray(String prefix,
org.json.JSONArray expected,
org.json.JSONArray actual,
JSONCompareResult result)
Compares two
JSONArrays on the provided path represented by prefix and
updates the result of the comparison in the result JSONCompareResult object. |
void |
compareValues(String prefix,
Object expectedValue,
Object actualValue,
JSONCompareResult result)
Compares two
Objects on the provided path represented by prefix and
updates the result of the comparison in the result JSONCompareResult object. |
JSONCompareResult compareJSON(org.json.JSONObject expected, org.json.JSONObject actual) throws org.json.JSONException
JSONObjects and returns the result of the comparison in a JSONCompareResult object.expected - the expected JSON objectactual - the actual JSON objectorg.json.JSONException - JSON parsing errorJSONCompareResult compareJSON(org.json.JSONArray expected, org.json.JSONArray actual) throws org.json.JSONException
JSONArrays and returns the result of the comparison in a JSONCompareResult object.expected - the expected JSON arrayactual - the actual JSON arrayorg.json.JSONException - JSON parsing errorvoid compareJSON(String prefix, org.json.JSONObject expected, org.json.JSONObject actual, JSONCompareResult result) throws org.json.JSONException
JSONObjects on the provided path represented by prefix and
updates the result of the comparison in the result JSONCompareResult object.prefix - the path in the json where the comparison happensexpected - the expected JSON objectactual - the actual JSON objectresult - stores the actual state of the comparison resultorg.json.JSONException - JSON parsing errorvoid compareValues(String prefix, Object expectedValue, Object actualValue, JSONCompareResult result) throws org.json.JSONException
Objects on the provided path represented by prefix and
updates the result of the comparison in the result JSONCompareResult object.prefix - the path in the json where the comparison happensexpectedValue - the expected valueactualValue - the actual valueresult - stores the actual state of the comparison resultorg.json.JSONException - JSON parsing errorvoid compareJSONArray(String prefix, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) throws org.json.JSONException
JSONArrays on the provided path represented by prefix and
updates the result of the comparison in the result JSONCompareResult object.prefix - the path in the json where the comparison happensexpected - the expected JSON arrayactual - the actual JSON arrayresult - stores the actual state of the comparison resultorg.json.JSONException - JSON parsing errorCopyright © 2017. All Rights Reserved.