mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Update README.md
This commit is contained in:
parent
4a3565afb3
commit
052ce94a34
1 changed files with 2 additions and 31 deletions
33
README.md
33
README.md
|
@ -24,40 +24,11 @@ Run individual tests or <b>JunitTestSuite</b> using <b>EclEmma Coverage</b>, or
|
||||||
* JSON-java.jar<br>
|
* JSON-java.jar<br>
|
||||||
|
|
||||||
**To build from the command line using gradle:**
|
**To build from the command line using gradle:**
|
||||||
|
Until the unit tests are merged into the JSON-Java project, the code has to be wired by hand. After cloning JSON-Java-unit-test, create a directory structure under src and copy the JSON-Java files into: src/org/json. Then execute the unit tests and code coverage with:
|
||||||
````
|
````
|
||||||
build.gradle
|
gradle clean build test jacocoTestReport
|
||||||
# In this example, both the JSON-java jar and the test code is created
|
|
||||||
# from the same build file, in the test code directory. 3rd party jars are
|
|
||||||
# obtained from the maven repository.
|
|
||||||
apply plugin: 'java'
|
|
||||||
jar.baseName = 'JSON-java'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDir '../JSON-java/src/org/json'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
test {
|
|
||||||
java {
|
|
||||||
srcDir 'src/org/json/junit'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.+'
|
|
||||||
testCompile group: 'com.jayway.jsonpath', name: 'json-path', version: '2.1.0'
|
|
||||||
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
|
|
||||||
}
|
|
||||||
````
|
````
|
||||||
|
|
||||||
To measure coverage: http://www.eclemma.org/ (just install the latest in Eclipse)<br>
|
|
||||||
|
|
||||||
<b>Conventions</b><br>
|
<b>Conventions</b><br>
|
||||||
Test filenames should consist of the name of the module being tested, with the suffix "Test".
|
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>.
|
For example, <b>Cookie.java</b> is tested by <b>CookieTest.java</b>.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue