Improvements in up-to-date checking and use of parallel tests where possible.

This commit is contained in:
Luke Taylor 2010-08-05 02:11:00 +01:00
parent 64375484a1
commit 413b2a06e3
8 changed files with 52 additions and 21 deletions

View File

@ -16,12 +16,12 @@ dependencies {
provided "javax.servlet:servlet-api:2.5"
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.2'
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.3'
testCompile project(':spring-security-ldap'),
project(':spring-security-openid'),
'org.openid4java:openid4java-nodeps:0.9.5',
files(this.project(':spring-security-core').sourceSets.test.classesDir),
project(':spring-security-core').sourceSets.test.classes,
'javax.annotation:jsr250-api:1.0',
"org.springframework.ldap:spring-ldap-core:$springLdapVersion",
"org.springframework:spring-jdbc:$springVersion",
@ -32,3 +32,17 @@ dependencies {
testRuntime "hsqldb:hsqldb:$hsqlVersion",
"cglib:cglib-nodep:2.2"
}
task ldapTests(type: Test) {
include ("**/ldap/**")
maxParallelForks = 1
// GRADLE-1090
testClassesDir = sourceSets.test.classesDir
classpath = sourceSets.test.runtimeClasspath
testReport = false
}
test {
dependsOn ldapTests
exclude ("**/ldap/**")
}

View File

@ -117,14 +117,6 @@ public class LdapProviderBeanDefinitionParserTests {
provider.authenticate(new UsernamePasswordAuthenticationToken("ben", "ben"));
}
@Test
public void detectsNonStandardServerId() {
setContext("<ldap-server id='myServer'/> " +
"<authentication-manager>" +
" <ldap-authentication-provider />" +
"</authentication-manager>");
}
@Test
public void inetOrgContextMapperIsSupported() throws Exception {
setContext(

View File

@ -13,22 +13,25 @@ dependencies {
task compileJava(overwrite: true, description: 'Compiles AspectJ Source', type: Ajc) {
dependsOn processResources
sourceSet = sourceSets.main
outputs.dir(sourceSet.classesDir)
aspectPath = configurations.aspectpath
}
task compileTestJava(overwrite: true, description: 'Compiles AspectJ Test Source', type: Ajc) {
dependsOn processTestResources, compileJava, jar
sourceSet = sourceSets.test
outputs.dir(sourceSet.classesDir)
aspectPath = files(configurations.aspectpath, jar.archivePath)
}
class Ajc extends DefaultTask {
@Input
SourceSet sourceSet
@Input
FileCollection aspectPath
Ajc() {
logging.captureStandardOutput(LogLevel.INFO)
}
@TaskAction
def compile() {
println "Running ajc ..."
@ -44,4 +47,4 @@ class Ajc extends DefaultTask {
}
}
}
}
}

View File

@ -47,10 +47,16 @@ dependencies {
sourceSets.main.compileClasspath += configurations.compileOnly
System.setProperty('apacheDSWorkDir', "${buildDir}/apacheDSWork")
test {
onlyIf {
!project.hasProperty('skipTests')
}
jvmArgs = ['-ea', '-Xms128m', '-Xmx500m', '-XX:MaxPermSize=128m']
jvmArgs = ['-ea', '-Xmx500m']
maxParallelForks = guessMaxForks()
testReport = false
}
def guessMaxForks() {
int processors = Runtime.runtime.availableProcessors()
return Math.max(2, (int) (processors / 2))
}

View File

@ -27,4 +27,5 @@ test {
jvmArgs = ["-ea", '-Xms128m', '-Xmx500m']
systemProperties = ['webapp.dir': "$projectDir/src/main/webapp"]
}
}
maxParallelForks = 1
}

View File

@ -1,6 +1,9 @@
// Ldap build file
test.exclude('**/OpenLDAPIntegrationTestSuite.class')
test {
exclude('**/OpenLDAPIntegrationTestSuite.class')
maxParallelForks = 1
}
apacheds_libs = [
"org.apache.directory.server:apacheds-core:$apacheDsVersion",

View File

@ -5,7 +5,7 @@
</encoder>
</appender>
<root level="INFO">
<root level="WARN">
<appender-ref ref="STDOUT" />
</root>

View File

@ -0,0 +1,12 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="WARN">
<appender-ref ref="STDOUT" />
</root>
</configuration>