configurations {
	spring3TestRuntime.extendsFrom testRuntime
}

configurations.spring3TestRuntime {
	resolutionStrategy.eachDependency { DependencyResolveDetails details ->
		if (details.requested.group == 'org.springframework'
				&& details.requested.name != 'spring-websocket'
				&& details.requested.name != 'spring-messaging') {
			details.useVersion '3.2.14.RELEASE'
		}
	}
}

task spring3Test(type: Test) {
	jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M']
	classpath = sourceSets.test.output + sourceSets.main.output + configurations.spring3TestRuntime
	exclude "org/springframework/session/web/socket/**"
	reports {
		html.destination = project.file("$buildDir/spring3-test-results/")
		junitXml.destination = project.file("$buildDir/reports/spring3-tests/")
	}
}
check.dependsOn spring3Test