- 26 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
This commit introduces a new isInJavaLangAnnotationPackage(Annotation) method in AnnotationUtils. This method is now used in AnnotationUtils, AnnotatedElementUtils, and MetaAnnotationUtils to ensure that search algorithms do no search for meta-annotations on annotations in the "java.lang.annotation" package. The following are some empirical results from this change: - The number of times that the findAnnotation(Class,Class,Set) method in AnnotationUtils is recursively invoked while executing AnnotationUtilsTests drops from 51 to 29. - The number of times that the process(AnnotatedElement) method in AnnotationUtils.AnnotationCollector is recursively invoked while executing AnnotationUtilsTests.getRepeatableFromMethod() drops from 16 to 2. - The number of times that the doProcess() method in AnnotatedElementUtils is recursively invoked while executing the "getAnnotationAttributes() On MetaCycleAnnotatedClass with missing target meta-annotation" test in AnnotatedElementUtilsTests drops from 23 to 5. - The number of times that the findAnnotationDescriptor(Class,Set,Class) method in MetaAnnotationUtils is recursively invoked while executing the "findAnnotationDescriptor() on MetaCycleAnnotatedClass with missing target meta-annotation" test in MetaAnnotationUtilsTests drops from 16 to 8. Issue: SPR-11483
-
- 25 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the following methods in ContextLoaderUtils treated a composed @ContextConfiguration annotation (i.e., a custom annotation that is meta-annotated with @ContextConfiguration) as the "declaring class" instead of the actual test class. - resolveContextConfigurationAttributes() - resolveContextHierarchyAttributes() As a consequence, if @ContextConfiguration is used as a meta-annotation, the meta-annotated class is stored as the "declaringClass" in ContextConfigurationAttributes. Thus, when a ContextLoader (or SmartContextLoader) attempts to detect default resource locations or configuration classes, it does so for the composed annotation class instead of for the declaring test class. This commit ensures that ContextLoaders are supplied the declaring test class instead of the composed annotation class in such use cases. Issue: SPR-11455
-
- 23 2月, 2014 3 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the findAnnotationDescriptor() and findAnnotationDescriptorForTypes() methods in MetaAnnotationUtils only supported a single level of meta-annotations. In particular, this kept the following annotations from being used as meta-annotations on meta-annotations: - @ContextConfiguration - @ContextHierarchy - @ActiveProfiles - @TestExecutionListeners This commit alters the search algorithms used in MetaAnnotationUtils so that arbitrary levels of meta-annotations are now supported for the aforementioned test-related annotations. Issue: SPR-11470
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
Prior to this commit, if @ActiveProfiles were used as a meta-annotation on a composed annotation, then the composed annotation's class would be passed to the ActiveProfilesResolver.resolve() method instead of the test class, which breaks the contract for ActiveProfilesResolver. This commit addresses this issue by ensuring that the actual test class is always passed to ActiveProfilesResolver.resolve(). Issue: SPR-11467
-
- 19 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
-
- 14 2月, 2014 1 次提交
-
-
由 Rossen Stoyanchev 提交于
Issue: SPR-11424
-
- 12 2月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 10 2月, 2014 1 次提交
-
-
由 Anton Bobov 提交于
mimeType is not a valid method on ContentResultMatche. I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.
-
- 09 2月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
-
- 24 1月, 2014 1 次提交
-
-
由 hupfis 提交于
equalTo is not a valid method on JsonPathResultMatchers I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.
-
- 23 1月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, a NoClassDefFoundError caught in TestContextManager's retrieveTestExecutionListeners() method would be handled differently for implicit default listeners (i.e., listeners not declared via @TestExecutionListeners) and listeners explicitly declared via @TestExecutionListeners. Specifically, a NoClassDefFoundError would cause a test to fail for an explicitly declared TestExecutionListener but not for an implicitly declared one. This commit addresses this issue by: - Always swallowing a NoClassDefFoundError for both implicitly and explicitly declared TestExecutionListeners. - Changing the log level from DEBUG to INFO to make such situations more visible to the average end user. Issue: SPR-11347
-
- 21 1月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
The ServletTestExecutionListener is now prepended to the set of default listeners in AbstractJUnit4SpringContextTests and AbstractTestNGSpringContextTests. Issue: SPR-11340
-
- 17 1月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
This commit makes the logging in TransactionalTestExecutionListener consistent for both starting and ending transactions. Specifically, the current TestContext is now included in the informational log statement when starting a new transaction. Issue: SPR-11323
-
- 16 1月, 2014 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 15 1月, 2014 1 次提交
-
-
由 Rossen Stoyanchev 提交于
When adding headers generically, MockHttpServletRequestBuilder now recognizes Content-Type and updates the contentType field accordingly. Issue: SPR-11308
-
- 14 1月, 2014 4 次提交
-
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
-
由 Greg Turnquist 提交于
Issue: SPR-11299 This is short to avoid having to use MockMvcRequestBuilders.request() and instead have a simple patch(url, params...)
-
- 06 1月, 2014 1 次提交
-
-
由 Sam Brannen 提交于
-
- 24 12月, 2013 1 次提交
-
-
由 Rossen Stoyanchev 提交于
This change splits out an abstract base class from DefaultMockMvcBuilder with StandaloneMockMvcBuilder switching to extend the new abstract class (rather than DefaultMockMvcBuilder). Issue: SPR-11238
-
- 11 12月, 2013 4 次提交
-
-
由 Sam Brannen 提交于
- Completed Javadoc for MetaAnnotationUtils. - Added Javadoc notes to multiple annotations in the TCF, pointing out which annotations can be used as meta-annotations. Issue: SPR-11109
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
This commit fixes a bug introduced in the last commit. ServletTestExecutionListener (STEL) now tracks whether it has already populated the RequestContextHolder. Issue: SPR-11144
-
由 Sam Brannen 提交于
The previous commit for issue SPR-11144 revealed a bug in ServletTestExecutionListener (STEL). Specifically, STEL acted on the fact that the ApplicationContext for a given TestContext was an instance of WebApplicationContext. This behavior could potentially break test code from previous releases of the Spring Framework that relied on a custom setup of the RequestAttributes in the RequestContextHolder with a custom WebApplicationContext ContextLoader. This commit addresses this issue by ensuring that STEL only comes into play if the test class is annotated with @WebAppConfiguration (for prepareTestInstance() and beforeTestMethod()) or if the TestContext attribute named RESET_REQUEST_CONTEXT_HOLDER_ATTRIBUTE is set to Boolean.TRUE (for afterTestMethod()). Issue: SPR-11144
-
- 09 12月, 2013 1 次提交
-
-
由 Sam Brannen 提交于
Prior to this commit, the ServletTestExecutionListener did not overwrite RequestAttributes in the RequestContextHolder if the ApplicationContext associated with the given TestContext was not a WebApplicationContext; however, the ServletTestExecutionListener would clear the RequestAttributes after every test method execution, regardless of whether the context was a WebApplicationContext or not. This behavior breaks backwards compatibility with integration tests that managed the RequestAttributes in RequestContextHolder themselves. This commit addresses this issue by introducing a TestContext attribute named RESET_REQUEST_CONTEXT_HOLDER_ATTRIBUTE in ServletTestExecutionListener. This attribute is used internally within ServletTestExecutionListener to ensure that the RequestContextHolder is only cleared (i.e., reset) if the ServletTestExecutionListener actually populated the RequestContextHolder. Issue: SPR-11144
-
- 06 12月, 2013 1 次提交
-
-
由 Sam Brannen 提交于
-
- 03 12月, 2013 2 次提交
-
-
由 Juergen Hoeller 提交于
-
由 Juergen Hoeller 提交于
-
- 27 11月, 2013 3 次提交
-
-
由 Phillip Webb 提交于
Apply consistent styling to new classes introduced in Spring 4.0. - Javadoc line wrapping, whitespace and formatting - General code whitespace - Consistent Assert.notNull messages
-
由 Phillip Webb 提交于
-
由 Sam Brannen 提交于
Prior to this commit, the Spring TestContext Framework (TCF) supported the use of test-related annotations as meta-annotations for composing custom test stereotype annotations; however, attributes in custom stereotypes could not be used to override meta-annotation attributes. This commit addresses this by allowing attributes from the following annotations (when used as meta-annotations) to be overridden in custom stereotypes. - @ContextConfiguration - @ActiveProfiles - @DirtiesContext - @TransactionConfiguration - @Timed - @TestExecutionListeners This support depends on functionality provided by AnnotatedElementUtils. See the 'Notes' below for further details and ramifications. Notes: - AnnotatedElementUtils does not support overrides for the 'value' attribute of an annotation. It is therefore not possible or not feasible to support meta-annotation attribute overrides for some test-related annotations. - @ContextHierarchy, @WebAppConfiguration, @Rollback, @Repeat, and @ProfileValueSourceConfiguration define single 'value' attributes which cannot be overridden via Spring's meta-annotation attribute support. - Although @IfProfileValue has 'values' and 'name' attributes, the typical usage scenario involves the 'value' attribute which is not supported for meta-annotation attribute overrides. Furthermore, 'name' and 'values' are so generic that it is deemed unfeasible to provide meta-annotation attribute override support for these. - @BeforeTransaction and @AfterTransaction do not define any attributes that can be overridden. - Support for meta-annotation attribute overrides for @Transactional is provided indirectly via SpringTransactionAnnotationParser. Implementation Details: - MetaAnnotationUtils.AnnotationDescriptor now provides access to the AnnotationAttributes for the described annotation. - MetaAnnotationUtils.AnnotationDescriptor now provides access to the root declaring class as well as the declaring class. - ContextLoaderUtils now retrieves AnnotationAttributes from AnnotationDescriptor to look up annotation attributes for @ContextConfiguration and @ActiveProfiles. - ContextConfigurationAttributes now provides a constructor to have its attributes sourced from an instance of AnnotationAttributes. - ContextLoaderUtils.resolveContextHierarchyAttributes() now throws an IllegalStateException if no class in the class hierarchy declares @ContextHierarchy. - TransactionalTestExecutionListener now uses AnnotatedElementUtils to look up annotation attributes for @TransactionConfiguration. - Implemented missing unit tests for @Rollback resolution in TransactionalTestExecutionListener. - SpringJUnit4ClassRunner now uses AnnotatedElementUtils to look up annotation attributes for @Timed. - TestContextManager now retrieves AnnotationAttributes from AnnotationDescriptor to look up annotation attributes for @TestExecutionListeners. - DirtiesContextTestExecutionListener now uses AnnotatedElementUtils to look up annotation attributes for @DirtiesContext. Issue: SPR-11038
-
- 26 11月, 2013 4 次提交
-
-
由 Rossen Stoyanchev 提交于
This change fixes a timing issue in tests using Spring MVC Tests where assertions on an async result may not wait long enough. The fix involves the use of a new callback in MockAsyncContext that allows tests to detect when an async dispatch has been invoked. Issue: SPR-10838
-
由 Sam Brannen 提交于
-
由 Sam Brannen 提交于
@Rollback now supports ANNOTATION_TYPE as a target, allowing it to be used as meta-annotation. Note: this change was accidentally omitted from the original commit for SPR-7827. Issue: SPR-7827
-
由 Phillip Webb 提交于
Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
-
- 22 11月, 2013 1 次提交
-
-
由 Sam Brannen 提交于
-
- 20 11月, 2013 1 次提交
-
-
由 Juergen Hoeller 提交于
-
- 15 11月, 2013 1 次提交
-
-
由 Juergen Hoeller 提交于
Issue: SPR-11069
-