1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00
A reference implementation of a JSON package in Java.
Find a file
2015-04-03 14:47:12 -05:00
CDLTest.java XMLTest, in progress 2015-03-22 20:37:24 -05:00
CookieListTest.java 96.5% coverage 2015-04-03 14:46:51 -05:00
CookieTest.java 97.5% coverage 2015-04-03 14:35:59 -05:00
JSONMLTest.java fixed comment test 83.2% coverage 2015-04-02 21:44:35 -05:00
JunitTestSuite.java added cookielisttest 2015-04-03 14:36:40 -05:00
LICENSE.txt Add LICENSE file via addalicense.com 2015-03-16 12:06:41 -05:00
PropertyTest.java PropertTest.java coverage 94.8% 2015-03-19 17:30:44 -05:00
README.md Update README.md 2015-04-03 14:46:45 -05:00
TestRunner.java test suite and cookie test 2015-03-18 22:39:54 -05:00
Util.java in progress 2015-03-30 08:14:34 -05:00
XMLTest.java coverage XMLTest 81.2% / XMLTokener 82.2% 2015-03-26 22:58:11 -05:00

JSON-Java-unit-test

Unit tests to validate the JSON-Java GitHub project code (https://github.com/douglascrockford/JSON-java).

Test harness: http://junit.org
Coverage: http://www.eclemma.org/

Eclipse is the recommended development environment. Run individual tests or JunitTestSuite using EclEmma Coverage, or execute the TestRunner application directly.

Test filenames should consist of the name of the module being tested, with the suffix "Test". For example, Cookie.java is tested by CookieTest.java. When adding a new unit test, don't forget to update JunitTestSuite.java.

The fundamental issues with JSON-Java testing are:

  • JSONObjects are unordered, making simple string comparison ineffective.
  • Comparisons via equals() is not currently supported. Neither JSONArray nor JSONObject overrride hashCode() or equals(), so comparison defaults to the Object equals(), which is not useful.
  • Access to the JSONArray and JSONObject internal containers for comparison is not currently available.
  • JSONObject sometimes wraps entries in quotes, other times does not, complicating comparisons.

When you start working on a test, add the empty file to the repository and update the readme, so that others will know that test is taken.

A unit test is considered complete when the coverage is >= 90% as measured by EclEmma.

Test file name Coverage Comments
Total coverage 48.4%
CDL.java 94.8% Completed
Cookie.java 97.5% Completed
CookieList.java 96.5% Completed
HTTP.java 0% In progress
HTTPTokener.java 0% In progress
JSONArray.java 19.5%
JSONException.java 26.7%
JSONML.java 83.2% completed
JSONObject.Null 75.0%
JSONStringer.java 0%
JSONTokener.java 70.3%
JSONWriter.java 0%
Property.java 94.8% Completed
XML.java 85.1% Completed
XMLTokener.java 82.7% Completed