-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Provide meta-annotation support in the TCF #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Now using AnnotationUtils.getAnnotation() instead of Class.getAnnotation() where appropriate in the TestContext Framework. - Now using AnnotationUtils.findAnnotation() instead of Class.isAnnotationPresent() where appropriate in the TestContext Framework. - Introduced findAnnotationPrefersInteracesOverLocalMetaAnnotations() in AnnotationUtilsTests in order to verify the status quo. - Introduced MetaAnnotationUtils and AnnotationDescriptor in the spring-test module. - Verifying support for context hierarchies when @ContextConfiguration @ContextHierarchy are used as meta annotations. Issue: SPR-7827
meta annotations and interfaces. - Overhauled and documented MetaAnnotationUtils.AnnotationDescriptor. - @ignore'd failing tests in ContextLoaderUtilsContextHierarchyTests.
- Introduced findAnnotationDescriptorForTypes() in MetaAnnotationUtils.
annotation declaring classes.
@ContextConfiguration and @ContextHierarchy as meta-annotations.
@activeprofiles as a potential meta-annotation.
looking up @DirtiesContext as a potential meta-annotation. - Introduced unit tests in DirtiesContextTestExecutionListenerTests.
@IfProfileValue as a potential meta-annotation.
@ProfileValueSourceConfiguration as a potential meta-annotation.
looking up @TransactionConfiguration and @Rollback as potential meta-annotations.
@TestExecutionListeners as a potential meta-annotation.
as a target, allowing them to be used as meta-annotations. - TransactionalTestExecutionListener now uses AnnotationUtils for looking up @BeforeTransaction and @AfterTransaction as potential meta-annotations. - Introduced TransactionalTestExecutionListenerTests.
from the DefaultTestContext constructor to ContextLoaderUtils.buildMergedContextConfiguration().
@ContextConfiguration.
sbrannen
added a commit
that referenced
this pull request
Oct 28, 2013
* SPR-7827: Provide meta-annotation support in the TCF
Merged into master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Spring 3.0 already allows component stereotypes to be used in a
meta-annotation fashion, for example by creating a custom
@TransactionalService stereotype annotation which combines
@transactional and @service in a single, reusable, application-specific
annotation. However, the Spring TestContext Framework (TCF) currently
does not provide any support for test-related annotations to be used as
meta-annotations.
This commit overhauls the TCF with regard to how annotations are
retrieved and adds explicit support for the following annotations to be
used as meta-annotations in conjunction with the TCF.
Note that meta-annotation support for @transactional was already
available prior to this commit.
Issue: SPR-7827