Kalle Stenflo
13 years ago
12 changed files with 197 additions and 69 deletions
@ -1,4 +1,34 @@
|
||||
Java DSL for reading and testing JSON documents. |
||||
|
||||
COPY DEPENDENCIES : mvn clean compile dependency:copy-dependencies -DstripVersion |
||||
FONT LOGO : Santa Fe LET 50 |
||||
------------------------------------------ |
||||
0.5.6 |
||||
------------------------------------------ |
||||
- Replaced regexp with custom tokenizer |
||||
- Removed static declaration of JSON_PARSER |
||||
- Introduced SPI for JsonProvider |
||||
- Elaborating new concept with JsonModel |
||||
|
||||
------------------------------------------ |
||||
0.5.5 |
||||
------------------------------------------ |
||||
- Improved JSON bracket notation. $['store']['book'][*]['author name'] |
||||
properties can also contain '.' eg $['store']['book'][*]['author.name'] |
||||
|
||||
------------------------------------------ |
||||
0.5.4 |
||||
------------------------------------------ |
||||
- Replaced com.googlecode.json-simple with net.minidev.json-smart |
||||
- Introduced different parse modes, JsonPath.SLACK_MODE and JsonPath.STRICT_MODE (the slack mode lets you use single quotes or even no quotes at all) |
||||
|
||||
------------------------------------------ |
||||
0.5.3 |
||||
------------------------------------------ |
||||
- Major refactoring |
||||
- JsonPath does not always produce a List as response |
||||
|
||||
------------------------------------------ |
||||
0.5.2 |
||||
------------------------------------------ |
||||
- Fixed issue that path was never considered definite if containing a ':' |
||||
- Bracket notation is now first class citizen $.foo.bar == $.['foo'].['bar'] |
||||
- Added JsonAsserter.assertNotDefined(String path) to allow checks for negative existence of a path |
||||
|
@ -1,24 +0,0 @@
|
||||
------------------------------------------ |
||||
0.5.5 |
||||
------------------------------------------ |
||||
- Improved JSON bracket notation. $['store']['book'][*]['author name'] |
||||
properties can also contain '.' eg $['store']['book'][*]['author.name'] |
||||
------------------------------------------ |
||||
0.5.4 |
||||
------------------------------------------ |
||||
- Replaced com.googlecode.json-simple with net.minidev.json-smart |
||||
- Introduced different parse modes, JsonPath.SLACK_MODE and JsonPath.STRICT_MODE (the slack mode lets you use single quotes or even no quotes at all) |
||||
|
||||
------------------------------------------ |
||||
0.5.3 |
||||
------------------------------------------ |
||||
- Major refactoring |
||||
- JsonPath does not always produce a List as response |
||||
|
||||
------------------------------------------ |
||||
0.5.2 |
||||
------------------------------------------ |
||||
|
||||
- Fixed issue that path was never considered definite if containing a ':' |
||||
- Bracket notation is now first class citizen $.foo.bar == $.['foo'].['bar'] |
||||
- Added JsonAsserter.assertNotDefined(String path) to allow checks for negative existence of a path |
@ -0,0 +1,60 @@
|
||||
package com.jayway.jsonpath; |
||||
|
||||
import org.junit.Test; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* User: kallestenflo |
||||
* Date: 11/12/11 |
||||
* Time: 8:25 PM |
||||
*/ |
||||
public class JsonPathExtendedTest { |
||||
|
||||
public final static String DOCUMENT = |
||||
"{ \"store\": {\n" + |
||||
" \"book\": [ \n" + |
||||
" { \"category\": \"reference\",\n" + |
||||
" \"author\": \"Nigel Rees\",\n" + |
||||
" \"title\": \"Sayings of the Century\",\n" + |
||||
" \"price\": 8.95\n" + |
||||
" },\n" + |
||||
" { \"category\": \"fiction\",\n" + |
||||
" \"author\": \"Evelyn Waugh\",\n" + |
||||
" \"title\": \"Sword of Honour\",\n" + |
||||
" \"price\": 12.99\n" + |
||||
" },\n" + |
||||
" { \"category\": \"fiction\",\n" + |
||||
" \"author\": \"Herman Melville\",\n" + |
||||
" \"title\": \"Moby Dick\",\n" + |
||||
" \"isbn\": \"0-553-21311-3\",\n" + |
||||
" \"price\": 8.99\n" + |
||||
" },\n" + |
||||
" { \"category\": \"fiction\",\n" + |
||||
" \"author\": \"J. R. R. Tolkien\",\n" + |
||||
" \"title\": \"The Lord of the Rings\",\n" + |
||||
" \"isbn\": \"0-395-19395-8\",\n" + |
||||
" \"price\": 22.99\n" + |
||||
" }\n" + |
||||
" ],\n" + |
||||
" \"bicycle\": {\n" + |
||||
" \"color\": \"red\",\n" + |
||||
" \"price\": 19.95,\n" + |
||||
" \"foo:bar\": \"fooBar\",\n" + |
||||
" \"dot.notation\": \"new\"\n" + |
||||
" }\n" + |
||||
" }\n" + |
||||
"}"; |
||||
|
||||
|
||||
@Test |
||||
public void test_1() throws Exception { |
||||
|
||||
|
||||
JsonPath path = JsonPath.compile("$.store.book[*].title"); |
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue