1. 08 3月, 2016 2 次提交
    • S
      Polishing · 93fb7be7
      Sam Brannen 提交于
      93fb7be7
    • P
      Remove @BootstrapWith from @WebAppConfiguration · 504779e2
      Phillip Webb 提交于
      Update @WebAppConfiguration so that it no longer directly specifies
      a TestContextBootstrapper. This allows third parties to use the
      annotation in combination with their own bootstrapper.
      
      BootstrapUtils now provides the detection logic for when
      WebTestContextBootstrapper should be used.
      
      Issue: SPR-13991
      504779e2
  2. 10 4月, 2014 1 次提交
    • S
      Introduce context bootstrap strategy in the TCF · a281bdbf
      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
      a281bdbf
  3. 11 12月, 2013 1 次提交
    • 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
  4. 29 12月, 2012 1 次提交
  5. 11 12月, 2012 1 次提交
  6. 14 10月, 2012 1 次提交
  7. 08 10月, 2012 1 次提交
    • S
      Support loading WebApplicationContexts in the TCF · a73280cc
      Sam Brannen 提交于
      Prior to this commit, the Spring TestContext Framework only supported
      loading an ApplicationContext in integration tests from either XML or
      Java Properties files (since Spring 2.5), and Spring 3.1 introduced
      support for loading an ApplicationContext in integration tests from
      annotated classes (e.g., @Configuration classes). All of the
      ContextLoader implementations used to provide this support load a
      GenericApplicationContext. However, a GenericApplicationContext is not
      suitable for testing a web application since a web application relies on
      an implementation of WebApplicationContext (WAC).
      
      This commit makes it possible to integration test Spring-powered web
      applications by adding the following functionality to the Spring
      TestContext Framework.
      
       - Introduced AbstractGenericWebContextLoader and two concrete
         subclasses:
         - XmlWebContextLoader
         - AnnotationConfigWebContextLoader
      
       - Pulled up prepareContext(context, mergedConfig) from
         AbstractGenericContextLoader into AbstractContextLoader to allow it
         to be shared across web and non-web context loaders.
      
       - Introduced AnnotationConfigContextLoaderUtils and refactored
         AnnotationConfigContextLoader accordingly. These utils are also used
         by AnnotationConfigWebContextLoader.
      
       - Introduced a new @WebAppConfiguration annotation to denote that the
         ApplicationContext loaded for a test should be a WAC and to configure
         the base resource path for the root directory of a web application.
      
       - Introduced WebMergedContextConfiguration which extends
         MergedContextConfiguration with support for a baseResourcePath for
         the root directory of a web application.
      
       - ContextLoaderUtils.buildMergedContextConfiguration() now builds a
         WebMergedContextConfiguration instead of a standard
         MergedContextConfiguration if @WebAppConfiguration is present on the
         test class.
      
       - Introduced a configureWebResources() method in
         AbstractGenericWebContextLoader that is responsible for creating a
         MockServletContext with a proper ResourceLoader for the
         resourceBasePath configured in the WebMergedContextConfiguration. The
         resulting mock ServletContext is set in the WAC, and the WAC is
         stored as the Root WAC in the ServletContext.
      
       - Introduced a WebTestExecutionListener that sets up default thread
         local state via RequestContextHolder before each test method by using
         the MockServletContext already present in the WAC and by creating a
         MockHttpServletRequest, MockHttpServletResponse, and
         ServletWebRequest that is set in the RequestContextHolder. WTEL also
         ensures that the MockHttpServletResponse and ServletWebRequest can be
         injected into the test instance (e.g., via @Autowired) and cleans up
         thread locals after each test method.
      
       - WebTestExecutionListener is configured as a default
         TestExecutionListener before DependencyInjectionTestExecutionListener
      
       - Extracted AbstractDelegatingSmartContextLoader from
         DelegatingSmartContextLoader and introduced a new
         WebDelegatingSmartContextLoader.
      
       - ContextLoaderUtils now selects the default delegating ContextLoader
         class name based on the presence of @WebAppConfiguration on the test
         class.
      
       - Tests in the spring-test-mvc module no longer use a custom
         ContextLoader to load a WebApplicationContext. Instead, they now
         rely on new core functionality provided in this commit.
      
      Issue: SPR-5243
      a73280cc
  8. 28 5月, 2012 1 次提交
  9. 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
  10. 07 3月, 2009 2 次提交
  11. 20 11月, 2008 1 次提交
  12. 23 10月, 2008 1 次提交
  13. 22 10月, 2008 1 次提交