-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Sam Brannen opened SPR-11384 and commented
Status Quo
Although the naming convention for test classes within the test suite for the Spring Framework has always been "*Tests" (as opposed to the Maven convention of "*Test"), time and time again a test class slips into version control with a "Test" suffix. This causes the tests in question to be ignored by the build.
Analysis
In Eclipse, type Ctrl + Shift + T
and then enter "org.springframework.*.*Test " (without the quotes but with the trailing space). This will display a dialog containing all classes currently named "*Test" as opposed to "*Tests". As of the time of this writing, this results in the following:
- org.springframework.context.groovy.ScopeTest
- org.springframework.context.support.SimpleThreadScopeTest
- org.springframework.core.GenericTypeResolverTests.ITest
- org.springframework.core.type.CachingMetadataReaderLeakTest
- org.springframework.http.client.support.ProxyFactoryBeanTest
- org.springframework.jdbc.datasource.DelegatingDataSourceTest
- org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControlTest
- org.springframework.test.context.junit4.aci.annotation.InitializerWithoutConfigFilesOrClassesTest
- org.springframework.test.context.junit4.profile.resolver.ClassNameActiveProfilesResolverTest
- org.springframework.test.context.ContextLoaderUtilsActiveProfilesTests.*:
- NullActiveProfilesResolverTest
- NoDefaultConstructorActiveProfilesResolverTest
- FooActiveProfilesResolverTest
- InheritedFooActiveProfilesResolverTest
- MergedInheritedFooActiveProfilesResolverTest
- OverridenInheritedFooActiveProfilesResolverTest
- ConflictingResolverAndProfilesTest
- ConflictingResolverAndValueTest
- ConflictingProfilesAndValueTest
- org.springframework.test.context.OverriddenMetaAnnotationAttributesTests.MetaLocationsConfigTest
- org.springframework.test.context.OverriddenMetaAnnotationAttributesTests.MetaValueConfigTest
- org.springframework.test.context.OverriddenMetaAnnotationAttributesTests.OverriddenMetaLocationsConfigTest
- org.springframework.test.context.OverriddenMetaAnnotationAttributesTests.OverriddenMetaValueConfigTest
- org.springframework.test.context.web.WebTest
- org.springframework.util.xml.DomContentHandlerTest
- org.springframework.web.filter.HiddenHttpMethodFilterTest
Furthermore, AnnotationDrivenStaticEntityMockingControlTest
contains broken tests.
Deliverables
- Rename all *Test classes:
- Real test classes named "*Test" must be renamed to "*Tests".
- Internal test classes that are not actually executed by the build should be renamed to "*TestCase".
- The
@WebTest
test annotation should be renamed to something ending in neither "Test" nor "Tests".
- Broken tests in
AnnotationDrivenStaticEntityMockingControlTest
should be disabled and fixed in conjunction with a separate, dedicated issue. - Modify Gradle build to include "*Test" in addition to "*Tests" for test classes.
Affects: 4.0.1
Issue Links:
- Fix off-by-one regression in AbstractMethodMockingControl [SPR-11385] #16012 Fix off-by-one regression in AbstractMethodMockingControl
Referenced from: commits b8ed2f4