1. 26 2月, 2014 1 次提交
    • S
      Do not inspect meta-annotations on Java annotations · 979c4833
      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
      979c4833
  2. 25 2月, 2014 1 次提交
    • S
      Always supply test class to ContextLoaders in TCF · 78b69f5d
      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
      78b69f5d
  3. 23 2月, 2014 3 次提交
    • S
      Support arbitrary meta-annotation levels in the TCF · f8950960
      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
      f8950960
    • S
      Update copyright date in ContextLoaderUtils · dc6eaad2
      Sam Brannen 提交于
      dc6eaad2
    • S
      Always pass test class to ActiveProfilesResolver · 5f7d1758
      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
      5f7d1758
  4. 19 2月, 2014 1 次提交
  5. 14 2月, 2014 1 次提交
  6. 12 2月, 2014 1 次提交
  7. 10 2月, 2014 1 次提交
    • A
      Fixed example in JavaDoc. · 1cf38a98
      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.
      1cf38a98
  8. 09 2月, 2014 1 次提交
  9. 24 1月, 2014 1 次提交
    • H
      Fixed code example in JavaDoc · 0013a432
      hupfis 提交于
      equalTo is not a valid method on JsonPathResultMatchers
      
      I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.
      0013a432
  10. 23 1月, 2014 1 次提交
    • S
      Handle NoClassDefFoundError consistently for TELs · fb12e234
      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
      fb12e234
  11. 21 1月, 2014 1 次提交
  12. 17 1月, 2014 1 次提交
    • S
      Improve logging in TransactionalTEL · 6e308513
      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
      6e308513
  13. 16 1月, 2014 1 次提交
  14. 15 1月, 2014 1 次提交
  15. 14 1月, 2014 4 次提交
  16. 06 1月, 2014 1 次提交
  17. 24 12月, 2013 1 次提交
    • R
      Introduce AbstractMockMvcBuilder class · 2e4f38f6
      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
      2e4f38f6
  18. 11 12月, 2013 4 次提交
    • S
      Document meta-annotation support in the TCF · a223e247
      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
      a223e247
    • S
      Polish meta-annotation terminology in MetaAnnoUtils · da7ae4a6
      Sam Brannen 提交于
      da7ae4a6
    • S
      Do not repopulate RequestContextHolder in ServTEL · 800018a8
      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
      800018a8
    • S
      Honor presence of @WebAppConfiguration in ServTEL · 099b10d2
      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
      099b10d2
  19. 09 12月, 2013 1 次提交
    • S
      Ensure ServTEL doesn't reset ReqAttrs by accident · a3b022aa
      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
      a3b022aa
  20. 06 12月, 2013 1 次提交
  21. 03 12月, 2013 2 次提交
  22. 27 11月, 2013 3 次提交
    • P
      General polish of new 4.0 classes · 15698860
      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
      15698860
    • P
      Fix various javadoc warnings · a31ac882
      Phillip Webb 提交于
      a31ac882
    • S
      Support meta-annotation attr overrides in the TCF · 64f593db
      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
      64f593db
  23. 26 11月, 2013 4 次提交
    • R
      Fix concurrency issue in TestDispatcherServlet · 119e7939
      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
      119e7939
    • S
      Polish Javadoc for @IfProfileValue · a5d87fff
      Sam Brannen 提交于
      a5d87fff
    • S
      Provide meta-annotation support for @Rollback · 412f74f6
      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
      412f74f6
    • P
      Fix remaining compiler warnings · 59002f24
      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
      59002f24
  24. 22 11月, 2013 1 次提交
  25. 20 11月, 2013 1 次提交
  26. 15 11月, 2013 1 次提交