Search in sources :

Example 11 with JSONObject

use of json.JSONObject in project JsonPath by json-path.

the class TapestryJsonProviderTest method an_object_can_be_read.

@Test
public void an_object_can_be_read() {
    JSONObject book = using(TAPESTRY_JSON_CONFIGURATION).parse(JSON_DOCUMENT).read("$.store.book[0]");
    assertThat(book.get("author").toString()).isEqualTo("Nigel Rees");
}
Also used : JSONObject(org.apache.tapestry5.json.JSONObject) Test(org.junit.Test)

Aggregations

JSONObject (json.JSONObject)8 JSONException (json.JSONException)5 FileNotFoundException (java.io.FileNotFoundException)4 IOException (java.io.IOException)4 ParseException (java.text.ParseException)4 JSONArray (json.JSONArray)4 InvalidFormatException (opennlp.tools.util.InvalidFormatException)4 JSONObject (org.apache.tapestry5.json.JSONObject)3 structures._Doc (structures._Doc)3 Test (org.junit.Test)2 structures._ParentDoc (structures._ParentDoc)2 structures._Post (structures._Post)2 structures._Product (structures._Product)2 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 InputStreamReader (java.io.InputStreamReader)1 BeginRender (org.apache.tapestry5.annotations.BeginRender)1 structures._ChildDoc (structures._ChildDoc)1 structures._NewEggPost (structures._NewEggPost)1 structures._ParentDoc4DCM (structures._ParentDoc4DCM)1