mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
unit test integration
This commit is contained in:
parent
8f16e065c5
commit
4a3565afb3
1 changed files with 32 additions and 14 deletions
46
build.gradle
46
build.gradle
|
@ -1,26 +1,44 @@
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
apply plugin: 'jacoco'
|
||||||
jar.baseName = 'JSON-java'
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
// Uncomment main if you have merged JSON-Java and JSON-Java-unit-test code
|
||||||
java {
|
main {
|
||||||
srcDir 'src/test'
|
java {
|
||||||
|
srcDir 'src'
|
||||||
|
exclude 'test/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
java {
|
||||||
|
srcDir 'src/test'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.+'
|
testCompile group: 'junit', name: 'junit', version: '4.+'
|
||||||
testCompile group: 'com.jayway.jsonpath', name: 'json-path', version: '2.1.0'
|
testCompile group: 'com.jayway.jsonpath', name: 'json-path', version: '2.1.0'
|
||||||
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
|
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
|
||||||
// Use this line if you are testing a JSON-Java release.
|
// Uncomment if you are testing against a JSON-Java release
|
||||||
// Otherwise add an external jar from your local repository in Eclipse
|
// testCompile 'org.json:json:20160212'
|
||||||
// (The gradle build won't work unless you add a main sourceSets entry and a jar.baseName entry
|
// Uncomment if you have copied a local JSON-Java jar file into this project
|
||||||
// testCompile group: 'org.json', name: 'json', version: '20151123'
|
// testCompile files('./JSON-Java.jar')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test { finalizedBy jacocoTestReport }
|
||||||
|
jacocoTestReport{
|
||||||
|
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
|
||||||
|
reports {
|
||||||
|
xml.enabled false
|
||||||
|
csv.enabled false
|
||||||
|
html.destination "${buildDir}/reports/jacoco/html"
|
||||||
|
}
|
||||||
|
executionData = files('build/jacoco/test.exec')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue