*/
@Test
public void testJSONPathCompiler() throws ParseException, JSONException {
System.out.println(this.getClass().getResource("books.json"));
JSONObject json = read(this.getClass().getResource("books.json"));
JSONPathExpr evaluator = parse("store.book[0].author");
Object result = evaluator.eval(json);
System.out.println(result);
assertEquals("Nigel Rees", result);
evaluator = parse("store.book");
result = evaluator.eval(json);
System.out.println(result);
assertTrue(result instanceof JSONArray);
evaluator = parse("store.book[category='fiction'].author");
result = evaluator.eval(json);
System.out.println(result);
assertEquals("Evelyn Waugh", result);
evaluator = parse("store.book[!category='reference'].author");
result = evaluator.eval(json);
System.out.println(result);
assertEquals("Evelyn Waugh", result);
evaluator = parse("store.book[price>9].author");
result = evaluator.eval(json);
System.out.println(result);
assertEquals("Evelyn Waugh", result);
evaluator = parse("store.book[price>12.999].author");
result = evaluator.eval(json);
System.out.println(result);
assertEquals("J. R. R. Tolkien", result);
evaluator = parse("store.book[price>9 && price<12.999].author");
result = evaluator.eval(json);
System.out.println(result);
assertEquals("Evelyn Waugh", result);
evaluator = parse("store.book[reviewed-by.name='JB'].author");
result = evaluator.eval(json);
System.out.println(result);
assertEquals("Nigel Rees", result);