favorer / jsonmatcher Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/jsonmatcher
Automatically exported from code.google.com/p/jsonmatcher
The current code uses hamcrest-all instead of hamcrest-core. hamcrest-all is a
single jar, which assembles all the classes of hamcrest-core and
hamcrest-library. Unfortunately JUnit 4.11 dependends on hamcrest-core. This
causes classpath problems.
Therefore I changed the dependency of jsonmatcher from hamcrest-all to
hamcrest-core. In order to avoid compilation problems I upgraded the version to
1.3, too.
Original issue reported on code.google.com by StefanFriedrichBirkner
on 2 Sep 2013 at 8:29
Attachments:
What steps will reproduce the problem?
JSONObject json = new JSONObject(JSON_STRING_FOR_PATH_TEST);
assertThat(json, JsonMatchers.hasJsonPath("json1.json2.json3[0].field")); // SUCCES
assertThat(json, JsonMatchers.hasJsonPath("json1.json2.json3[*].field")); // Fails because of '*'
What is the expected output? What do you see instead?
Expected: assert suceeds
Actual: java.lang.IllegalArgumentException: [*] is not a valid array index for
a JSON array
What version of the product are you using? On what operating system?
version 1.0-SNAPSHOT, sun jvm 1.7 64bit, linux (Ubuntu)
Please provide any additional information below.
It would be great if jsonmatcher supports JSONPath expressions as described in
http://goessner.net/articles/JsonPath/
Original issue reported on code.google.com by [email protected]
on 7 Mar 2013 at 5:55
hamcrest-library is only needed for the tests. Therefore it should have test
scope only.
Original issue reported on code.google.com by StefanFriedrichBirkner
on 4 Sep 2013 at 7:18
Attachments:
{{{
// start with [ contains a number in between and ends with ]
nodeKey.matches("^\\[\\d+\\]$") &&
// starts with "[0" but is not "[0]" e.g. 0123 is not valid.
// *TODO collapse these two conditions into one with a
// neatly compiled REGEX.*
nodeKey.startsWith("[0") && nodeKey.equals("[0]"),
}}}
Original issue reported on code.google.com by [email protected]
on 30 Jun 2011 at 7:34
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.