Permalink
Commits on Mar 20, 2017
Commits on Mar 18, 2017
  1. Ensure RouterFunctionsTests class compiles in Eclipse

    Due to a type inference bug in Eclipse, an additional “hint” is
    required in order for RouterFunctionsTests to compile in Eclipse.
    sbrannen committed Mar 18, 2017
Commits on Mar 13, 2017
Commits on Jan 26, 2017
Commits on Jan 25, 2017
  1. Polishing

    sbrannen committed Jan 25, 2017
  2. Fix broken test in SpringJUnit4ConcurrencyTests

    Prior to this commit, SpringJUnit4ConcurrencyTests was broken due to
    recent additions of test methods in SampleTests.
    
    This commit fixes the broken test by removing hard coded constants and
    replacing them with dynamic lookups for JUnit 4 @Test methods.
    sbrannen committed Jan 25, 2017
Commits on Jan 21, 2017
  1. Update example copyright dates

    sbrannen committed on GitHub Jan 21, 2017
Commits on Jan 19, 2017
  1. Improve initialization of Assume class

    Prior to this commit, the org.springframework.tests.Assume class could
    fail to load resulting in a NoClassDefFoundError if parsing of the
    'testGroups' system property failed. This is because the parsing took
    place while initializing a static field.
    
    This commit addresses this issue by moving the 'testGroups' system
    property lookup to a dedicated method that is lazily invoked upon
    demand instead of eagerly when loading the Assume class itself.
    
    In addition, when an error occurs, TestGroup.parse() now logs the
    complete original value of the supplied test groups string instead of
    potentially omitting the "all-" prefix. This results in more
    informative error messages similar to the following.
    
      java.lang.IllegalStateException: Failed to parse 'testGroups' system
      property: Unable to find test group 'bogus' when parsing testGroups
      value: 'all-bogus'. Available groups include:
      [LONG_RUNNING,PERFORMANCE,JMXMP,CI]
    
    Issue: SPR-15163
    sbrannen committed Jan 19, 2017
Commits on Jan 18, 2017
  1. Use MockitoJUnitRunner from Mockito 2's preferred location

    Issue: SPR-14880
    sbrannen committed Jan 18, 2017
Commits on Jan 16, 2017
  1. Clean up warnings spring-test

    sbrannen committed Jan 16, 2017
Commits on Jan 7, 2017
  1. Ensure that JUnit Jupiter tests are executed during build

    After the upgrade to JUnit Jupiter 5.0 M3, JUnit Jupiter tests in the
    Spring build were no longer executed due to the introduction of a
    default test class name pattern.
    
    This commit addresses this issue by making use of the
    @IncludeClassNamePatterns to specify that *TestCase test classes should
    be executed within the org.springframework.test.context.junit.jupiter
    package.
    sbrannen committed Jan 7, 2017
Commits on Jan 6, 2017
Commits on Oct 28, 2016
  1. Polishing

    sbrannen committed Oct 28, 2016
Commits on Oct 27, 2016
  1. Support @EnabledIf & @DisabledIf w/o loading ApplicationContext

    Prior to this commit, when using @EnabledIf or @DisabledIf in Spring's
    JUnit Jupiter support, the test's ApplicationContext was always eagerly
    loaded, even if the ApplicationContext would never be used (i.e., the
    test was disabled). This behavior can lead to undesirable side effects
    -- for example, attempting to load an application context that requires
    services only available on the CI server when the test is not actually
    running on the CI server.
    
    This commit addresses this issue by introducing new boolean
    `loadContext` flags in @EnabledIf and @DisabledIf. By default these
    flags are set to false which means that the user's test application
    context will not be loaded to evaluate the expression. On the contrary,
    a dummy application context will be loaded instead, and expressions
    will be evaluated against that dummy context. Consequently, if the user
    wishes to interact with properties from the Spring Environment or with
    beans from the test application context, the `loadContext` must be
    explicitly set to true.
    
    In addition, expressions which evaluate to a String must now evaluate
    to exactly "true" or "false" (ignoring case and surrounding whitespace).
    
    Issue: SPR-14649
    sbrannen committed Oct 27, 2016
