com.atlassian.confluence.it.web
Class JsonAssertions

java.lang.Object
  extended by junit.framework.Assert
      extended by com.atlassian.confluence.it.web.JsonAssertions

public class JsonAssertions
extends junit.framework.Assert

Assertions to compare JSON objects sensibly.


Constructor Summary
JsonAssertions()
           
 
Method Summary
static JSONArray arr(Object... args)
          Constructs a JSON array from the provided arguments.
static void assertJsonEquals(String message, JSONArray expected, JSONArray actual)
           
static void assertJsonEquals(String message, JSONObject expected, JSONObject actual)
           
static void assertJsonEquals(String message, Object expected, Object actual)
           
static void assertJsonHasProperties(String message, JSONObject expectedProperties, JSONObject actual)
           
static JSONObject obj(Object... args)
          Constructs a JSON object from the provided arguments.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonAssertions

public JsonAssertions()
Method Detail

assertJsonEquals

public static void assertJsonEquals(String message,
                                    JSONObject expected,
                                    JSONObject actual)
                             throws JSONException
Throws:
JSONException

assertJsonHasProperties

public static void assertJsonHasProperties(String message,
                                           JSONObject expectedProperties,
                                           JSONObject actual)
                                    throws JSONException
Throws:
JSONException

assertJsonEquals

public static void assertJsonEquals(String message,
                                    JSONArray expected,
                                    JSONArray actual)
                             throws JSONException
Throws:
JSONException

assertJsonEquals

public static void assertJsonEquals(String message,
                                    Object expected,
                                    Object actual)
                             throws JSONException
Throws:
JSONException

obj

public static JSONObject obj(Object... args)
                      throws JSONException
Constructs a JSON object from the provided arguments. For example, call like this:

obj("a", "value", "b", "other-value")

to construct a JSON object like this:

{ "a": "value", "b": "other-value" }

Throws:
JSONException

arr

public static JSONArray arr(Object... args)
                     throws JSONException
Constructs a JSON array from the provided arguments.

Throws:
JSONException


Copyright © 2003-2011 Atlassian. All Rights Reserved.