Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge tests and pom and code #515

Merged
merged 395 commits into from May 22, 2020
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
395 commits
Select commit Hold shift + click to select a range
d27bf85
Merge pull request #16 from stleary/big-numbers
stleary Jun 18, 2015
8c1a0c4
fixed test comment
stleary Jun 18, 2015
6c48db0
bigInt and bigDec behavior
stleary Jun 21, 2015
355e832
latest
stleary Jul 7, 2015
e056fc0
Update README.md
stleary Jul 7, 2015
3de0a0a
Update README.md
stleary Jul 8, 2015
99927c5
Update README.md
stleary Jul 8, 2015
6dd85ad
Update README.md
stleary Jul 8, 2015
7ed1f78
Update README.md
stleary Jul 8, 2015
27b22b4
Update README.md
stleary Jul 8, 2015
ab143af
Update README.md
stleary Jul 8, 2015
6cca292
investigate XML.toString() behavior with null JSONObject values
stleary Jul 18, 2015
0056b1a
investigate XML.toString() behavior with null JSONObject values
stleary Jul 18, 2015
b06182c
investigate XML.toString() behavior with null JSONObject values
stleary Jul 18, 2015
16fa69c
investigate XML.toString() behavior with null JSONObject values
stleary Jul 18, 2015
5eadebb
Showing issue of illegal node names with possible underscore-replacem…
mdaehnert Jul 19, 2015
0d2d0e3
Merge pull request #19 from JaXt0r/illegal_JSON-node-names_during_con…
stleary Jul 19, 2015
2c026eb
Fixed test shouldHandleIllegalJSONNodeNames
stleary Jul 19, 2015
f48b643
manual merge of pull request #18
stleary Jul 19, 2015
b9c6f33
fixed comment location
stleary Jul 19, 2015
b39c3df
document behavior of content keyword
stleary Jul 21, 2015
0361cc5
one more test - and a bug?
stleary Jul 21, 2015
752f667
Update README.md
stleary Jul 21, 2015
4e38ed0
tests for enum-support
stleary Jul 23, 2015
ec7eb25
Merge branch 'master' of github.com:stleary/JSON-Java-unit-test
stleary Jul 23, 2015
8ac8c34
tests for enum-support
stleary Jul 23, 2015
1f4e836
few more enum support tests
stleary Jul 23, 2015
f69466f
recreate original documented issue
stleary Jul 23, 2015
ee0a53d
Verify exception messages. Move method comments so JavaDoc will pick …
stleary Aug 8, 2015
a0108f3
Verify exception messages. Move method comments so JavaDoc will pick …
stleary Aug 8, 2015
f66cc8d
Verify exception messages. Move method comments so JavaDoc will pick …
stleary Aug 8, 2015
9ce62b9
Move method comments so JavaDoc will pick them up.
stleary Aug 8, 2015
6f5bcb3
Unit tests for JSON-Java HTTP.java. See RFC7230
stleary Aug 8, 2015
41bfdad
Move method comments so JavaDoc will pick them up.
stleary Aug 8, 2015
4a3bbed
Verify exception messages. Move method comments so JavaDoc will pick …
stleary Aug 8, 2015
8e48cae
Verify exception messages. Move method comments so JavaDoc will pick …
stleary Aug 8, 2015
58d72fe
Verify exception messages. Move method comments so JavaDoc will pick …
stleary Aug 9, 2015
1081ae0
Move method comments so JavaDoc will pick them up.
stleary Aug 9, 2015
ccbec81
Added some class documentation
stleary Aug 9, 2015
8f71e01
Add method comments so JavaDoc will pick them up.
stleary Aug 9, 2015
1f6e07c
sample tests for XML.toJSONObject(Reader)
stleary Aug 20, 2015
045fc74
Update README.md
seanThomasLeary Aug 23, 2015
9dd0ca7
Merge pull request #23 from seanThomasLeary/master
stleary Aug 23, 2015
3f78a85
Merge pull request #22 from stleary/xml-reader-remote
stleary Aug 24, 2015
1a5718d
Commenting out some code until JSON-java supports XML.toJSONObject(Re…
stleary Sep 28, 2015
4b0db65
Fixes NPE in XML
Oct 12, 2015
cb63a96
fixes test case to validate the input/output of the function being te…
Oct 12, 2015
4a2f9b8
Adds test cases for corrected generic constructors and put methods
Oct 14, 2015
0dbd9be
Merge pull request #26 from johnjaylward/FixXMLNPE
stleary Oct 18, 2015
3850b5f
Add tests to verify arrays are handled consistently.
Oct 26, 2015
6406c7a
Merge pull request #28 from johnjaylward/FixCtorGenerics
stleary Oct 29, 2015
38cbc31
Fix tabs, add valueToString() test to JSONObjectTest
stleary Oct 31, 2015
c578216
Merge pull request #30 from stleary/confirmValueToStringFix
stleary Oct 31, 2015
c6204a9
Replace util compare method with JsonPath
stleary Dec 26, 2015
a5390a0
Replace util compare method with JsonPath
stleary Dec 27, 2015
d329b65
Replace util compare method with JsonPath
stleary Dec 27, 2015
7187006
Replace util compare method with JsonPath
stleary Dec 27, 2015
48c872f
Replace util compare method with JsonPath
stleary Dec 28, 2015
abe421e
clean up code
stleary Dec 28, 2015
cfec741
Merge pull request #31 from stleary/json-path-for-validation
stleary Dec 28, 2015
4724395
Update README.md
stleary Dec 28, 2015
633ab10
Update README.md
stleary Dec 28, 2015
54cd97d
Update README.md
stleary Dec 28, 2015
91fcd60
Update README.md
stleary Dec 28, 2015
95cf866
Update README.md
stleary Dec 28, 2015
7f83a51
refactor test classes to their own modules
stleary Dec 29, 2015
4ddd6a1
Merge pull request #32 from stleary/refactor-test-classes-from-JSONOb…
stleary Dec 30, 2015
0990f34
Update README.md
stleary Dec 30, 2015
fc318a7
Fix some todos, clean up some tests, improve coverage
stleary Dec 30, 2015
0dc886d
Merge pull request #33 from stleary/Fix-todos-and-cleanup
stleary Dec 30, 2015
c88d06e
util cleanup
stleary Dec 30, 2015
4df6984
Merge pull request #34 from stleary/util-cleanup
stleary Dec 30, 2015
871a3e4
clean up a few more todos
stleary Dec 30, 2015
dc8c9e3
Merge pull request #35 from stleary/more-todo-cleanup
stleary Dec 30, 2015
147343c
Merge pull request #29 from johnjaylward/HandleArraysConsistently
stleary Jan 1, 2016
280ce71
tabs to spaces
stleary Jan 1, 2016
ace08f1
latest
stleary Jan 4, 2016
706d898
latest
stleary Jan 4, 2016
d3b197b
Merge pull request #37 from stleary/move-files-to-maven-friendly-dirs
stleary Jan 6, 2016
67d888e
Adds test cases to verify that -0 and -0.0 are processed as Double
Jan 27, 2016
bd958e0
fixes formatting
Jan 27, 2016
974c09b
Fixes typo in assert
Jan 27, 2016
8f16e06
Merge pull request #39 from johnjaylward/FixNegativeZero
stleary Jan 30, 2016
9c47ba2
initial test for JSONPointer class
erosb Apr 18, 2016
e001917
Added unit tests for escaped quotes.
Apr 25, 2016
6211384
tests for url fragment notation handling, moving test document to sep…
erosb Apr 26, 2016
66f740e
rolling back unwanted gitignore change in previous commit
erosb Apr 26, 2016
f857dda
removing some deprecated commented code
erosb Apr 26, 2016
e748c60
tests for improved failure handling
erosb Apr 26, 2016
4a3565a
unit test integration
stleary May 2, 2016
052ce94
Update README.md
stleary May 2, 2016
77d0873
Merge pull request #45 from captainIowa/master
stleary May 2, 2016
6edc093
adding unittests for JSPONPointer#toString(), toURIFragment() and its…
erosb May 3, 2016
2eed4be
one more test for null-check in Builder#append(String)
erosb May 3, 2016
adb3118
added test for checking if the JSONPointer is immutable
erosb May 5, 2016
ccc7a7a
Update README.md
stleary May 7, 2016
691734f
Update README.md
stleary May 7, 2016
b843d67
Update README.md
stleary May 7, 2016
a9ff159
Update README.md
stleary May 13, 2016
46044bf
Merge pull request #46 from erosb/master
stleary May 14, 2016
0112d82
add JSONPointerTest to test suite, fix resource for gradle build
stleary May 14, 2016
7038ea8
Merge pull request #47 from stleary/add-to-test-suite-and-fix-resource
stleary May 14, 2016
06ae87c
exclude resources from test
stleary May 14, 2016
45cbc66
add coverage for JSONObject, JSONArray queryFrom()
stleary May 14, 2016
15f48a0
convert tests to use JSONPointer where practical
stleary May 14, 2016
8ed0362
convert remaining JsonPath expressions to JSONPointer
stleary May 14, 2016
a1893eb
unittests for stlear/JSON-Java#233
erosb May 16, 2016
51bcbeb
Merge pull request #48 from erosb/master
stleary May 21, 2016
c7fdada
Add test that an invalid escape sequence results in a JSONException a…
madsager Jun 2, 2016
40f170b
Merge pull request #49 from madsager/master
stleary Jun 8, 2016
0e0f3f2
Merge pull request #1 from stleary/master
johnjaylward Jun 16, 2016
80f9e48
Moves src folder to simplify build.gradle configuration. If JSON-Java…
Jun 16, 2016
46a1c9a
Adds test case to confirm the parsing of control characters
Jun 16, 2016
c5deff6
updates README for new project layout
Jun 17, 2016
1204ea9
fixes a typo
Jun 17, 2016
01af317
Merge pull request #50 from johnjaylward/issue240
stleary Jun 17, 2016
c2de224
Verify opt method conversions for JSONArray and JSONObject
Jul 8, 2016
71c1eba
Merge pull request #51 from johnjaylward/VerifyOptConversions
stleary Jul 9, 2016
215321c
updates Test cases to support new JSONML and XML conversion options
Jul 18, 2016
c3ba4bd
Nesting depth test works as expected.
run2000 Jul 23, 2016
72c2b91
Tests for toString(), write(), toList(), and toMap().
run2000 Jul 23, 2016
ae77b5c
Tests for deep copy and mutability of toList() and toMap().
run2000 Jul 23, 2016
6b4edbd
Update README.md
stleary Jul 23, 2016
2307f6f
Update README.md
stleary Jul 23, 2016
cdfdaba
Update README.md
stleary Jul 23, 2016
5d8ea6f
Update README.md
stleary Jul 23, 2016
ffcfa66
Add JSONString test class.
run2000 Jul 24, 2016
1246e12
Factor out Writer from Appendable tests.
run2000 Jul 24, 2016
efe33a1
Fix comment.
run2000 Jul 24, 2016
e57881f
Fail when exceptions are not thrown as expected
run2000 Jul 24, 2016
62524b5
Merge pull request #52 from johnjaylward/OptionalTypeConversion
stleary Aug 1, 2016
a2c3115
Updates tests to include all opt methods and verify for missing keys.
Aug 9, 2016
80e36eb
Fixes error messages
Aug 9, 2016
8bae09f
removes unnecessary comparison to true
Aug 9, 2016
a418d07
Merge pull request #55 from johnjaylward/verifyOptMissingKeys
stleary Aug 10, 2016
c400de3
Merge pull request #53 from run2000/master
stleary Aug 11, 2016
5779400
test updates to make sure Enums are handled consistently.
Aug 11, 2016
bbd3fd5
Adds tests for numbers
Aug 16, 2016
cbd0418
Update JSONObjectTest.java
johnjaylward Aug 17, 2016
a66b97f
fix test
Aug 17, 2016
0b1dbe9
fixes test to not depend on key order
Aug 17, 2016
59761f6
Merge pull request #58 from johnjaylward/SimplifyNumberWrap
stleary Aug 17, 2016
3570890
Merge pull request #57 from johnjaylward/EnumCleanup
stleary Aug 19, 2016
58aebaa
fixed merge issues
stleary Sep 16, 2016
474711c
Merge pull request #60 from stleary/fix-number-tests
stleary Sep 16, 2016
c8563ff
new test case for XML changes
Sep 22, 2016
5027a28
Adds test for escaping from a JSONObject to XML
Sep 22, 2016
2b87f33
Update test cases to support ISO Control encoding changes.
Sep 22, 2016
f6a00e9
adds test for unicode that has surrogate pairs
Sep 22, 2016
97e3d6c
testcase for stleary/JSON-java#292 and adding .idea to .gitiignore
erosb Oct 5, 2016
df9c27c
Merge pull request #62 from erosb/master
stleary Oct 8, 2016
928179a
locale tests
stleary Feb 14, 2017
f41e1d0
tests for locale-independent keys
stleary Feb 17, 2017
a66abf2
Merge pull request #64 from stleary/locale-tests-for-non-EN-keys
stleary Feb 20, 2017
e41972a
add a test for unquoted values
stleary Feb 26, 2017
82ff14e
Merge pull request #66 from stleary/document-unquoted-strings
stleary Feb 26, 2017
d1a5f15
unit tests for query-by-JSONPointer
stleary Mar 26, 2017
f6ab6d7
Merge pull request #68 from stleary/jsonpointer-query
stleary Mar 28, 2017
9df5d34
* Update link in the README to the main JSON-Java repo
Apr 27, 2017
95da424
fix spelling in comment
Apr 27, 2017
c233ae7
comment out second unreliable test
Apr 27, 2017
c945b53
Merge pull request #69 from johnjaylward/TestCleanup
stleary Apr 28, 2017
1d040ec
fixes errors with tests relating to https://github.com/stleary/JSON-j…
May 16, 2017
49d47e3
Adjustments to tests for https://github.com/stleary/JSON-java/pull/337/
May 16, 2017
2867aaa
Updates test cases to support new optFloat and optNumber
May 17, 2017
bdb1163
Adds conversion tests to ensure downward type coercions are handled s…
May 18, 2017
0150639
update the new coercion test to use actual values and show the parseD…
May 18, 2017
1967bee
expands the coercion tests a little more
May 18, 2017
cfe6851
Adds testing for -0 with optNumber
May 18, 2017
04d76b6
split out tests for better readability
May 19, 2017
f5d3086
Merge pull request #70 from johnjaylward/fixSpelling
stleary May 20, 2017
93ca7b1
Merge pull request #71 from johnjaylward/OptimizeOpt
stleary May 23, 2017
c5e4b91
Updates tests for better error handling changes
Jun 8, 2017
441fec7
Merge pull request #73 from johnjaylward/BetterErrorHandling
stleary Jun 11, 2017
3081b4b
Fixes for failing tests due to android integration
johnjaylward Jun 21, 2017
971614a
fix expected exception message
johnjaylward Jun 21, 2017
0e612ba
More test corrections for correct position reports in error messages
johnjaylward Jun 21, 2017
af39376
more fixes for testing postition information
Jun 24, 2017
47ff774
Updates test coverage table
Jun 24, 2017
899cf52
More test cases for position information
johnjaylward Jun 24, 2017
974a5f7
Merge pull request #74 from johnjaylward/AndroidSupport
stleary Jul 6, 2017
0e3f23d
reorganize classes so test data is separate from test cases
johnjaylward Jul 9, 2017
49117f3
Adds new tests for testing bean->JSONObject mapping
johnjaylward Jul 9, 2017
7bc8f41
Add override of the generic getter to generate a Bridge method.
johnjaylward Jul 9, 2017
e94783f
Updates javadocs
johnjaylward Jul 9, 2017
38d1122
Adds exception tests
johnjaylward Jul 9, 2017
aa562b5
Update test for issue https://github.com/stleary/JSON-java/issues/356
johnjaylward Jul 15, 2017
1aeadd1
Merge pull request #76 from johnjaylward/WriteJavadocUpdate
stleary Jul 15, 2017
cf411b3
Merge pull request #75 from johnjaylward/PopulateMapMoreStrict
stleary Jul 19, 2017
f2f6ad3
* Fixes Gradle config so tests are only run once
johnjaylward Jul 20, 2017
44c3e32
Merge pull request #77 from johnjaylward/FixJUnitGradleConfig
stleary Jul 20, 2017
fefd616
Unit tests for JSONTokener
migueltt Aug 10, 2017
1acb180
Remove System.out.println
migueltt Aug 10, 2017
df466db
Replacing tabs with 4 spaces
migueltt Aug 10, 2017
c365e2a
Remov slf4j reference
migueltt Aug 10, 2017
68b2629
JSONObject(JSONTokener) now points to last character of duplicate key
migueltt Aug 10, 2017
b90bee0
Update error message location (+1)
migueltt Aug 14, 2017
d0e2cf4
Merge pull request #78 from migueltt/tokener-error-message
stleary Aug 18, 2017
cb61bbf
New tests for XML unescaping
johnjaylward Aug 19, 2017
2713f2e
Adds testing for unicode entities
johnjaylward Aug 19, 2017
af3b7dc
Merge pull request #79 from johnjaylward/FixXMLUnescape
stleary Aug 27, 2017
52ecc89
New test to verify unclosed array
johnjaylward Oct 30, 2017
bde6ba1
Updates exception expected message
johnjaylward Oct 30, 2017
dfa37a2
Add more tests for unclosed arrays
johnjaylward Oct 30, 2017
578a442
Update README.md
stleary Oct 30, 2017
ee3aa03
Update README.md
stleary Oct 30, 2017
e0801be
Update README.md
stleary Oct 30, 2017
936db93
Update README.md
stleary Oct 30, 2017
bf26eba
Merge pull request #80 from johnjaylward/UnclosedJSONArray
stleary Nov 3, 2017
08d93f3
test cases for issue https://github.com/stleary/JSON-java/issues/379
johnjaylward Nov 6, 2017
dae88d7
fix method names
johnjaylward Nov 6, 2017
77d142d
Merge pull request #81 from johnjaylward/FixFalsePositiveSimilar
stleary Nov 11, 2017
cc2ed79
Correct the message to match the function
billdeng Feb 2, 2018
fc881e2
Merge pull request #82 from billdeng/master
stleary Feb 3, 2018
aa5e80b
add test cases for null keys
Mar 7, 2018
193a382
new test cases to support bean annotation
Mar 7, 2018
37f1f4c
Merge pull request #83 from johnjaylward/FixNPE
stleary Mar 11, 2018
770cb9c
Merge pull request #84 from johnjaylward/FixBeanKeyNameing
stleary Mar 15, 2018
f4201cf
Test cases for issue described in https://github.com/stleary/JSON-jav…
Mar 19, 2018
43f3f5e
Add another test
Mar 19, 2018
3fe4a76
Fixes incorrect syntax for JSONPointer in test.
Mar 21, 2018
20d90bf
Merge pull request #85 from johnjaylward/JSONPointerTrailingSlash
stleary Mar 27, 2018
d00501e
add usage of isEmpty method
strkkk May 25, 2018
dedb044
Merge pull request #86 from strkkk/add-isEmpty-method-usage
stleary May 26, 2018
3b8b0a6
Update test cases to verify performance change and verify opt/getBigD…
Oct 2, 2018
3e6c0a5
update expected exception text in tests to match unified number getters
Oct 4, 2018
4c64ad3
Merge pull request #88 from johnjaylward/FixForBigDecimal
stleary Oct 6, 2018
e4186e0
reduce number of iterations to shorten test time
stleary Dec 8, 2018
0d053a0
Merge pull request #89 from stleary/update-timeNumberParsing-iterations
stleary Dec 8, 2018
d0ea807
xml parser config tests
stleary Dec 8, 2018
e699abb
Merge pull request #61 from johnjaylward/XmlEscape
stleary Dec 9, 2018
e7f7d34
* updates tests to cover more cases of tokenizing
Dec 10, 2018
cfec288
Merge pull request #90 from stleary/tests-for-xml-config
stleary Dec 11, 2018
437ce10
Merge pull request #91 from johnjaylward/FixEOF
stleary Dec 13, 2018
614e835
add test for xsi:nil to null conversion
Apr 18, 2019
fa173fa
add test for xsi:nil to null conversion disabled
Apr 20, 2019
6dcd82a
Merge pull request #93 from meiskalt7/xsiNilToNull
stleary Apr 22, 2019
3e7a0b1
new test case for issue 484
Sep 17, 2019
fb01575
Test cases updates for standardized exception messages
Sep 17, 2019
67e5988
add second case for data in #484
Sep 17, 2019
a24db2c
remove unused import
Sep 17, 2019
b8fd9d0
Merge pull request #94 from johnjaylward/FixMLInfiniteLoop
stleary Sep 23, 2019
18eddf7
Merge pull request #95 from johnjaylward/StandardizeExceptionMessages
stleary Sep 25, 2019
16da56e
improve the confused assert message
Alanscut Dec 28, 2019
08719d4
Apply suggestions from code review
Dec 30, 2019
f07ddd9
Merge pull request #96 from Alanscut/bean-test
stleary Dec 30, 2019
74e4932
Transform the repository into standard maven format and merge the pom…
Apr 29, 2020
1265897
Merge remote-tracking branch 'tests/master' into upstream
Apr 29, 2020
89d4681
Added information on how to release to the pom
BGehrels Apr 29, 2020
82202db
Added Jar plugin version to get rid of a warning
Apr 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,13 @@
# ignore Intellij Idea project files
.idea
*.iml
/target/

/bin/
build
.settings/
/.gradle/
/gradle/
/gradlew
/gradlew.bat
.gitmodules
181 changes: 180 additions & 1 deletion LICENSE
@@ -1,4 +1,4 @@
============================================================================
===== License for the code in /src/main:

Copyright (c) 2002 JSON.org

Expand All @@ -21,3 +21,182 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

===== License for the code in /src/test:

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS
60 changes: 60 additions & 0 deletions README.md
Expand Up @@ -146,3 +146,63 @@ as of 29 July, 2015.
JSON-java releases can be found by searching the Maven repository for groupId "org.json"
and artifactId "json". For example:
https://search.maven.org/search?q=g:org.json%20AND%20a:json&core=gav

# Unit tests
The test suite can be run by calling
```
mvn test
```



## Conventions
Test filenames should consist of the name of the module being tested, with the suffix "Test".
For example, <b>Cookie.java</b> is tested by <b>CookieTest.java</b>.

<b>The fundamental issues with JSON-Java testing are:</b><br>
* <b>JSONObjects</b> are unordered, making simple string comparison ineffective.
* Comparisons via **equals()** is not currently supported. Neither <b>JSONArray</b> nor <b>JSONObject</b> override <b>hashCode()</b> or <b>equals()</b>, so comparison defaults to the <b>Object</b> equals(), which is not useful.
* Access to the <b>JSONArray</b> and <b>JSONObject</b> internal containers for comparison is not currently available.

<b>General issues with unit testing are:</b><br>
* Just writing tests to make coverage goals tends to result in poor tests.
* Unit tests are a form of documentation - how a given method actually works is demonstrated by the test. So for a code reviewer or future developer looking at code a good test helps explain how a function is supposed to work according to the original author. This can be difficult if you are not the original developer.
* It is difficult to evaluate unit tests in a vacuum. You also need to see the code being tested to understand if a test is good.
* Without unit tests it is hard to feel confident about the quality of the code, especially when fixing bugs or refactoring. Good tests prevents regressions and keeps the intent of the code correct.
* If you have unit test results along with pull requests, the reviewer has an easier time understanding your code and determining if the it works as intended.

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.

**Caveats:**
JSON-Java is Java 1.6-compatible, but JSON-Java-unit-tests requires Java 1.8. If you see this error when building JSON-Java-unit-test, make sure you have 1.8 installed, on your path, and set in JAVA_HOME:
```
Execution failed for task ':compileJava'.
> invalid flag: -parameters
```


| Resource files used in test |
| ------------- |
| EnumTest.java |
| MyBean.java |
| MyBigNumberBean.java |
| MyEnum.java |
| MyEnumClass.java |
| MyEnumField.java |
| MyJsonString.java |
| MyPublicClass.java |
| PropertyTest.java |
| JunitTestSuite.java |
| StringsResourceBundle.java |
| TestRunner.java |
| Util.java |

## How to release
- Adapt the version number in the pom file
- Run
```
mvn clean deploy
```

You will need permissions for the org.json library given by the sonatype maven central team.