Commits on Oct 13, 2016
  1. Add support for URI templates in redirectedUrl() & forwardedUrl()

    Prior to this commit, the redirectedUrl() and forwardedUrl() methods in
    MockMvcResultMatchers supported fully constructed URLs and URLs
    containing Ant-style path patterns. However, URI templates were not
    supported for these result matchers even though the request path can be
    built using URL templates -- for example, via the get() and post()
    methods in MockMvcRequestBuilders.
    
    This commit addresses this shortcoming by allowing users to supply a
    URL template instead of a fully constructed URL to redirectedUrl() and
    forwardedUrl(). To populate the URL template, template variables may be
    supplied to redirectedUrl() and forwardedUrl() as var-args.
    
    Issue: SPR-14790
    sbrannen committed Oct 13, 2016
  2. Only print request/response body if char enc is present in MVC Test

    Commit e65a1a4 introduced support in PrintingResultHandler for only
    printing the request or response body in the Spring MVC Test framework
    if the content type is known to be text-based (e.g., plain text, HTML,
    XHTML, XML, JSON, etc.). For unknown content types the body is assumed
    to be text-based and is therefore always printed. The latter behavior,
    however, is undesirable since the content may in fact not be text-based.
    
    This commit addresses this issue by making the printing of the request
    or response body an opt-in feature. Specifically, if a character
    encoding has been set, the request or response body will be printed by
    the PrintingResultHandler. Note, however, that the character encoding
    is set to ISO-8859-1 in MockHttpServletResponse by default.
    
    In addition, MockHttpServletRequest's getContentAsString() method now
    throws an IllegalStateException if the character encoding has not been
    set.
    
    Issue: SPR-14776
    sbrannen committed Oct 12, 2016
Commits on Oct 11, 2016
  1. Fix punctuation in Javadoc

    sbrannen committed Oct 11, 2016
  2. Print only printable request/response body in MVC Test

    Prior to this commit, PrintingResultHandler always printed the request
    or response body regardless of its content type. For binary content,
    however, the output was unreadable and therefore useless.
    
    This commit addresses this issue by only printing the request or
    response body if it is "printable" (i.e., if its content type is known
    to be text-based such as plain text, HTML, XHTML, XML, JSON, etc.). If
    the content type is unknown (e.g., unspecified for the HTTP request in
    the test), it is assumed that the body is printable.
    
    Issue: SPR-14776
    sbrannen committed Oct 11, 2016
Commits on Oct 3, 2016
  1. Print request body in PrintingResultHandler in Spring MVC Test

    Prior to this commit, the PrintingResultHandler used by the various
    print() and log() methods in Spring MVC Test printed the response body
    but not the request body.
    
    Since request bodies are sometimes generated programmatically, however,
    it can be beneficial to have the dynamically generated request body
    logged as well.
    
    This commit therefore prints the request body in PrintingResultHandler
    by delegating to the recently introduced getContentAsString() method in
    MockHttpServletRequest.
    
    Issue: SPR-14717
    sbrannen committed Oct 3, 2016
  2. Introduce getContentAsByteArray()/getContentAsString() in MockHtttpSv…

    …ltReq
    
    In order to improve debugging and logging within test suites, this
    commit introduces getContentAsByteArray() and getContentAsString()
    methods in MockHttpServletRequest, analogous to the existing methods in
    MockHttpServletResponse.
    
    Issue: SPR-14717
    sbrannen committed Oct 3, 2016
Commits on Sep 17, 2016
  1. Introduce 'value' alias for @Bean's 'name' attribute

    In order to simplify configuration for use cases involving @Bean where
    only a bean name or aliases are supplied as an attribute, this commit
    introduces a new 'value' attribute that is an @AliasFor 'name' in @Bean.
    
    Issue: SPR-14728
    sbrannen committed Sep 17, 2016
Commits on Sep 9, 2016
  1. Upgrade to TestNG 6.9.12

    sbrannen committed Sep 9, 2016
Commits on Sep 5, 2016
  1. Fix section ID for parallel test execution

    Issue: SPR-5863
    sbrannen committed Sep 5, 2016
  2. Introduce concurrency tests for Spring's JUnit 4 support

    Whereas the existing TestContextConcurrencyTests verify support for
    concurrency in the TestContextManager and TestContext, this commit
    introduces SpringJUnit4ConcurrencyTests that verify support for
    concurrent test execution in Spring's JUnit 4 support, namely in the
    SpringRunner, SpringClassRule, and SpringMethodRule.
    
    The tests executed by this new test class come from a hand-picked
    collection of test classes within the test suite that is intended to
    cover most categories of tests that are currently supported by the
    TestContext Framework on JUnit 4.
    
    Note, however, that the chosen test classes intentionally do not
    include any classes that fall under the following categories.
    
     - tests that make use of Spring's @DirtiesContext support
    
     - tests that make use of JUnit 4's @FixMethodOrder support
    
     - tests that commit changes to the state of a shared in-memory database
    
    Issue: SPR-5863
    sbrannen committed Sep 5, 2016
  3. Improve exception msg for inactive test ApplicationContext

    This commit improves the exception message thrown when a test's
    ApplicationContext is no longer active by explaining that the cause
    may be due to parallel test execution.
    
    Issue: SPR-5863
    sbrannen committed Sep 5, 2016