net.sf.json.test
Class JSONAssert

java.lang.Object
  extended by junit.framework.Assert
      extended by net.sf.json.test.JSONAssert

public class JSONAssert
extends junit.framework.Assert

Provides assertions on equality for JSON strings and JSON types.

Author:
Andres Almiray

Constructor Summary
JSONAssert()
           
 
Method Summary
static void assertEquals(JSONArray expected, JSONArray actual)
          Asserts that two JSONArrays are equal.
static void assertEquals(JSONArray expected, String actual)
          Asserts that two JSONArrays are equal.
static void assertEquals(JSONFunction expected, String actual)
          Asserts that two JSONFunctions are equal.
static void assertEquals(JSON expected, JSON actual)
          Asserts that two JSON values are equal.
static void assertEquals(JSONNull expected, String actual)
          Asserts that two JSONNulls are equal.
static void assertEquals(JSONObject expected, JSONObject actual)
          Asserts that two JSONObjects are equal.
static void assertEquals(JSONObject expected, String actual)
          Asserts that two JSONObjects are equal.
static void assertEquals(String expected, JSONArray actual)
          Asserts that two JSONArrays are equal.
static void assertEquals(String message, JSONArray expected, JSONArray actual)
          Asserts that two JSONArrays are equal.
static void assertEquals(String message, JSONArray expected, String actual)
          Asserts that two JSONArrays are equal.
static void assertEquals(String expected, JSONFunction actual)
          Asserts that two JSONFunctions are equal.
static void assertEquals(String message, JSONFunction expected, String actual)
          Asserts that two JSONFunctions are equal.
static void assertEquals(String message, JSON expected, JSON actual)
          Asserts that two JSON values are equal.
static void assertEquals(String expected, JSONNull actual)
          Asserts that two JSONNulls are equal.
static void assertEquals(String message, JSONNull expected, String actual)
          Asserts that two JSONNulls are equal.
static void assertEquals(String expected, JSONObject actual)
          Asserts that two JSONObjects are equal.
static void assertEquals(String message, JSONObject expected, JSONObject actual)
          Asserts that two JSONObjects are equal.
static void assertEquals(String message, JSONObject expected, String actual)
          Asserts that two JSONObjects are equal.
static void assertEquals(String message, String expected, JSONArray actual)
          Asserts that two JSONArrays are equal.
static void assertEquals(String message, String expected, JSONFunction actual)
          Asserts that two JSONFunctions are equal.
static void assertEquals(String message, String expected, JSONNull actual)
          Asserts that two JSONNulls are equal.
static void assertEquals(String message, String expected, JSONObject actual)
          Asserts that two JSONObjects are equal.
static void assertJsonEquals(String expected, String actual)
          Asserts that two JSON strings are equal.
static void assertJsonEquals(String message, String expected, String actual)
          Asserts that two JSON strings are equal.
static void assertNotNull(JSON json)
          Asserts that a JSON value is not null.
static void assertNotNull(String message, JSON json)
          Asserts that a JSON value is not null.
static void assertNull(JSON json)
          Asserts that a JSON value is null.
static void assertNull(String message, JSON json)
          Asserts that a JSON value is null.
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
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(JSON expected,
                                JSON actual)
Asserts that two JSON values are equal.


assertEquals

public static void assertEquals(JSONArray expected,
                                JSONArray actual)
Asserts that two JSONArrays are equal.


assertEquals

public static void assertEquals(JSONArray expected,
                                String actual)
Asserts that two JSONArrays are equal.


assertEquals

public static void assertEquals(JSONFunction expected,
                                String actual)
Asserts that two JSONFunctions are equal.


assertEquals

public static void assertEquals(JSONNull expected,
                                String actual)
Asserts that two JSONNulls are equal.


assertEquals

public static void assertEquals(JSONObject expected,
                                JSONObject actual)
Asserts that two JSONObjects are equal.


assertEquals

public static void assertEquals(JSONObject expected,
                                String actual)
Asserts that two JSONObjects are equal.


assertEquals

public static void assertEquals(String message,
                                JSON expected,
                                JSON actual)
Asserts that two JSON values are equal.


assertEquals

public static void assertEquals(String expected,
                                JSONArray actual)
Asserts that two JSONArrays are equal.


assertEquals

public static void assertEquals(String message,
                                JSONArray expected,
                                JSONArray actual)
Asserts that two JSONArrays are equal.


assertEquals

public static void assertEquals(String message,
                                JSONArray expected,
                                String actual)
Asserts that two JSONArrays are equal.


assertEquals

public static void assertEquals(String expected,
                                JSONFunction actual)
Asserts that two JSONFunctions are equal.


assertEquals

public static void assertEquals(String message,
                                JSONFunction expected,
                                String actual)
Asserts that two JSONFunctions are equal.


assertEquals

public static void assertEquals(String expected,
                                JSONNull actual)
Asserts that two JSONNulls are equal.


assertEquals

public static void assertEquals(String message,
                                JSONNull expected,
                                String actual)
Asserts that two JSONNulls are equal.


assertEquals

public static void assertEquals(String expected,
                                JSONObject actual)
Asserts that two JSONObjects are equal.


assertEquals

public static void assertEquals(String message,
                                JSONObject expected,
                                JSONObject actual)
Asserts that two JSONObjects are equal.


assertEquals

public static void assertEquals(String message,
                                JSONObject expected,
                                String actual)
Asserts that two JSONObjects are equal.


assertEquals

public static void assertEquals(String message,
                                String expected,
                                JSONArray actual)
Asserts that two JSONArrays are equal.


assertEquals

public static void assertEquals(String message,
                                String expected,
                                JSONFunction actual)
Asserts that two JSONFunctions are equal.


assertEquals

public static void assertEquals(String message,
                                String expected,
                                JSONNull actual)
Asserts that two JSONNulls are equal.


assertEquals

public static void assertEquals(String message,
                                String expected,
                                JSONObject actual)
Asserts that two JSONObjects are equal.


assertJsonEquals

public static void assertJsonEquals(String expected,
                                    String actual)
Asserts that two JSON strings are equal.


assertJsonEquals

public static void assertJsonEquals(String message,
                                    String expected,
                                    String actual)
Asserts that two JSON strings are equal.


assertNotNull

public static void assertNotNull(JSON json)
Asserts that a JSON value is not null.
Fails if:


assertNotNull

public static void assertNotNull(String message,
                                 JSON json)
Asserts that a JSON value is not null.
Fails if:


assertNull

public static void assertNull(JSON json)
Asserts that a JSON value is null.
Fails if:


assertNull

public static void assertNull(String message,
                              JSON json)
Asserts that a JSON value is null.
Fails if: