Browse Source

Ensure all tests in spring-test are executed

Prior to this commit TestNG tests would only be executed by the Gradle
build if they were located in the “testng” package. Tests in subpackages
would therefore be omitted from the build.

This commit ensures that all TestNG classes in the “testng” package and
any of its subpackages are executed in the Gradle build.

Furthermore, this commit ensures that the JUnit-based
FailingBeforeAndAfterMethodsTests test class is executed along with the
other JUnit tests even though it resides under the “testng” package.

Issue: SPR-11338

Backport-Commit: 098d7c7465
pull/465/head
Sam Brannen 12 years ago
parent
commit
fdac4a7d18
  1. 8
      build.gradle

8
build.gradle

@ -694,19 +694,23 @@ project("spring-test") { @@ -694,19 +694,23 @@ project("spring-test") {
task testNG(type: Test) {
useTestNG()
// forkEvery 1
scanForTestClasses = false
include "**/testng/*.*"
include "**/testng/**/*.*"
exclude "**/FailingBeforeAndAfterMethodsTests.class"
// "TestCase" classes are run by other test classes, not the build.
exclude "**/*TestCase.class"
// Generate TestNG reports alongside JUnit reports.
testReport true
// show standard out and standard error of the test JVM(s) on the console
// testLogging.showStandardStreams = true
}
test {
dependsOn testNG
useJUnit()
exclude "**/testng/*.*"
exclude "**/testng/**/*.*"
include "**/testng/FailingBeforeAndAfterMethodsTests"
// "TestCase" classes are run by other test classes, not the build.
exclude(["**/*TestCase.class", "**/*TestSuite.class"])
}

Loading…
Cancel
Save