1. 30 8月, 2014 4 次提交
    • S
      Add HTTP status to ServletRequestHandledEvent · 36542549
      Sebastien Deleuze 提交于
      Issue: SPR-12119
      36542549
    • S
      Revise JUnit vs. Spring timeout support in reference manual · 5857cef0
      Sam Brannen 提交于
      Prior to this commit, the discussion of JUnit vs. Spring with regard to
      timeout support in tests erroneously claimed that Spring's support for
      JUnit's @test(timeout=...) did not include set up and tear down or
      repetitions. This information, however, was based on a previous version
      of SpringJUnit4ClassRunner and is no longer valid.
      
      This commit revises the affected section of the testing chapter in the
      reference manual accordingly.
      5857cef0
    • S
      Fix typos in reference manual · ac164088
      Sam Brannen 提交于
      manger --> manager
      ac164088
    • B
      Change resource handler XML Namespace · 76c46fdb
      Brian Clozel 提交于
      This commit changes the way a <mvc:resource-cache> can be configured
      with a user defined Cache instance.
      
      Now a reference to a CacheManager Bean and a Cache name must be
      provided. This is a more flexible configuration for typical XML setups.
      
        <mvc:resource-cache
          cache-manager="resourceCache"
          cache-name="test-resource-cache"/>
      
      Issue: SPR-12129
      76c46fdb
  2. 29 8月, 2014 9 次提交
    • R
      Remove assertion on number of resource locations · 4df05d1f
      Rossen Stoyanchev 提交于
      With the new ResourceResolver abstraction and resource resolver chain
      in 4.1, the assumption that resources are found by checking for the URL
      path under the configured locations is no longer accurate.
      
      A custom ResourceResolver could find resources in ways that don't
      depend on a list of locations.
      
      Issuse: SPR-12133
      4df05d1f
    • B
      Update resource handler XML Namespace · d9f4016c
      Brian Clozel 提交于
      This change introduces a new <mvc:resource-chain/> tag that mirrors
      the ResourceChainRegistration java config counterpart.
      
      Resolvers and Transformers can be registered with bean/ref tags, and
      specific tags have been created for <mvc:version-resovlver> and
      <mvc:resource-cache> in order to make common configurations easier.
      
      Note that a specific "auto-configuration" attribute on the
      resource-chain allows to completely disable default registration of
      Resolvers and Transformers (sane defaults considered by the Framework).
      
        <mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/">
            <mvc:resource-chain>
              <mvc:resource-cache cache="resourceCache"/>
              <mvc:resolvers>
                <mvc:version-resolver>
                  <mvc:fixed-version-strategy version="abc" patterns="/**/*.js"/>
                  <mvc:content-version-strategy patterns="/**"/>
                </mvc:version-resolver>
              </mvc:resolvers>
              <mvc:transformers>
                <bean class="org.springframework.web.servlet.resource.AppCacheManifestTransformer"/>
              </mvc:transformers>
            </mvc:resource-chain>
        </mvc:resources>
      
      This also fixes a typo in the class name of
      AppCacheManifestResourceTransfo*r*mer.
      
      Issue: SPR-12129
      d9f4016c
    • S
      Refactor AssertThrows to support Throwable · 8008e466
      Sam Brannen 提交于
      Prior to this commit, AssertThrows in the spring-test module only
      supported Exception; however, there are legitimate test cases where the
      subject under test (SUT) may potentially throw a subclass of Throwable.
      
      This commit refactors AssertThrows so that it supports exceptions of
      type Throwable instead of the limiting support for Exception.
      Furthermore, AssertThrows has been refactored to use generics (e.g.,
      Class<? extends Throwable> instead of merely Class).
      
      Issue: SPR-6362
      8008e466
    • S
      Discontinue use of deprecated AssertThrows · 1bce6ac6
      Sam Brannen 提交于
      This commit refactors ReflectionTestUtilsTests so that it no longer uses
      the deprecated AssertThrows class.
      1bce6ac6
    • S
      Update Javadoc for AssertThrows · 27be396b
      Sam Brannen 提交于
      27be396b
    • R
      Update port related code in UriComponentsBuilder · a0b231d3
      Rossen Stoyanchev 提交于
      Use null to indicate no port has been provided.
      Raise exception when port has not been expanded.
      
      Issue: SPR-12123
      a0b231d3
    • S
      Support port URI template variables · 8fbd310b
      Sebastien Deleuze 提交于
      This commit makes it possible to specify port with an URI template variable.
      
      For example :
      RestTemplate restTemplate = new RestTemplate();
      restTemplate.getForObject("http://localhost:{port}/resource", String.class, 8080);
      
      Issue: SPR-12123
      8fbd310b
    • R
      Update resource handler Java config · 0b02551e
      Rossen Stoyanchev 提交于
      This change separates out resource chain related methods previously in
      ResourceHandlerRegistration into a new class ResourceChainRegistration
      with the goal of improving readability.
      
      Along with that, the registration of caching resolver and transformer
      is now explicitly controled with a boolean flag (on the method used
      to obtain the ResourceChainRegistration) and an overloaded method
      also allows providing a Cache instance.
      
      Issue: SPR-12124
      0b02551e
    • R
      Move builder methods to VersionResourceResolver · ae48b5f7
      Rossen Stoyanchev 提交于
      This change moves the VersionStrategy builder-style methods from
      ResourceHandlerRegistration to VersionResourceResolver.
      
      This makes the methods more universally usable and also makes use of
      ResourceHandlerRegistration more readable, i.e. simply a sequence of
      addResource and addTransformer calls.
      ae48b5f7
  3. 28 8月, 2014 2 次提交
    • S
      Honor scheme in MockHttpServletRequest.isSecure() · 0b0ddc6e
      Sam Brannen 提交于
      Prior to this commit the implementation of isSecure() in
      MockHttpServletRequest simply returned the value of the 'secure'
      boolean flag. Thus setting the scheme to 'https' had no effect on the
      value returned by isSecure() even though most non-mock implementations
      (e.g., Tomcat, Jetty, etc.) base the return value on the actual scheme
      in the request.
      
      This commit makes the behavior of MockHttpServletRequest.isSecure()
      more intuitive by honoring both the 'secure' boolean flag and the
      current value of the scheme.
      
      Issue: SPR-12098
      0b0ddc6e
    • R
      Add PathResourceResolver conditionally · fbfb7a3c
      Rossen Stoyanchev 提交于
      The ResourceHandlerRegistration now checks if the last resolver is an
      instance of PathResourceResolver and if so it skips adding it.
      
      This change also creates and adds the VersionResourceResolver (as well
      as CssLinkTransformer) the first time any VersionStrategy is
      registered. This ensures that custom resolvers (including an extension
      of PathResourceResolver) may be added both before and after the
      VersionResourceResolver.
      
      Lastly this change renames addVersion and addVersionHash to be
      consistent with addVersionStrategy.
      
      Issue: SPR-12124
      fbfb7a3c
  4. 27 8月, 2014 5 次提交
    • S
      Improve configuration changes in GuavaCacheManager · d47c5433
      Stephane Nicoll 提交于
      Prior to this commit, setting the parameters used to build the caches
      was fragile in static mode as the caches were created right when the
      setCacheNames setter was called.
      
      This commit provides a better handling of such arguments and also
      provide a way to restore the dynamic mode if necessary.
      
      Issue: SPR-12120
      d47c5433
    • S
      Update documentation · eee8184b
      Stephane Nicoll 提交于
      This commit updates the documentation to mention that the #result
      object is available in the SpEL context for computing the key to use
      for a @CachePut operation.
      
      Issue: SPR-12125
      eee8184b
    • S
      Improve ResolvableType.hashCode() for better performance · 7ea69fb9
      Sebastien Deleuze 提交于
      Prior to this commit, when there was a lot of entries in the
      ResolvableType.cache HashMap, getting a simple value could
      take a lot of time due to a lot of calls to ResolvableType.equals().
      ResolvableType.equals() used this.type, getSource(),
      this.variableResolver.getSource() and this.componentType, but
      ResolvableType.hashCode() used only this.type.
      
      With this commit, ResolvableType.hashCode() now uses the same
      fields than ResolvableType.equals().
      
      Performance on the spring-resolvabletype-benchmark project:
       - 8000 us before this commit
       - 120 us with this commit
      
      Issue: SPR-12122
      7ea69fb9
    • S
      How to register MIME types in MockServletContext · d5c6bcb9
      Sam Brannen 提交于
      Prior to this commit, it was unclear that it was possible to register
      custom MIME types when using MockServletContext.
      
      This commit updates the Javadoc for MockServletContext.getMimeType()
      with an example of how to achieve this using the MimetypesFileTypeMap
      from the Java Activation Framework.
      
      Issue: SPR-12126
      d5c6bcb9
    • S
      Verify custom MIME type support in MockServletContext · 2f2fe9bd
      Sam Brannen 提交于
      2f2fe9bd
  5. 26 8月, 2014 3 次提交
  6. 25 8月, 2014 2 次提交
  7. 23 8月, 2014 4 次提交
  8. 22 8月, 2014 10 次提交
  9. 21 8月, 2014 1 次提交