Spring Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.9 KiB

description = "Spring TestContext Framework"
apply plugin: "kotlin"
dependencies {
api(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"))
1 year ago
optional("com.jayway.jsonpath:json-path")
optional("io.micrometer:context-propagation")
optional("io.micrometer:micrometer-observation")
optional("io.projectreactor:reactor-test")
optional("jakarta.activation:jakarta.activation-api")
optional("jakarta.el:jakarta.el-api")
optional("jakarta.inject:jakarta.inject-api")
optional("jakarta.servlet:jakarta.servlet-api")
optional("jakarta.servlet.jsp:jakarta.servlet.jsp-api")
optional("jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api")
optional("jakarta.websocket:jakarta.websocket-api")
optional("jakarta.websocket:jakarta.websocket-client-api")
optional("jakarta.xml.bind:jakarta.xml.bind-api")
optional("junit:junit")
optional("net.sourceforge.htmlunit:htmlunit") {
exclude group: "commons-logging", module: "commons-logging"
}
optional("org.apache.groovy:groovy")
optional("org.apache.tomcat.embed:tomcat-embed-core")
optional("org.aspectj:aspectjweaver")
optional("org.hamcrest:hamcrest")
optional("org.jetbrains.kotlin:kotlin-reflect")
optional("org.jetbrains.kotlin:kotlin-stdlib")
optional("org.jetbrains.kotlinx:kotlinx-coroutines-core")
optional("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
optional("org.junit.jupiter:junit-jupiter-api")
optional("org.junit.platform:junit-platform-launcher") // for AOT processing
optional("org.seleniumhq.selenium:htmlunit-driver") {
exclude group: "commons-logging", module: "commons-logging"
exclude group: "net.bytebuddy", module: "byte-buddy"
}
optional("org.seleniumhq.selenium:selenium-java") {
exclude group: "net.bytebuddy", module: "byte-buddy"
}
optional("org.skyscreamer:jsonassert")
optional("org.testng:testng")
optional("org.xmlunit:xmlunit-matchers")
testImplementation(project(":spring-context-support"))
testImplementation(project(":spring-core-test"))
testImplementation(project(":spring-oxm"))
testImplementation(testFixtures(project(":spring-beans")))
testImplementation(testFixtures(project(":spring-context")))
testImplementation(testFixtures(project(":spring-core")))
testImplementation(testFixtures(project(":spring-tx")))
testImplementation(testFixtures(project(":spring-web")))
testImplementation("com.fasterxml.jackson.core:jackson-databind")
testImplementation("com.rometools:rome")
testImplementation("com.thoughtworks.xstream:xstream")
1 year ago
testImplementation("de.bechte.junit:junit-hierarchicalcontextrunner")
testImplementation("io.projectreactor.netty:reactor-netty-http")
testImplementation("jakarta.annotation:jakarta.annotation-api")
testImplementation("jakarta.ejb:jakarta.ejb-api")
testImplementation("jakarta.interceptor:jakarta.interceptor-api")
testImplementation("jakarta.mail:jakarta.mail-api")
1 year ago
testImplementation("jakarta.validation:jakarta.validation-api")
testImplementation("javax.cache:cache-api")
testImplementation("org.apache.httpcomponents:httpclient") {
exclude group: "commons-logging", module: "commons-logging"
}
testImplementation("org.awaitility:awaitility")
testImplementation("org.hibernate:hibernate-core-jakarta")
testImplementation("org.hibernate:hibernate-validator")
testImplementation("org.hsqldb:hsqldb")
testImplementation("org.junit.platform:junit-platform-testkit")
testRuntimeOnly("com.sun.xml.bind:jaxb-core")
testRuntimeOnly("com.sun.xml.bind:jaxb-impl")
testRuntimeOnly("org.glassfish:jakarta.el")
testRuntimeOnly("org.junit.support:testng-engine")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine") {
exclude group: "junit", module: "junit"
}
testRuntimeOnly("org.yaml:snakeyaml")
}
Ensure projects can be imported into Eclipse IDE with JDK 17 Prior to this commit, the Spring Framework projects could not be imported into Eclipse IDE when using JDK 17 to build the projects. The primary obstacle is the fact that Eclipse enforces a strict "no split packages between the unnamed module and a system module" rule when building with a "modular JDK" (such as JDK 17). Resources: - https://bugs.eclipse.org/bugs/show_bug.cgi?id=536928 - https://bugs.openjdk.java.net/browse/JDK-8215739 - http://mail.openjdk.java.net/pipermail/jigsaw-dev/2018-December/014077.html - https://stackoverflow.com/questions/51094274/eclipse-cant-find-xml-related-classes-after-switching-build-path-to-jdk-10/53824670#53824670 Since the bug (JDK-8215739) has not been fixed in OpenJDK, the strict "no split packages" rule does not apply to the Java compiler used in Spring Framework's Gradle build or the compiler in IntelliJ IDEA. Hence, this issue only arrises when building the framework in Eclipse IDE. This commit addresses this issue in the following affected projects. - spring-oxm: removal of the dependency on XPP3 which publishes javax.xml.namespace.QName as part of the JAR. The QName type is also published by the java.xml JDK 17 system module. To make the tests pass, we have switched to using the DomDriver instead of the XppDriver in our XStream tests. - spring-test: HtmlUnit has a transitive dependency on xml-apis which publishes several packages also published by java.xml JDK 17 system module. Thus, we have explicitly excluded the transitive dependency on xml-apis for our `optional` configuration. See gh-27407
3 years ago
// Prevent xml-apis from being used so that the corresponding XML APIs from
// the JDK's `java.xml` module are used instead. This allows spring-test to
// build in Eclipse IDE which fails to compile if there is a split package
// between a JDK system module and the unnamed module (for JARs on the
// classpath).
configurations.optional {
exclude group: "xml-apis", module: "xml-apis"
}
test {
description = "Runs JUnit 4, JUnit Jupiter, and TestNG tests."
useJUnitPlatform {
includeEngines "junit-vintage", "junit-jupiter", "testng"
excludeTags "failing-test-case"
}
// We use `include` instead of `filter.includeTestsMatching`, since
// the latter results in some tests being executed/reported
// multiple times.
include(["**/*Tests.class", "**/*Test.class"])
filter.excludeTestsMatching("*TestCase")
systemProperty("testGroups", project.properties.get("testGroups"))
// Java Util Logging for the JUnit Platform.
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
}