From aca2e4ff3a79a228ecf95fb36c4d255b72c39aca Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 27 Aug 2013 08:47:04 -0500 Subject: [PATCH] SEC-2289: Add spring4Test --- build.gradle | 26 +++++++++++++++++++++++++- core/core.gradle | 2 +- crypto/crypto.gradle | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index ba04a31b35..8d6d420ba1 100644 --- a/build.gradle +++ b/build.gradle @@ -30,8 +30,9 @@ allprojects { group = 'org.springframework.security' repositories { - maven { url "http://repo.springsource.org/libs-release" } + maven { url "http://repo.springsource.org/libs-snapshot" } maven { url "http://repo.springsource.org/plugins-release" } + maven { url "http://repo.terracotta.org/maven2/" } } eclipse.project.name = "${project.name}-3.2.x" @@ -102,7 +103,22 @@ configure(coreModuleProjects) { } configurations { jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo + spring4TestRuntime.extendsFrom testRuntime } + configurations.spring4TestRuntime { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + if (details.requested.group == 'org.springframework') { + details.useVersion '4.0.0.BUILD-SNAPSHOT' + } + if (details.requested.name == 'ehcache') { + details.useVersion '2.6.5' + } + if (details.requested.name == 'ehcache-terracotta') { + details.useVersion '2.1.1' + } + } + } + dependencies { jacoco "org.jacoco:org.jacoco.agent:0.6.2.201302030002:runtime" } @@ -112,6 +128,14 @@ configure(coreModuleProjects) { integrationTest { jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*" } + task spring4Test(type: Test) { + jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M'] + exclude "**/EhCacheBasedAclCacheTests.class", "**/Issue55Tests.class" + classpath = sourceSets.test.output + sourceSets.main.output + configurations.spring4TestRuntime + testResultsDir = file("$buildDir/spring4-test-results/") + testReportDir = file("$buildDir/reports/spring4-tests/") + } + check.dependsOn spring4Test } configure (aspectjProjects) { diff --git a/core/core.gradle b/core/core.gradle index 37a077e370..de8dc724a5 100644 --- a/core/core.gradle +++ b/core/core.gradle @@ -43,7 +43,7 @@ classes.doLast { sourceJar.from cryptoProject.sourceSets.main.java -test { +configure([test,spring4Test]) { systemProperties['springSecurityVersion'] = version systemProperties['springVersion'] = springVersion } \ No newline at end of file diff --git a/crypto/crypto.gradle b/crypto/crypto.gradle index 6b096821a7..95299e61d7 100644 --- a/crypto/crypto.gradle +++ b/crypto/crypto.gradle @@ -4,7 +4,7 @@ // isJdk6 = jdkVersion >= '1.6' int maxAESKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength('AES') -test { +configure([test,spring4Test]) { if (maxAESKeySize < 256) { println "AES keysize limited to $maxAESKeySize, skipping EncryptorsTests" exclude '**/EncryptorsTests.class'