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:
parent
a225dc3776
commit
44fb3aa4ab
|
@ -39,6 +39,31 @@ configurations {
|
||||||
testCompile.transitive = false
|
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 {
|
dependencies {
|
||||||
compileOnly 'commons-logging:commons-logging:1.1.1'
|
compileOnly 'commons-logging:commons-logging:1.1.1'
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,4 @@ dependencies {
|
||||||
"org.springframework:spring-web:$springVersion"
|
"org.springframework:spring-web:$springVersion"
|
||||||
testRuntime project(':spring-security-config')
|
testRuntime project(':spring-security-config')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
print authentication.name;
|
print authentication.name;
|
||||||
|
|
||||||
for authority in authentication.authorities:
|
for authority in authentication.authorities:
|
|
@ -21,7 +21,7 @@ dependencies {
|
||||||
'net.sourceforge.jwebunit:jwebunit-htmlunit-plugin:2.2'
|
'net.sourceforge.jwebunit:jwebunit-htmlunit-plugin:2.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
integrationTest {
|
||||||
useTestNG();
|
useTestNG();
|
||||||
options {
|
options {
|
||||||
jvmArgs = ["-ea", '-Xms128m', '-Xmx500m']
|
jvmArgs = ["-ea", '-Xms128m', '-Xmx500m']
|
||||||
|
|
|
@ -9,15 +9,6 @@ apacheds_libs = [
|
||||||
'org.apache.directory.shared:shared-ldap:0.9.15'
|
'org.apache.directory.shared:shared-ldap:0.9.15'
|
||||||
]
|
]
|
||||||
|
|
||||||
configurations {
|
|
||||||
integrationTestCompile {
|
|
||||||
extendsFrom testCompile
|
|
||||||
}
|
|
||||||
integrationTestRuntime {
|
|
||||||
extendsFrom integrationTestCompile, testRuntime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':spring-security-core'),
|
compile project(':spring-security-core'),
|
||||||
"org.springframework:spring-beans:$springVersion",
|
"org.springframework:spring-beans:$springVersion",
|
||||||
|
@ -38,18 +29,7 @@ dependencies {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
integrationTest {
|
||||||
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
|
|
||||||
include('**/ApacheDSServerIntegrationTests.class')
|
include('**/ApacheDSServerIntegrationTests.class')
|
||||||
// exclude('**/OpenLDAPIntegrationTestSuite.class')
|
// exclude('**/OpenLDAPIntegrationTestSuite.class')
|
||||||
maxParallelForks = 1
|
maxParallelForks = 1
|
||||||
|
|
Loading…
Reference in New Issue