spring-test.gradle 5.3 KB
Newer Older
1
description = "Spring TestContext Framework"
2

3 4
dependencyManagement {
	imports {
5
		mavenBom "org.junit:junit-bom:${junit5Version}"
6 7 8 9 10
		mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
		mavenBom "io.netty:netty-bom:${nettyVersion}"
	}
}

11
dependencies {
12 13 14 15 16 17 18 19 20 21 22
	compile(project(":spring-core"))
	optional(project(":spring-aop"))
	optional(project(":spring-beans"))
	optional(project(":spring-context"))
	optional(project(":spring-jdbc"))
	optional(project(":spring-orm"))
	optional(project(":spring-tx"))
	optional(project(":spring-web"))
	optional(project(":spring-webflux"))
	optional(project(":spring-webmvc"))
	optional(project(":spring-websocket"))
23
	optional("javax.activation:javax.activation-api:1.2.0")
24 25 26 27 28
	optional("javax.el:javax.el-api:3.0.1-b04")
	optional("javax.inject:javax.inject:1")
	optional("javax.servlet:javax.servlet-api:4.0.1")
	optional("javax.servlet.jsp:javax.servlet.jsp-api:2.3.2-b02")
	optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
29
	optional("javax.xml.bind:jaxb-api:2.3.1")
30 31 32 33
	optional("javax.websocket:javax.websocket-api:1.1")
	optional("junit:junit:4.12")
	optional("org.junit.jupiter:junit-jupiter-api")
	optional("org.testng:testng:6.14.3")
34
	optional("org.aspectj:aspectjweaver:${aspectjVersion}")
35
	optional("org.codehaus.groovy:groovy:${groovyVersion}")
36 37 38
	optional("org.hamcrest:hamcrest-core:1.3")
	optional("org.apache.taglibs:taglibs-standard-jstlel:1.2.5") {
		exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
39
	}
40
	optional("net.sourceforge.htmlunit:htmlunit:2.33") {
41
		exclude group: "commons-logging", module: "commons-logging"
42
	}
43
	optional("org.seleniumhq.selenium:htmlunit-driver:2.33.3") {
44
		exclude group: "commons-logging", module: "commons-logging"
45
	}
46
	optional("org.seleniumhq.selenium:selenium-java:3.141.59") {
47 48
		exclude group: "commons-logging", module: "commons-logging"
		exclude group: "io.netty", module: "netty"
49
	}
50
	optional("org.xmlunit:xmlunit-matchers:2.6.2")
51 52
	optional("org.skyscreamer:jsonassert:1.5.0")
	optional("com.jayway.jsonpath:json-path:2.4.0")
53 54
	optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
	optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
55 56 57 58 59 60 61
	optional("io.projectreactor:reactor-test")
	testCompile(project(":spring-context-support"))
	testCompile(project(":spring-oxm"))
	testCompile("javax.annotation:javax.annotation-api:1.3.2")
	testCompile("javax.cache:cache-api:1.1.0")
	testCompile("javax.ejb:javax.ejb-api:3.2")
	testCompile("javax.interceptor:javax.interceptor-api:1.2.2")
62
	testCompile("javax.mail:javax.mail-api:1.6.2")
63
	testCompile("org.hibernate:hibernate-core:5.3.12.Final")
64
	testCompile("org.hibernate:hibernate-validator:6.0.17.Final")
65
	// Enable use of the JUnit Platform Runner
66 67
	testCompile("org.junit.platform:junit-platform-runner")
	testCompile("org.junit.jupiter:junit-jupiter-params")
68
	testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
69
	testCompile("com.thoughtworks.xstream:xstream:1.4.11.1")
70
	testCompile("com.rometools:rome:1.12.2")
71
	testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
72 73
	testCompile("org.apache.tiles:tiles-core:${tiles3Version}", withoutJclOverSlf4j)
	testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}", withoutJclOverSlf4j)
74
	testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
75
	testCompile("org.apache.httpcomponents:httpclient:4.5.10") {
76
		exclude group: "commons-logging", module: "commons-logging"
77
	}
78 79
	testCompile("io.projectreactor.netty:reactor-netty")
	testCompile("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1")
80 81
	// Pull in the latest JUnit 5 Launcher API and the Vintage engine as well
	// so that we can run JUnit 4 tests in IntelliJ IDEA.
82 83 84 85 86 87
	testRuntime("org.junit.jupiter:junit-jupiter-engine")
	testRuntime("org.junit.platform:junit-platform-launcher")
	testRuntime("org.junit.vintage:junit-vintage-engine")
	testRuntime("org.glassfish:javax.el:3.0.1-b08")
	testRuntime("com.sun.xml.bind:jaxb-core:2.3.0.1")
	testRuntime("com.sun.xml.bind:jaxb-impl:2.3.0.1")
88 89
}

90 91 92 93
task junit4(type: Test) {
	description = "Runs JUnit 4 tests."
	useJUnit()
	systemProperty("testGroups", project.properties.get("testGroups"))
94
	scanForTestClasses = false
95 96
	include(["**/*Tests.class", "**/*Test.class"])
	exclude(["**/Abstract*.class", "**/testng/**/*.*", "**/jupiter/**/*.*"])
97 98
}

99
task junitJupiter(type: Test) {
100
	description = "Runs JUnit Jupiter tests."
101
	useJUnitPlatform {
102 103
		includeEngines "junit-jupiter"
		excludeTags "failing-test-case"
104 105
	}
	filter {
106
		includeTestsMatching "org.springframework.test.context.junit.jupiter.*"
107
	}
108
	systemProperty("testGroups", project.properties.get("testGroups"))
109
	// Java Util Logging for the JUnit Platform.
110
	// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
111 112
}

113 114 115 116
task testNG(type: Test) {
	description = "Runs TestNG tests."
	useTestNG()
	systemProperty("testGroups", project.properties.get("testGroups"))
117
	scanForTestClasses = false
118 119 120 121 122 123 124 125 126 127
	include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
	// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
	// testLogging.showStandardStreams = true
	// forkEvery 1
}

test {
	description = "Runs all tests."
	dependsOn junit4, junitJupiter, testNG
	exclude(["**/*.*"])
128 129 130
}

task aggregateTestReports(type: TestReport) {
131
	description = "Aggregates JUnit and TestNG test reports."
132
	destinationDir = test.reports.html.destination
133
	reportOn junit4, junitJupiter, testNG
134 135
}

136
check.dependsOn aggregateTestReports