Sean Leary
0578285036
Merge pull request #734 from superMaaax/fix_flaky
...
Fixed Flaky Tests Caused by JSON permutations
2023-03-27 16:25:57 -05:00
superMaaax
48fb5261fe
Fixed Flaky Tests Caused by JSON permutations
...
###Description
Flaky Tests found using NonDex by running the commands -
mvn -pl . edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.json.junit.XMLTest#testIndentComplicatedJsonObject
mvn -pl . edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.json.junit.XMLTest#testIndentSimpleJsonArray
mvn -pl . edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.json.junit.XMLTest#testIndentSimpleJsonObject
The logged failure was-
[ERROR] Failures:
[ERROR] XMLTest.testIndentSimpleJsonObject:1193 expected:<...>
<employee>
<[married>true</married>
<name>sonoo</name>
<salary>56000</salary]>
</employee>
</Te...> but was:<...>
<employee>
<[name>sonoo</name>
<salary>56000</salary>
<married>true</married]>
</employee>
</Te...>
The issue is the same for all three tests, so here I only show the failure message for the third test (to reduce the length of the error message).
### Investigation
The tests fail with a comparison error while comparing an expected JSON String and the result from the value returned from XML.toString(). The toString function of XML makes no guarantees as to the iteration order of the attributes in the object. This makes the test outcome non-deterministic, and the test fails whenever the function returns a mismatch in order of the elements in the JSON String. To fix this, the expected and actual keys should be checked in a more deterministic way so that the assertions do not fail.
### Fix
Expected and Actual values can be converted into JSONObject and the similar function can be used to compare these objects. As this function compares the values inside the JSONObjects without needing order, the test becomes deterministic and ensures that the flakiness from the test is removed.
The PR does not introduce a breaking change.
2023-03-21 20:58:32 -05:00
Sean Leary
8353b9c3f0
Merge pull request #731 from JoaoGFarias/patch-1
...
Removing commented out code in JSONObject optDouble()
2023-03-11 19:28:01 -06:00
Sean Leary
fe22b242b5
Merge pull request #733 from haribabu-dev/jsontokener_closable
...
JSONTokener implemented java.io.Closeable
2023-03-11 19:26:55 -06:00
HariBabu t
7eca507d13
Removed overriding closable interface.
2023-03-07 13:58:30 +08:00
HariBabu t
e1eabc9c27
JSONTokener implemented java.io.Closeable
2023-03-04 23:08:32 +08:00
João Farias
0d436d92e2
Removing commented out code
2023-03-02 16:39:11 +01:00
Sean Leary
45bcba518f
Merge pull request #729 from TamasPergerDWP/f-parserconfig
...
Refactor ParserConfiguration class hierarchy
2023-02-28 12:49:42 -06:00
Sean Leary
47fb49b6a8
Update for release 20230227
20230227
2023-02-27 07:21:11 -06:00
Sean Leary
0df034c9fd
Update for release 20230227
2023-02-27 07:20:10 -06:00
Sean Leary
f0a05e6911
Update README.md
2023-02-27 07:17:51 -06:00
Tamas Perger
24093491a8
refactor: introduce ParserConfiguration class hierarchy
2023-02-21 19:13:07 +00:00
Sean Leary
1275f6809d
Merge pull request #723 from TamasPergerDWP/master
...
JSONML should be protected from stack overflow exceptions caused by recursion, resolving #722
2023-02-17 13:47:36 -06:00
Tamas Perger
9234eab00a
refactor: make JSONMLParserConfiguration all-args constructor private, enforcing the builder pattern.
2023-02-13 01:09:29 +00:00
Tamas Perger
72f4c3e646
refactor: rename XMLtoJSONMLParserConfiguration to JSONMLParserConfiguration
2023-02-12 01:32:34 +00:00
Tamas Perger
df2d6f8363
fix: introduce optional XMLtoJSONMLParserConfiguration parameter for JSONML.toJSONArray(...) functions, to facilitate max nesting depth override.
2023-02-11 01:52:13 +00:00
Tamas Perger
a6e412bded
fix: limit the nesting depth in JSONML
...
Limit the XML nesting depth for CVE-2022-45688 when using the JsonML transform.
2023-02-10 01:46:44 +00:00
Tamas Perger
2391d248cc
fix: amend XMLParserConfiguration.clone() to include the new maxNestingDepth param.
...
Amend Javadoc for XML and XMLParserConfiguration classes.
2023-02-10 01:45:34 +00:00
Sean Leary
401495ae86
Merge pull request #720 from cleydyr/issue-708
...
Limit the XML nesting depth for CVE-2022-45688
2023-02-05 19:30:04 -06:00
Cleydyr de Albuquerque
448e204186
docs: remove wrong description of parse method
2023-02-02 20:16:16 +01:00
Cleydyr de Albuquerque
eb56704e68
fix: set default maximum nesting depth as 512
2023-02-02 18:15:03 +01:00
Cleydyr de Albuquerque
651511f500
tests: add new test to verify that an XML having the permitted nesting depth can be converted
2023-02-01 20:22:47 +01:00
Cleydyr de Albuquerque
a14cb12c85
refactor: keep consistence with other tests and tidy up constant
2023-02-01 20:22:32 +01:00
Cleydyr de Albuquerque
f566a1d9ee
fix: limit the nesting depth
2023-02-01 16:26:58 +01:00
Sean Leary
5920eca2d7
Merge pull request #711 from 6d64/revert-pull-707-interviewbit-spam
...
Revert pull 707 - interviewbit spam
2022-11-30 20:20:39 -06:00
6d64
3b097d051a
Revert pull 707 - interviewbit spam
...
Reverted commit that was added by a bot adding interviewbit spam to
repos on github
2022-12-01 03:21:26 +11:00
Sean Leary
4e630e58a4
Merge pull request #707 from ASAlishaa/patch-1
...
Added new resource to the repos
2022-11-17 19:14:11 -06:00
ASAlisha
b732188e4e
Added new resource to this repos.
...
Added resource in the correct format.
2022-11-15 16:31:05 +05:30
ASAlisha
5369442671
Added new resource to the repos
...
Added new useful JSON resource.
2022-11-14 03:26:18 +05:30
Sean Leary
bb1138762a
Merge pull request #703 from TomerPacific/feature/update-release-for-JSONMap-Change
...
Update Releases.md for JSONObject(Map): Throws NPE if key is null
2022-11-05 17:39:13 -05:00
Sean Leary
6a732ec99d
Merge pull request #704 from niranjanib/fix-javadoc-not-visible-in-website
...
move javadoc comments above the interface definition to make it visible
2022-11-05 17:38:15 -05:00
Niranjani
c798c76ddd
move javadoc comments above the interface definition to make it visible
...
Fix #670
2022-10-30 22:10:38 +05:30
unknown
23d5e52a53
feature/update-release-for-JSONMap-Change adding breaking change for JSONMap to corresponding release
2022-10-28 08:45:54 +03:00
Sean Leary
98df35449a
Merge pull request #696 from bmk15897/fix-flaky-test
...
Update JSONPointerTest for NonDex compatibility
2022-10-15 08:24:01 -05:00
Sean Leary
1be6ee31a7
Merge pull request #694 from DeaneOC/Pretty-Print-XML-Functionality
...
Pretty print XML
2022-10-13 21:46:26 -05:00
Bharati Kulkarni
a2d3d3c9b5
Fix Flaky Test
2022-10-11 14:33:43 -05:00
Dean
bf9219386a
Merge branch 'master' of https://github.com/stleary/JSON-java into Pretty-Print-XML-Functionality
2022-10-10 11:12:49 +01:00
Dean
85495facbd
Corrected test
2022-10-10 11:12:35 +01:00
Dean
7aba3ac941
System line seperator now being used in JUnit test
2022-10-10 11:09:42 +01:00
Sean Leary
d51250f6b0
Merge pull request #692 from InACommandBlock/patch-1
...
Example.md syntax highlight and indentation
2022-10-09 22:28:36 -05:00
Dean
9cb8e153bf
Added JavaDocs
2022-10-07 17:57:07 +01:00
Dean
80c1479ad8
Merge branch 'master' of https://github.com/stleary/JSON-java into Pretty-Print-XML-Functionality
2022-10-07 17:56:54 +01:00
Sean Leary
444335d12a
Merge pull request #691 from hendrixjoseph/issue-657-unit-tests-should-check-various-number-formats
...
create unit tests for various number formats
2022-10-07 11:18:41 -05:00
Dean
a2c0562e04
Removed unused import
2022-10-07 15:04:09 +01:00
Dean
153972afdf
Adding resources
2022-10-07 10:35:14 +01:00
Dean
4a8ff28fd8
Reduced Test code length by using resources
2022-10-07 10:35:06 +01:00
Dean
fa457a4113
Test cases for XML toString indentation
2022-10-06 12:01:26 +01:00
Dean
b7f708b222
Altered XML toString to allow indentation param
2022-10-06 12:01:13 +01:00
TheCommandBlock
12411b7981
Update Examples.md
...
Co-authored-by: JAYSE <104235500+JayseMayne@users.noreply.github.com>
2022-10-06 03:18:03 +02:00
TheCommandBlock
61801c623e
Minor Adjustments Example.md
...
Added syntax highlighting, standardised indentation
2022-10-06 00:48:34 +02:00