Skip to content

Instantly share code, notes, and snippets.

@jaredsburrows
Last active March 19, 2016 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredsburrows/26bd0fe9f4c1dc7b3c37 to your computer and use it in GitHub Desktop.
Save jaredsburrows/26bd0fe9f4c1dc7b3c37 to your computer and use it in GitHub Desktop.
Java Integration Tests
// https://github.com/gradle/gradle/blob/master/subprojects/docs/src/samples/java/withIntegrationTests/build.gradle
// http://stackoverflow.com/questions/33751260/setting-up-integration-tests-in-android-gradle-based-project
// https://github.com/gradle/gradle/blob/21608d9b173fa53056563180575ec8c92df55dc7/gradle/integTest.gradle
apply plugin: 'java'
repositories {
mavenCentral()
}
sourceSets {
integrationTest {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
}
}
dependencies {
testCompile 'junit:junit:4.12'
integrationTestCompile 'commons-collections:commons-collections:3.2.2'
integrationTestCompile sourceSets.main.output
integrationTestCompile configurations.testCompile
integrationTestCompile sourceSets.test.output
integrationTestRuntime configurations.testRuntime
}
task integrationTest(type: Test, dependsOn: jar) {
group 'Verification'
description 'Runs the integration tests.'
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperties['jar.path'] = jar.archivePath
}
check.dependsOn integrationTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment