From 44fb3aa4ab08a2124578cdf9a7eebc36fb5b17f0 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 14 Feb 2011 14:57:30 +0000 Subject: [PATCH] SEC-1677: Create integrationTest task for Java projects and make all tests in itest module run as integration tests only. --- gradle/javaprojects.gradle | 25 +++++++++++++++++++ itest/context/itest-context.gradle | 2 +- ...amespaceWithMultipleInterceptorsTests.java | 0 .../HttpPathParameterStrippingTests.java | 0 .../integration/MultiAnnotationTests.java | 0 .../SEC933ApplicationContextTests.java | 0 .../SEC936ApplicationContextTests.java | 0 .../integration/StubUserRepository.java | 0 .../PythonInterpreterBasedSecurityTests.java | 0 .../FilterChainPerformanceTests.java | 0 .../ProtectPointcutPerformanceTests.java | 0 .../filter-chain-performance-app-context.xml | 0 .../resources/http-extra-fsi-app-context.xml | 0 .../http-path-param-stripping-app-context.xml | 0 .../resources/logback-test.xml | 0 .../multi-sec-annotation-app-context.xml | 0 ...otect-pointcut-performance-app-context.xml | 0 .../python-method-access-app-context.xml | 0 .../resources/sec-933-app-context.xml | 0 .../resources/sec-936-app-context.xml | 0 .../resources/someMethod.py | 1 - .../SessionRegistryImplMTTests.java | 0 .../context/SecurityContextHolderMTTests.java | 0 itest/web/itest-web.gradle | 2 +- .../AbstractWebServerIntegrationTests.java | 0 .../integration/BasicAuthenticationTests.java | 0 .../ConcurrentSessionManagementTests.java | 0 ...ustomConcurrentSessionManagementTests.java | 0 .../InMemoryProviderWebAppTests.java | 0 .../security/integration/JspTaglibTests.java | 0 .../security/integration/LdapWebAppTests.java | 0 .../resources/logback-test.xml | 0 ldap/ldap.gradle | 22 +--------------- 33 files changed, 28 insertions(+), 24 deletions(-) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/MultiAnnotationTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/SEC933ApplicationContextTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/SEC936ApplicationContextTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/StubUserRepository.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/integration/python/PythonInterpreterBasedSecurityTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/performance/FilterChainPerformanceTests.java (100%) rename itest/context/src/{test => integration-test}/java/org/springframework/security/performance/ProtectPointcutPerformanceTests.java (100%) rename itest/context/src/{test => integration-test}/resources/filter-chain-performance-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/http-extra-fsi-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/http-path-param-stripping-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/logback-test.xml (100%) rename itest/context/src/{test => integration-test}/resources/multi-sec-annotation-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/protect-pointcut-performance-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/python-method-access-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/sec-933-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/sec-936-app-context.xml (100%) rename itest/context/src/{test => integration-test}/resources/someMethod.py (96%) rename itest/misc/src/{test => integration-test}/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java (100%) rename itest/misc/src/{test => integration-test}/java/org/springframework/security/context/SecurityContextHolderMTTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/BasicAuthenticationTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/ConcurrentSessionManagementTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/CustomConcurrentSessionManagementTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/JspTaglibTests.java (100%) rename itest/web/src/{test => integration-test}/java/org/springframework/security/integration/LdapWebAppTests.java (100%) rename itest/web/src/{test => integration-test}/resources/logback-test.xml (100%) diff --git a/gradle/javaprojects.gradle b/gradle/javaprojects.gradle index 9d29fe4772..7569a8c902 100644 --- a/gradle/javaprojects.gradle +++ b/gradle/javaprojects.gradle @@ -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' diff --git a/itest/context/itest-context.gradle b/itest/context/itest-context.gradle index 5cf2c6ee8f..9a35296564 100644 --- a/itest/context/itest-context.gradle +++ b/itest/context/itest-context.gradle @@ -14,4 +14,4 @@ dependencies { "org.springframework:spring-web:$springVersion" testRuntime project(':spring-security-config') -} \ No newline at end of file +} diff --git a/itest/context/src/test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/HttpNamespaceWithMultipleInterceptorsTests.java diff --git a/itest/context/src/test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/HttpPathParameterStrippingTests.java diff --git a/itest/context/src/test/java/org/springframework/security/integration/MultiAnnotationTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/MultiAnnotationTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/MultiAnnotationTests.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/MultiAnnotationTests.java diff --git a/itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java diff --git a/itest/context/src/test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java diff --git a/itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java b/itest/context/src/integration-test/java/org/springframework/security/integration/StubUserRepository.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/StubUserRepository.java diff --git a/itest/context/src/test/java/org/springframework/security/integration/python/PythonInterpreterBasedSecurityTests.java b/itest/context/src/integration-test/java/org/springframework/security/integration/python/PythonInterpreterBasedSecurityTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/integration/python/PythonInterpreterBasedSecurityTests.java rename to itest/context/src/integration-test/java/org/springframework/security/integration/python/PythonInterpreterBasedSecurityTests.java diff --git a/itest/context/src/test/java/org/springframework/security/performance/FilterChainPerformanceTests.java b/itest/context/src/integration-test/java/org/springframework/security/performance/FilterChainPerformanceTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/performance/FilterChainPerformanceTests.java rename to itest/context/src/integration-test/java/org/springframework/security/performance/FilterChainPerformanceTests.java diff --git a/itest/context/src/test/java/org/springframework/security/performance/ProtectPointcutPerformanceTests.java b/itest/context/src/integration-test/java/org/springframework/security/performance/ProtectPointcutPerformanceTests.java similarity index 100% rename from itest/context/src/test/java/org/springframework/security/performance/ProtectPointcutPerformanceTests.java rename to itest/context/src/integration-test/java/org/springframework/security/performance/ProtectPointcutPerformanceTests.java diff --git a/itest/context/src/test/resources/filter-chain-performance-app-context.xml b/itest/context/src/integration-test/resources/filter-chain-performance-app-context.xml similarity index 100% rename from itest/context/src/test/resources/filter-chain-performance-app-context.xml rename to itest/context/src/integration-test/resources/filter-chain-performance-app-context.xml diff --git a/itest/context/src/test/resources/http-extra-fsi-app-context.xml b/itest/context/src/integration-test/resources/http-extra-fsi-app-context.xml similarity index 100% rename from itest/context/src/test/resources/http-extra-fsi-app-context.xml rename to itest/context/src/integration-test/resources/http-extra-fsi-app-context.xml diff --git a/itest/context/src/test/resources/http-path-param-stripping-app-context.xml b/itest/context/src/integration-test/resources/http-path-param-stripping-app-context.xml similarity index 100% rename from itest/context/src/test/resources/http-path-param-stripping-app-context.xml rename to itest/context/src/integration-test/resources/http-path-param-stripping-app-context.xml diff --git a/itest/context/src/test/resources/logback-test.xml b/itest/context/src/integration-test/resources/logback-test.xml similarity index 100% rename from itest/context/src/test/resources/logback-test.xml rename to itest/context/src/integration-test/resources/logback-test.xml diff --git a/itest/context/src/test/resources/multi-sec-annotation-app-context.xml b/itest/context/src/integration-test/resources/multi-sec-annotation-app-context.xml similarity index 100% rename from itest/context/src/test/resources/multi-sec-annotation-app-context.xml rename to itest/context/src/integration-test/resources/multi-sec-annotation-app-context.xml diff --git a/itest/context/src/test/resources/protect-pointcut-performance-app-context.xml b/itest/context/src/integration-test/resources/protect-pointcut-performance-app-context.xml similarity index 100% rename from itest/context/src/test/resources/protect-pointcut-performance-app-context.xml rename to itest/context/src/integration-test/resources/protect-pointcut-performance-app-context.xml diff --git a/itest/context/src/test/resources/python-method-access-app-context.xml b/itest/context/src/integration-test/resources/python-method-access-app-context.xml similarity index 100% rename from itest/context/src/test/resources/python-method-access-app-context.xml rename to itest/context/src/integration-test/resources/python-method-access-app-context.xml diff --git a/itest/context/src/test/resources/sec-933-app-context.xml b/itest/context/src/integration-test/resources/sec-933-app-context.xml similarity index 100% rename from itest/context/src/test/resources/sec-933-app-context.xml rename to itest/context/src/integration-test/resources/sec-933-app-context.xml diff --git a/itest/context/src/test/resources/sec-936-app-context.xml b/itest/context/src/integration-test/resources/sec-936-app-context.xml similarity index 100% rename from itest/context/src/test/resources/sec-936-app-context.xml rename to itest/context/src/integration-test/resources/sec-936-app-context.xml diff --git a/itest/context/src/test/resources/someMethod.py b/itest/context/src/integration-test/resources/someMethod.py similarity index 96% rename from itest/context/src/test/resources/someMethod.py rename to itest/context/src/integration-test/resources/someMethod.py index f19e66bfa3..75b68bcc53 100644 --- a/itest/context/src/test/resources/someMethod.py +++ b/itest/context/src/integration-test/resources/someMethod.py @@ -1,4 +1,3 @@ - print authentication.name; for authority in authentication.authorities: diff --git a/itest/misc/src/test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java b/itest/misc/src/integration-test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java similarity index 100% rename from itest/misc/src/test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java rename to itest/misc/src/integration-test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java diff --git a/itest/misc/src/test/java/org/springframework/security/context/SecurityContextHolderMTTests.java b/itest/misc/src/integration-test/java/org/springframework/security/context/SecurityContextHolderMTTests.java similarity index 100% rename from itest/misc/src/test/java/org/springframework/security/context/SecurityContextHolderMTTests.java rename to itest/misc/src/integration-test/java/org/springframework/security/context/SecurityContextHolderMTTests.java diff --git a/itest/web/itest-web.gradle b/itest/web/itest-web.gradle index e8631271e5..4849b58bfc 100644 --- a/itest/web/itest-web.gradle +++ b/itest/web/itest-web.gradle @@ -21,7 +21,7 @@ dependencies { 'net.sourceforge.jwebunit:jwebunit-htmlunit-plugin:2.2' } -test { +integrationTest { useTestNG(); options { jvmArgs = ["-ea", '-Xms128m', '-Xmx500m'] diff --git a/itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java diff --git a/itest/web/src/test/java/org/springframework/security/integration/BasicAuthenticationTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/BasicAuthenticationTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/BasicAuthenticationTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/BasicAuthenticationTests.java diff --git a/itest/web/src/test/java/org/springframework/security/integration/ConcurrentSessionManagementTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/ConcurrentSessionManagementTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/ConcurrentSessionManagementTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/ConcurrentSessionManagementTests.java diff --git a/itest/web/src/test/java/org/springframework/security/integration/CustomConcurrentSessionManagementTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/CustomConcurrentSessionManagementTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/CustomConcurrentSessionManagementTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/CustomConcurrentSessionManagementTests.java diff --git a/itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java diff --git a/itest/web/src/test/java/org/springframework/security/integration/JspTaglibTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/JspTaglibTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/JspTaglibTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/JspTaglibTests.java diff --git a/itest/web/src/test/java/org/springframework/security/integration/LdapWebAppTests.java b/itest/web/src/integration-test/java/org/springframework/security/integration/LdapWebAppTests.java similarity index 100% rename from itest/web/src/test/java/org/springframework/security/integration/LdapWebAppTests.java rename to itest/web/src/integration-test/java/org/springframework/security/integration/LdapWebAppTests.java diff --git a/itest/web/src/test/resources/logback-test.xml b/itest/web/src/integration-test/resources/logback-test.xml similarity index 100% rename from itest/web/src/test/resources/logback-test.xml rename to itest/web/src/integration-test/resources/logback-test.xml diff --git a/ldap/ldap.gradle b/ldap/ldap.gradle index ae16958bd9..990185ec35 100644 --- a/ldap/ldap.gradle +++ b/ldap/ldap.gradle @@ -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