Browse Source

minor fix

pull/1/merge
kalle 14 years ago
parent
commit
3a288a73ba
  1. 1
      json-assert/src/main/java/com/jayway/jsonpath/JsonPath.java
  2. 8
      json-assert/src/test/java/com/jayway/jsonpath/JsonPathTest.java

1
json-assert/src/main/java/com/jayway/jsonpath/JsonPath.java

@ -44,7 +44,6 @@ public class JsonPath {
return (List<T>) filters.filter(root);
}
public static <T> List<T> read(String json, String jsonPath) throws java.text.ParseException {
JsonPath path = compile(jsonPath);

8
json-assert/src/test/java/com/jayway/jsonpath/JsonPathTest.java

@ -4,8 +4,10 @@ import org.apache.commons.lang.StringUtils;
import org.junit.Test;
import java.util.List;
import java.util.Map;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.*;
@ -53,12 +55,10 @@ public class JsonPathTest {
@Test
public void read_document_from_root() throws Exception {
List<Object> list = JsonPath.read(DOCUMENT, "$.store");
JsonPath path = JsonPath.compile("$.store");
assertEquals(2, ((Map)list.get(0)).values().size());
List<Object> list = path.read(DOCUMENT);
System.out.println(list.toString());
}

Loading…
Cancel
Save