Skip to content

Commit

Permalink
Add test task using Woodstox for XML serialization
Browse files Browse the repository at this point in the history
(cherry picked from commit 91fd95e)
  • Loading branch information
marcphilipp committed Dec 11, 2024
1 parent 8aa220f commit 3c868df
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9
xmlunit-assertj = { module = "org.xmlunit:xmlunit-assertj3", version.ref = "xmlunit" }
xmlunit-placeholders = { module = "org.xmlunit:xmlunit-placeholders", version.ref = "xmlunit" }
testingAnnotations = { module = "com.gradle:develocity-testing-annotations", version = "2.0.1" }
woodstox = { module = "com.fasterxml.woodstox:woodstox-core", version = "7.0.0" }

# Only declared here so Dependabot knows when to update the referenced versions
asciidoctorj-pdf = { module = "org.asciidoctor:asciidoctorj-pdf", version.ref = "asciidoctorj-pdf" }
Expand Down
17 changes: 17 additions & 0 deletions platform-tests/platform-tests.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ plugins {
id("junitbuild.jmh-conventions")
}

val woodstox = configurations.dependencyScope("woodstox")
val woodstoxRuntimeClasspath = configurations.resolvable("woodstoxRuntimeClasspath") {
extendsFrom(configurations.testRuntimeClasspath.get())
extendsFrom(woodstox.get())
}

dependencies {
// --- Things we are testing --------------------------------------------------
testImplementation(projects.junitPlatformCommons)
Expand Down Expand Up @@ -42,6 +48,7 @@ dependencies {
testRuntimeOnly(libs.groovy4) {
because("`ReflectionUtilsTests.findNestedClassesWithInvalidNestedClassFile` needs it")
}
woodstox(libs.woodstox)

// --- https://openjdk.java.net/projects/code-tools/jmh/ -----------------------
jmh(projects.junitJupiterApi)
Expand Down Expand Up @@ -79,6 +86,16 @@ tasks {
includeTags("junit4")
}
}
val testWoodstox by registering(Test::class) {
val test by testing.suites.existing(JvmTestSuite::class)
testClassesDirs = files(test.map { it.sources.output.classesDirs })
classpath = files(sourceSets.main.map { it.output }) + files(test.map { it.sources.output }) + woodstoxRuntimeClasspath.get()
group = JavaBasePlugin.VERIFICATION_GROUP
setIncludes(listOf("**/org/junit/platform/reporting/**"))
}
check {
dependsOn(testWoodstox)
}
}

eclipse {
Expand Down

0 comments on commit 3c868df

Please sign in to comment.