org.skyscreamer.jsonassert
Class JSONAssert

java.lang.Object
  extended by org.skyscreamer.jsonassert.JSONAssert

public class JSONAssert
extends Object

Created by IntelliJ IDEA. User: Carter Page Date: 1/29/12 Time: 2:43 PM Known issues: + Unless the order is strict checking does not handle mixed types in the JSONArray (e.g. [1,2,{a:"b"}] or [{pet:"cat"},{car:"Ford"}]) + Unless the order is strict checking does not arrays of arrays (e.g. [[1,2],[3,4]]) Decided to stick with org.json for maximum compatibility with various projects. The implementation is simpler and a little more predictable. There are also more maven dependencies in net.sf.json which can cause version conflicts with some projects.


Constructor Summary
JSONAssert()
           
 
Method Summary
static void assertEquals(org.json.JSONArray expected, org.json.JSONArray actual, boolean strict)
           
static void assertEquals(org.json.JSONObject expected, org.json.JSONObject actual, boolean strict)
           
static void assertEquals(String expectedStr, org.json.JSONArray actual, boolean strict)
           
static void assertEquals(String expectedStr, org.json.JSONObject actual, boolean strict)
           
static void assertEquals(String expectedStr, String actualStr, boolean strict)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONAssert

public JSONAssert()
Method Detail

assertEquals

public static void assertEquals(String expectedStr,
                                org.json.JSONObject actual,
                                boolean strict)
                         throws org.json.JSONException
Throws:
org.json.JSONException

assertEquals

public static void assertEquals(String expectedStr,
                                org.json.JSONArray actual,
                                boolean strict)
                         throws org.json.JSONException
Throws:
org.json.JSONException

assertEquals

public static void assertEquals(String expectedStr,
                                String actualStr,
                                boolean strict)
                         throws org.json.JSONException
Throws:
org.json.JSONException

assertEquals

public static void assertEquals(org.json.JSONObject expected,
                                org.json.JSONObject actual,
                                boolean strict)
                         throws org.json.JSONException
Throws:
org.json.JSONException

assertEquals

public static void assertEquals(org.json.JSONArray expected,
                                org.json.JSONArray actual,
                                boolean strict)
                         throws org.json.JSONException
Throws:
org.json.JSONException


Copyright © 2012. All Rights Reserved.