Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Mar 29, 2014

  1. Sam Brannen

    Reinject Servlet mocks between TestNG test methods

    Prior to this commit, if multiple test methods were executed in a
    subclass of AbstractTestNGSpringContextTests annotated with
    @WebAppConfiguration, then injected Servlet API mocks would only
    reference the mocks created for the first test method. Subsequent test
    methods could therefore never reference the current mocks, and there
    was a discrepancy between the state of the injected mocks and the mock
    set in the RequestContextHolder.
    
    This commit addresses this issue by ensuring that dependencies
    (including updated mocks) are injected into the test instance before
    the next test method if the ServletTestExecutionListener resets the
    request attributes in RequestContextHolder.
    
    Issue: SPR-11626
    (cherry picked from commit c386007)
    authored March 29, 2014

Mar 24, 2014

  1. Consistently applied appropriate ByteArrayOutputStream initial capaci…

    …ties across the codebase
    
    Issue: SPR-11594
    (cherry picked from commit dd7f54c)
    authored March 25, 2014

Jan 22, 2014

  1. Sam Brannen

    Handle NoClassDefFoundError consistently for TELs

    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
    
    Backport-Commit: fb12e23
    authored January 22, 2014

Jan 21, 2014

  1. Sam Brannen

    Include ServletTEL in abstract base test classes

    The ServletTestExecutionListener is now prepended to the set of default
    listeners in AbstractJUnit4SpringContextTests and
    AbstractTestNGSpringContextTests.
    
    Issue: SPR-11340
    
    Backport-Commit: 3370f8b
    authored January 21, 2014

Jan 15, 2014

  1. Polishing

    authored January 15, 2014

Dec 11, 2013

  1. Sam Brannen

    Make methods of TestContext non-final

    This commit makes several methods of TestContext non-final in order to
    allow TestContext to be mocked — for example with Mockito.
    
    Note, however, that TestContext has been converted to an interface in
    Spring Framework 4.0.
    
    Issue: SPR-11144
    authored December 11, 2013
  2. Sam Brannen

    Do not repopulate RequestContextHolder in ServTEL

    This commit fixes a bug introduced in the last commit.
    
    ServletTestExecutionListener (STEL) now tracks whether it has already
    populated the RequestContextHolder.
    
    Issue: SPR-11144
    
    Backport-Commit: 800018a
    authored December 11, 2013

Dec 10, 2013

  1. Sam Brannen

    Honor presence of @WebAppConfiguration in ServTEL

    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
    
    Backport-Commit: 099b10d
    authored December 10, 2013

Dec 09, 2013

  1. Sam Brannen

    Ensure ServTEL doesn't reset ReqAttrs by accident

    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
    
    Backport-Commit: a3b022a
    authored December 09, 2013

Dec 02, 2013

  1. Polishing

    authored December 02, 2013

Oct 21, 2013

  1. Sam Brannen

    Assert context uniqueness against merged config

    Prior to this commit, the uniqueness check for @ContextConfiguration
    attributes within a @ContextHierarchy was performed at a single test
    class level instead of against the merged configuration for all test
    class levels in the test class hierarchy.
    
    This commit addresses this issue by moving the uniqueness check
    algorithm from resolveContextHierarchyAttributes() to
    buildContextHierarchyMap() within ContextLoaderUtils.
    
    Issue: SPR-11011
    Backport-Commit: 7658d85
    authored October 21, 2013

Sep 25, 2013

  1. Fixed BadSqlGrammarException usage in transaction test suite

    Issue: SPR-10902
    authored September 25, 2013

May 07, 2013

  1. Fixed javadoc warnings

    Issue: SPR-10373
    (cherry picked from commit 1ca943c)
    authored May 07, 2013

Mar 10, 2013

  1. Sam Brannen

    Document context hierarchy support in the TCF

    This commit polishes the Javadoc for @ContextHierarchy and
    @ContextConfiguration.
    
    Issue: SPR-10357
    authored March 10, 2013
  2. Sam Brannen

    Document context hierarchy support in the TCF

    This commit adds examples to the Javadoc for @ContextHierarchy and
    updates the Javadoc for @ContextConfiguration accordingly.
    
    Issue: SPR-10357
    authored March 10, 2013

