diff --git a/build.gradle b/build.gradle index 3d40c547fc..a2824acd16 100644 --- a/build.gradle +++ b/build.gradle @@ -66,8 +66,8 @@ configure(allprojects) { project -> systemProperty("java.awt.headless", "true") systemProperty("testGroups", project.properties.get("testGroups")) scanForTestClasses = false - include(["**/*Tests.*", "**/*Test.*"]) - exclude "**/Abstract*.*" + include(["**/*Tests.class", "**/*Test.class"]) + exclude "**/Abstract*.class" } repositories { @@ -830,25 +830,17 @@ project("spring-test") { useTestNG() // forkEvery 1 scanForTestClasses = false - include(["**/testng/**/*Tests.*", "**/testng/**/*Test.*"]) - // "TestCase" classes are run by other test classes, not the build. - exclude(["**/Abstract*.*", "**/*TestCase.class", "**/FailingBeforeAndAfterMethodsTests.class"]) - // Show standard out and standard error of the test JVM(s) on the console + include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"]) + exclude "**/Abstract*.class" + // Show STD_OUT & STD_ERR of the test JVM(s) on the console: // testLogging.showStandardStreams = true } test { dependsOn testNG useJUnit() - include(["**/*Tests.*", "**/*Test.*"]) - // In general, we exclude all classes under the 'testng' package. - // "TestCase" classes are run by other test classes, not the build. - // "TestSuite" classes only exist as a convenience to the develper; they - // should not be run by the build. - exclude(["**/testng/**/*.*", "**/Abstract*.*", "**/*TestCase.class", "**/*TestSuite.class"]) - // FailingBeforeAndAfterMethodsTests is actually a JUnit-based test which - // itself runs TestNG manually in order to test our TestNG support. - include "**/testng/FailingBeforeAndAfterMethodsTests" + include(["**/*Tests.class", "**/*Test.class"]) + exclude(["**/Abstract*.class", "**/testng/**/*.*"]) } task aggregateTestReports(type: TestReport) { diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsJUnitTests.java similarity index 97% rename from spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java rename to spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsJUnitTests.java index 0f4fb93641..98f6ede608 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsJUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,12 +60,12 @@ import org.springframework.test.context.transaction.BeforeTransaction; * @since 2.5 */ @RunWith(Parameterized.class) -public class FailingBeforeAndAfterMethodsTests { +public class FailingBeforeAndAfterMethodsJUnitTests { protected final Class clazz; - public FailingBeforeAndAfterMethodsTests(final Class clazz) { + public FailingBeforeAndAfterMethodsJUnitTests(final Class clazz) { this.clazz = clazz; } diff --git a/spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java similarity index 95% rename from spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java rename to spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java index 74e8f2513a..25ff94b227 100644 --- a/spring-test/src/test/java/org/springframework/test/context/testng/FailingBeforeAndAfterMethodsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.test.context.testng; +package org.springframework.test.context.junit4; import static org.junit.Assert.assertEquals; @@ -30,6 +30,8 @@ import org.springframework.test.context.TestContext; import org.springframework.test.context.TestExecutionListener; import org.springframework.test.context.TestExecutionListeners; import org.springframework.test.context.support.AbstractTestExecutionListener; +import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; +import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; import org.testng.ITestContext; @@ -62,7 +64,7 @@ import org.testng.TestNG; * @since 2.5 */ @RunWith(Parameterized.class) -public class FailingBeforeAndAfterMethodsTests { +public class FailingBeforeAndAfterMethodsTestNGTests { protected final Class clazz; protected final int expectedTestStartCount; @@ -71,7 +73,7 @@ public class FailingBeforeAndAfterMethodsTests { protected final int expectedFailedConfigurationsCount; - public FailingBeforeAndAfterMethodsTests(final Class clazz, final int expectedTestStartCount, + public FailingBeforeAndAfterMethodsTestNGTests(final Class clazz, final int expectedTestStartCount, final int expectedTestSuccessCount, final int expectedFailureCount, final int expectedFailedConfigurationsCount) { this.clazz = clazz;