- 05 7月, 2016 1 次提交
-
-
由 Stephane Nicoll 提交于
Issue: SPR-13188
-
- 28 3月, 2016 1 次提交
-
-
由 Sam Brannen 提交于
-
- 24 3月, 2016 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-13440
-
- 08 12月, 2015 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 14 6月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
In AnnotatedElementUtils, all methods pertaining to merging annotation attributes have been renamed to "getMerged*()" and "findMerged*()" accordingly. Existing methods such as getAnnotationAttributes(..) have been deprecated in favor of the more descriptive "merged" variants. This aligns the naming conventions in AnnotatedElementUtils with those already present in AnnotationReadingVisitorUtils. The use of "annotationType" as a variable name for the fully qualified class name of an annotation type has been replaced with "annotationName" in order to improve the readability and intent of the code base. In MetaAnnotationUtils.AnnotationDescriptor, getMergedAnnotation() has been renamed to synthesizeAnnotation(), and the method is now overridden in UntypedAnnotationDescriptor to always throw an UnsupportedOperationException in order to avoid potential run-time ClassCastExceptions. Issue: SPR-11511
-
- 29 5月, 2015 1 次提交
-
-
由 Sam Brannen 提交于
Spring Framework 4.2 RC1 introduced support for synthesizing an annotation from an existing annotation in order to provide additional functionality above and beyond that provided by Java. Specifically, such synthesized annotations provide support for @AliasFor semantics. As luck would have it, the same principle can be used to synthesize an annotation from any map of attributes, and in particular, from an instance of AnnotationAttributes. The following highlight the major changes in this commit toward achieving this goal. - Introduced AnnotationAttributeExtractor abstraction and refactored SynthesizedAnnotationInvocationHandler to delegate to an AnnotationAttributeExtractor. - Extracted code from SynthesizedAnnotationInvocationHandler into new AbstractAliasAwareAnnotationAttributeExtractor and DefaultAnnotationAttributeExtractor implementation classes. - Introduced MapAnnotationAttributeExtractor for synthesizing an annotation that is backed by a map or AnnotationAttributes instance. - Introduced a variant of synthesizeAnnotation() in AnnotationUtils that accepts a map. - Introduced findAnnotation(*) methods in AnnotatedElementUtils that synthesize merged AnnotationAttributes back into an annotation of the target type. The following classes have been refactored to use the new support for synthesizing AnnotationAttributes back into an annotation. - ApplicationListenerMethodAdapter - TestAnnotationUtils - AbstractTestContextBootstrapper - ActiveProfilesUtils - ContextLoaderUtils - DefaultActiveProfilesResolver - DirtiesContextTestExecutionListener - TestPropertySourceAttributes - TestPropertySourceUtils - TransactionalTestExecutionListener - MetaAnnotationUtils - MvcUriComponentsBuilder - RequestMappingHandlerMapping In addition, this commit also includes changes to ensure that arrays returned by synthesized annotations are properly cloned first. Issue: SPR-13067
-
- 21 10月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 22 4月, 2014 1 次提交
-
-
由 Stephane Nicoll 提交于
-
- 10 4月, 2014 2 次提交
-
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
Work done in conjunction with SPR-5243 and SPR-4588 introduced physical package cycles in the spring-test module. The work performed in conjunction with SPR-9924 uses reflection to resolve these physical package cycles; however, prior to this commit the logical package cycles still remain. Furthermore, over time it has become apparent that the Spring TestContext Framework (TCF) could better serve application developers and especially third-party framework developers by providing a more flexible mechanism for "bootstrapping" the TCF. For example, prior to this commit, default TestExecutionListeners could only be registered by subclassing TestContextManager (and SpringJUnit4ClassRunner if using JUnit). Similarly, the default ContextLoader could only be set by subclassing SpringJUnit4ClassRunner for JUnit and by copying and modifying AbstractTestNGSpringContextTests for TestNG. This commit addresses the aforementioned issues by introducing a bootstrap strategy in the TestContext framework that is responsible for determining default TestExecutionListeners and the default ContextLoader in an extensible fashion. The new TestContextBootstrapper SPI also provides a mechanism for supporting various types of MergedContextConfiguration depending on the feature set of the context loaders supported by the strategy. The following provides an overview of the most significant changes in this commit. - Introduced TestContextBootstrapper strategy SPI, BootstrapContext, and @BootstrapWith. - Introduced AbstractTestContextBootstrapper, DefaultTestContextBootstrapper, and WebTestContextBootstrapper implementations of the TestContextBootstrapper SPI and extracted related reflection code from ContextLoaderUtils & TestContextManager. - Introduced BootstrapUtils for retrieving the TestContextBootstrapper from @BootstrapWith, falling back to a default if @BootstrapWith is not present. - @WebAppConfiguration is now annotated with @BootstrapWith(WebTestContextBootstrapper.class). - CacheAwareContextLoaderDelegate is now an interface with a new DefaultCacheAwareContextLoaderDelegate implementation class. - Introduced closeContext(MergedContextConfiguration, HierarchyMode) in CacheAwareContextLoaderDelegate. - DefaultTestContext now uses CacheAwareContextLoaderDelegate instead of interacting directly with the ContextCache. - DefaultTestContext now delegates to a TestContextBootstrapper for building the MergedContextConfiguration. - TestContextManager now delegates to TestContextBootstrapper for retrieving TestExecutionListeners. - Deleted TestContextManager(Class, String) constructor and SpringJUnit4ClassRunner.getDefaultContextLoaderClassName(Class) method since default ContextLoader support is now implemented by TestContextBootstrappers. - Extracted ActiveProfilesUtils from ContextLoaderUtils. - Extracted ApplicationContextInitializerUtils from ContextLoaderUtils. - MetaAnnotationUtils is now a public utility class in the test.util package. - Removed restriction in @ActiveProfiles that a custom resolver cannot be used with the 'value' or 'profiles' attributes. - Introduced DefaultActiveProfilesResolver. Issue: SPR-9955
-