Skip to content

Ensure all tests are executed in the Gradle build [SPR-11384] #16011

@spring-projects-issues

Description

@spring-projects-issues

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

  1. 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".
  2. Broken tests in AnnotationDrivenStaticEntityMockingControlTest should be disabled and fixed in conjunction with a separate, dedicated issue.
  3. Modify Gradle build to include "*Test" in addition to "*Tests" for test classes.

Affects: 4.0.1

Issue Links:

Referenced from: commits b8ed2f4

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions