1. 07 3月, 2013 1 次提交
    • S
      Provide support for context hierarchies in the TCF · 98074e77
      Sam Brannen 提交于
      Prior to this commit the Spring TestContext Framework supported creating
      only flat, non-hierarchical contexts. There was no easy way to create
      contexts with parent-child relationships.
      
      This commit addresses this issue by introducing a new @ContextHierarchy
      annotation that can be used in conjunction with @ContextConfiguration
      for declaring hierarchies of application contexts, either within a
      single test class or within a test class hierarchy. In addition,
      @DirtiesContext now supports a new 'hierarchyMode' attribute for
      controlling context cache clearing for context hierarchies.
      
      - Introduced a new @ContextHierarchy annotation.
      - Introduced 'name' attribute in @ContextConfiguration.
      - Introduced 'name' property in ContextConfigurationAttributes.
      - TestContext is now aware of @ContextHierarchy in addition to
        @ContextConfiguration.
      - Introduced findAnnotationDeclaringClassForTypes() in AnnotationUtils.
      - Introduced resolveContextHierarchyAttributes() in ContextLoaderUtils.
      - Introduced buildContextHierarchyMap() in ContextLoaderUtils.
      - @ContextConfiguration and @ContextHierarchy may not be used as
        top-level, class-level annotations simultaneously.
      - Introduced reference to the parent configuration in
        MergedContextConfiguration and WebMergedContextConfiguration.
      - Introduced overloaded buildMergedContextConfiguration() methods in
        ContextLoaderUtils in order to handle context hierarchies separately
        from conventional, non-hierarchical contexts.
      - Introduced hashCode() and equals() in ContextConfigurationAttributes.
      - ContextLoaderUtils ensures uniqueness of @ContextConfiguration
        elements within a single @ContextHierarchy declaration.
      - Introduced CacheAwareContextLoaderDelegate that can be used for
        loading contexts with transparent support for interacting with the
        context cache -- for example, for retrieving the parent application
        context in a context hierarchy.
      - TestContext now delegates to CacheAwareContextLoaderDelegate for
        loading contexts.
      - Introduced getParentApplicationContext() in MergedContextConfiguration
      - The loadContext(MergedContextConfiguration) methods in
        AbstractGenericContextLoader and AbstractGenericWebContextLoader now
        set the parent context as appropriate.
      - Introduced 'hierarchyMode' attribute in @DirtiesContext with a
        corresponding HierarchyMode enum that defines EXHAUSTIVE and
        CURRENT_LEVEL cache removal modes.
      - ContextCache now internally tracks the relationships between contexts
        that make up a context hierarchy. Furthermore, when a context is
        removed, if it is part of a context hierarchy all corresponding
        contexts will be removed from the cache according to the supplied
        HierarchyMode.
      - AbstractGenericWebContextLoader will set a loaded context as the
        ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE in the MockServletContext when
        context hierarchies are used if the context has no parent or if the
        context has a parent that is not a WAC.
      - Where appropriate, updated Javadoc to refer to the
        ServletTestExecutionListener, which was introduced in 3.2.0.
      - Updated Javadoc to avoid and/or suppress warnings in spring-test.
      - Suppressed remaining warnings in code in spring-test.
      
      Issue: SPR-5613, SPR-9863
      98074e77
  2. 14 1月, 2013 1 次提交
    • S
      Minor changes to AnnotationUtils · 8694a0aa
      Sam Brannen 提交于
      - Polished Javadoc for isAnnotationDeclaredLocally() and
        isAnnotationInherited().
      - Removed unnecessary call to Arrays.asList() in
        isAnnotationDeclaredLocally().
      8694a0aa
  3. 29 12月, 2012 1 次提交
  4. 17 5月, 2012 1 次提交
    • P
      Fix annotation search ending too early · ef7e728b
      Petr Janecek 提交于
      In AnnotationUtils#findAnnotation(Method, Class), the search for a
      method annotation fails if:
      
       - the original method does not have the annotation
      
       - an abstract superclass does not have an equivalent method declared
      
       - an interface implemented by the superclass has the method and
         the annotation -> this should be found, but is not!
      
      This happens because the try-catch block in #findAnnotation is too wide:
      cl.getDeclaredMethod() can throw NoSuchMethodException and skip the
      '#searchOnInterfaces' call prematurely.
      
      The try-catch block was made narrower to allow #searchOnInterfaces to
      be called even if the abstract class does not have the method declared
      at all.
      
      Issue: SPR-9342
      ef7e728b
  5. 31 1月, 2012 1 次提交
    • C
      Rename modules {org.springframework.*=>spring-*} · 02a4473c
      Chris Beams 提交于
      This renaming more intuitively expresses the relationship between
      subprojects and the JAR artifacts they produce.
      
      Tracking history across these renames is possible, but it requires
      use of the --follow flag to `git log`, for example
      
          $ git log spring-aop/src/main/java/org/springframework/aop/Advisor.java
      
      will show history up until the renaming event, where
      
          $ git log --follow spring-aop/src/main/java/org/springframework/aop/Advisor.java
      
      will show history for all changes to the file, before and after the
      renaming.
      
      See http://chrisbeams.com/git-diff-across-renamed-directories
      02a4473c
  6. 30 11月, 2011 1 次提交
  7. 29 11月, 2011 1 次提交
  8. 10 10月, 2011 1 次提交
    • C
      Refactor AnnotationUtils#findAllAnnotationAttributes · 6837111b
      Chris Beams 提交于
      Remove all convenience variants of #findAllAnnotationAttributes and
      refactor the remaining method to accept a MetadataReaderFactory
      instead of creating its own SimpleMetadataReaderFactory internally.
      This allows clients to use non-default class loaders as well as
      customize the particular MetadataReaderFactory to be used (e.g.
      'simple' vs 'caching', etc).
      
      Issue: SPR-8752
      6837111b
  9. 27 7月, 2011 1 次提交
  10. 22 7月, 2011 1 次提交
  11. 07 5月, 2011 2 次提交
  12. 15 10月, 2010 1 次提交
  13. 14 10月, 2010 1 次提交
  14. 15 8月, 2010 1 次提交
  15. 15 6月, 2010 2 次提交
  16. 10 12月, 2009 1 次提交
  17. 12 11月, 2009 1 次提交
  18. 09 9月, 2009 1 次提交
  19. 21 7月, 2009 1 次提交
  20. 26 4月, 2009 1 次提交
  21. 24 4月, 2009 1 次提交
  22. 20 4月, 2009 1 次提交
  23. 22 3月, 2009 1 次提交
  24. 20 1月, 2009 1 次提交
  25. 21 11月, 2008 1 次提交
  26. 22 10月, 2008 1 次提交