SEC-1677: Create integrationTest task for Java projects and make all tests in itest module run as integration tests only.

This commit is contained in:
Luke Taylor 2011-02-14 14:57:30 +00:00
parent a225dc3776
commit 44fb3aa4ab
33 changed files with 28 additions and 24 deletions

View File

@ -39,6 +39,31 @@ configurations {
testCompile.transitive = false
}
// Integration test setup
configurations {
integrationTestCompile {
extendsFrom testCompile
}
integrationTestRuntime {
extendsFrom integrationTestCompile, testRuntime
}
}
sourceSets {
integrationTest {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
compileClasspath = sourceSets.main.classes + sourceSets.test.classes + configurations.integrationTestCompile
runtimeClasspath = classes + compileClasspath + configurations.integrationTestRuntime
}
}
task integrationTest(type: Test, dependsOn: jar) {
testClassesDir = sourceSets.integrationTest.classesDir
logging.captureStandardOutput(LogLevel.INFO)
classpath = sourceSets.integrationTest.runtimeClasspath
}
dependencies {
compileOnly 'commons-logging:commons-logging:1.1.1'

View File

@ -14,4 +14,4 @@ dependencies {
"org.springframework:spring-web:$springVersion"
testRuntime project(':spring-security-config')
}
}

View File

@ -1,4 +1,3 @@
print authentication.name;
for authority in authentication.authorities:

View File

@ -21,7 +21,7 @@ dependencies {
'net.sourceforge.jwebunit:jwebunit-htmlunit-plugin:2.2'
}
test {
integrationTest {
useTestNG();
options {
jvmArgs = ["-ea", '-Xms128m', '-Xmx500m']

View File

@ -9,15 +9,6 @@ apacheds_libs = [
'org.apache.directory.shared:shared-ldap:0.9.15'
]
configurations {
integrationTestCompile {
extendsFrom testCompile
}
integrationTestRuntime {
extendsFrom integrationTestCompile, testRuntime
}
}
dependencies {
compile project(':spring-security-core'),
"org.springframework:spring-beans:$springVersion",
@ -38,18 +29,7 @@ dependencies {
}
}
sourceSets {
integrationTest {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
compileClasspath = sourceSets.main.classes + sourceSets.test.classes + configurations.integrationTestCompile
runtimeClasspath = classes + compileClasspath + configurations.integrationTestRuntime
}
}
task integrationTest(type: Test, dependsOn: jar) {
testClassesDir = sourceSets.integrationTest.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
integrationTest {
include('**/ApacheDSServerIntegrationTests.class')
// exclude('**/OpenLDAPIntegrationTestSuite.class')
maxParallelForks = 1