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.18.RELEASE'
		}
		if (details.requested.group == 'org.springframework.data') {
			if (details.requested.name == 'spring-data-commons') {
				details.useVersion '1.12.1.RELEASE'
			}
			if (details.requested.name == 'spring-data-gemfire') {
				details.useVersion '1.8.1.RELEASE'
			}
			if (details.requested.name == 'spring-data-keyvalue') {
				details.useVersion '1.1.1.RELEASE'
			}
			if (details.requested.name == 'spring-data-mongodb') {
				details.useVersion '1.9.1.RELEASE'
			}
			if (details.requested.name == 'spring-data-redis') {
				details.useVersion '1.7.1.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