Mar 07, 2013

  1. Use null in MockServletContext for unknown mime types

    MockServletContext.getMimeTypes now returns null if the Java Activation
    Framework returns "application/octet-stream", which is the default
    media type it returns if the mime type is unknown. This enforces the
    contract for ServletContext.getMimeTypes (return null for uknown mime
    types) but does mean "application/octet-stream" cannot be returned.
    
    Issue: SPR-10334
    authored March 07, 2013
  2. Sam Brannen

    Provide support for context hierarchies in the TCF

    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
    authored January 11, 2013

Mar 06, 2013

  1. Phil Webb

    Replace EasyMock with Mockito

    Issue: SPR-10126
    authored March 04, 2013

Feb 28, 2013

  1. Sam Brannen

    Suppress warnings for resource leaks

    authored February 28, 2013
  2. Sam Brannen

    Update spring-test re: deprecated queryForInt()

    Now invoking JdbcTemplate's queryForObject() method instead
    of the deprecated queryForInt() method within the test suite.
    
    Issue: SPR-10257
    authored February 28, 2013
  3. Sam Brannen

    Update JdbcTestUtils re: deprecated queryForInt()

    JdbcTestUtils now invokes JdbcTemplate's queryForObject() method instead
    of the deprecated queryForInt() method.
    
    Issue: SPR-10257
    authored February 28, 2013
  4. Sam Brannen

    Update JdbcTestUtils re: deprecated queryForInt()

    JdbcTestUtils now invokes JdbcTemplate's queryForObject() method instead
    of the deprecated queryForInt() method.
    
    Issue: SPR-10257
    authored February 28, 2013

Feb 25, 2013

  1. Phil Webb

    Add JdbcTestUtils.deleteRowsInTableWhere method

    Issue: SPR-10302
    authored February 25, 2013

Feb 04, 2013

  1. Phil Webb

    Polish formatting

    Minor formatting polish across that codebase. Primarily fixing
    whitespace issues.
    authored February 01, 2013

Jan 31, 2013

  1. Phil Webb

    Merge branch 'cleanup-3.2.x' into 3.2.x

    * cleanup-3.2.x:
      Fix unnecessary @SupressWarnings annotations
      Fix Javadoc warnings
      Fix unused local variable warnings
      Fix unused type compiler warnings
      Fix 'is already an instance of type' warnings
    authored January 31, 2013

Jan 30, 2013

  1. Consistent use of LinkedHashMaps and independent getAttributeNames En…

    …umeration in Servlet/Portlet mocks
    
    Issue: SPR-10224
    authored January 30, 2013

Jan 29, 2013

  1. Sam Brannen

    Improve Javadoc for ContextLoaderUtils

    - class-level Javadoc now mentions application context initializers.
    - avoided and suppressed warnings in method-level Javadoc.
    
    Issue: SPR-10232
    authored January 29, 2013

Jan 25, 2013

  1. Phil Webb

    Fix unused type compiler warnings

    authored January 25, 2013

Jan 22, 2013

  1. Phil Webb

    Polish AbstractContextLoader Javadoc

    Fix unnecessary HTML escaping from {@code} Javadoc.
    authored January 22, 2013
  2. MockHttpServletResponse's getHeaderNames declares Collection instead …

    …of Set for Servlet 3.0 compatibility
    
    Issue: SPR-9885
    authored January 21, 2013 unknown committed January 22, 2013
  3. MockHttpServletRequest's getParameter(Values) returns null for null p…

    …arameter name
    
    Issue: SPR-10192
    authored January 21, 2013 unknown committed January 22, 2013

Jan 21, 2013

  1. Chris Beams

    Merge branch 'SPR-9984' into 3.2.x

    * SPR-9984:
      Add TimedSpringRunnerTests to performance test group
    authored January 21, 2013
  2. Chris Beams

    Add TimedSpringRunnerTests to performance test group

    Issue: SPR-9984
    authored January 21, 2013

Jan 14, 2013

  1. Sam Brannen

    Fix copyright year & method names in spring-test

    This commit fixes the copyright year for changes made in commit
    5b147bf. In addition, method names
    have been changed to reflect the semantic changes made in that same
    commit.
    authored January 14, 2013

Jan 11, 2013

  1. Sam Brannen

    Improve speed of spring-test build

    - Now excluding *TestSuite classes from the JUnit test task.
    - Renamed SpringJUnit4SuiteTests to SpringJUnit4TestSuite so that it is
      no longer executed in the build.
    - Reduced sleep time in various timing related tests.
    authored January 11, 2013
Something went wrong with that request. Please try again.