Skip to content

Commit 01af317

Browse files
authored
Merge pull request #50 from johnjaylward/issue240
Tests for Issue #240 in JSON-Java
2 parents 40f170b + 1204ea9 commit 01af317

26 files changed

+38
-18
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ build
33
.classpath
44
.project
55
.settings/
6+
/.gradle/
7+
/gradle/
8+
/gradlew
9+
/gradlew.bat
10+
.gitmodules
11+
src/main/

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,22 @@ git clone https://github.com/stleary/JSON-Java-unit-test.git .
2929
\# Create a directory structure for the JSON-Java code
3030
````
3131
# Windows version
32-
md /s src\org\json
32+
md /s src\main\java\org\json
33+
# *nix version
34+
mkdir -p src/main/java/org/json
3335
````
3436
\# clone JSON-Java
3537
````
36-
git clone https://github.com/stleary/JSON-Java.git src\org\json
38+
#Windows version
39+
git clone https://github.com/stleary/JSON-Java.git src\main\java\org\json
40+
41+
#*Nix version
42+
git clone https://github.com/stleary/JSON-Java.git src/main/java/org/json
3743
````
3844
\# Build, then execute the unit tests and code coverage
3945
````
4046
gradle clean build test jacocoTestReport
47+
4148
````
4249
Unit test results will be in build\reports\tests\index.html<br>
4350
Code coverage will be in build\reports\jacoco\html\index.html
@@ -55,7 +62,7 @@ When adding a new unit test, don't forget to update <b>JunitTestSuite.java</b>.
5562

5663
<b>The fundamental issues with JSON-Java testing are:</b><br>
5764
* <b>JSONObjects</b> are unordered, making simple string comparison ineffective.
58-
* Comparisons via **equals()** is not currently supported. Neither <b>JSONArray</b> nor <b>JSONObject</b> overrride <b>hashCode()</b> or <b>equals()</b>, so comparison defaults to the <b>Object</b> equals(), which is not useful.
65+
* 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.
5966
* Access to the <b>JSONArray</b> and <b>JSONObject</b> internal containers for comparison is not currently available.
6067

6168
<b>General issues with unit testing are:</b><br>

build.gradle

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,8 @@ apply plugin: 'jacoco'
44

55
sourceSets {
66
// Uncomment main if you have merged JSON-Java and JSON-Java-unit-test code
7-
main {
8-
java {
9-
srcDir 'src'
10-
exclude 'test/'
11-
}
12-
}
13-
test {
14-
java {
15-
srcDir 'src/test'
16-
exclude 'resources/'
17-
}
18-
resources {
19-
srcDir 'resources'
20-
}
21-
}
7+
main
8+
test
229
}
2310

2411
repositories {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)