com.jayway.jsonassert
Class JsonAssert

java.lang.Object
  extended by com.jayway.jsonassert.JsonAssert

public class JsonAssert
extends java.lang.Object

User: kalle stenflo Date: 1/24/11 Time: 9:31 PM


Constructor Summary
JsonAssert()
           
 
Method Summary
static CollectionMatcher collectionWithSize(org.hamcrest.Matcher<? super java.lang.Integer> sizeMatcher)
           
static org.hamcrest.Matcher<java.util.Collection<java.lang.Object>> emptyCollection()
           
static org.hamcrest.Matcher<java.util.Map<java.lang.String,?>> mapContainingKey(org.hamcrest.Matcher<java.lang.String> keyMatcher)
           
static
<V> org.hamcrest.Matcher<? super java.util.Map<?,V>>
mapContainingValue(org.hamcrest.Matcher<? super V> valueMatcher)
           
static void setJsonProvider(JsonProvider jsonProvider)
           
static JsonAsserter with(java.io.InputStream is)
          Creates a JSONAsserter
static JsonAsserter with(java.io.Reader reader)
          Creates a JSONAsserter
static JsonAsserter with(java.lang.String json)
          Creates a JSONAsserter
 
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

setJsonProvider

public static void setJsonProvider(JsonProvider jsonProvider)

with

public static JsonAsserter with(java.lang.String json)
Creates a JSONAsserter

Parameters:
json - the JSON document to create a JSONAsserter for
Returns:
a JSON asserter initialized with the provided document
Throws:
java.text.ParseException - when the given JSON could not be parsed

with

public static JsonAsserter with(java.io.Reader reader)
                         throws java.io.IOException
Creates a JSONAsserter

Parameters:
reader - the reader of the json document
Returns:
a JSON asserter initialized with the provided document
Throws:
java.text.ParseException - when the given JSON could not be parsed
java.io.IOException

with

public static JsonAsserter with(java.io.InputStream is)
                         throws java.io.IOException
Creates a JSONAsserter

Parameters:
is - the input stream
Returns:
a JSON asserter initialized with the provided document
Throws:
java.text.ParseException - when the given JSON could not be parsed
java.io.IOException

collectionWithSize

public static CollectionMatcher collectionWithSize(org.hamcrest.Matcher<? super java.lang.Integer> sizeMatcher)

mapContainingKey

public static org.hamcrest.Matcher<java.util.Map<java.lang.String,?>> mapContainingKey(org.hamcrest.Matcher<java.lang.String> keyMatcher)

mapContainingValue

public static <V> org.hamcrest.Matcher<? super java.util.Map<?,V>> mapContainingValue(org.hamcrest.Matcher<? super V> valueMatcher)

emptyCollection

public static org.hamcrest.Matcher<java.util.Collection<java.lang.Object>> emptyCollection()


Copyright © 2011-2012. All Rights Reserved.