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(java.lang.Object... args)
          Constructs a JSON array from the provided arguments.
static void assertJsonEquals(java.lang.String message, JSONArray expected, JSONArray actual)
           
static void assertJsonEquals(java.lang.String message, JSONObject expected, JSONObject actual)
           
static void assertJsonEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
           
static void assertJsonHasProperties(java.lang.String message, JSONObject expectedProperties, JSONObject actual)
           
static JSONObject obj(java.lang.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(java.lang.String message,
                                    JSONObject expected,
                                    JSONObject actual)
                             throws JSONException
Throws:
JSONException

assertJsonHasProperties

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

assertJsonEquals

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

assertJsonEquals

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

obj

public static JSONObject obj(java.lang.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(java.lang.Object... args)
                     throws JSONException
Constructs a JSON array from the provided arguments.

Throws:
JSONException


Copyright © 2003-2010 Atlassian. All Rights Reserved.