1. 19 2月, 2015 9 次提交
  2. 18 2月, 2015 2 次提交
    • S
      Make TestPropertySourceUtils more robust · d98f626b
      Sam Brannen 提交于
       - Added assertions for pre-conditions on method arguments for all
         public utility methods.
      
       - Introduced additional tests in TestPropertySourceUtilsTests to verify
         the new pre-conditions.
      
       - Introduced INLINED_PROPERTIES_PROPERTY_SOURCE_NAME constant for the
         name of the MapPropertySource created from inlined properties; the
         name therefore no longer contains the inlined properties, but the
         original values of the inlined properties can now be logged at debug
         level.
      
       - Simplified tests in InlinedPropertiesTestPropertySourceTests.
      
      Issue: SPR-12721
      (cherry picked from commit 42af3303)
      d98f626b
    • S
      Polish Javadoc for @TestPropertySource · b8dbf234
      Sam Brannen 提交于
      (cherry picked from commit 0267715c)
      b8dbf234
  3. 17 2月, 2015 3 次提交
    • S
      Open up TestPropertySourceUtils for public consumption · 2b135f0d
      Sam Brannen 提交于
      Spring Framework 4.1 introduced support for @TestPropertySource;
      however, the utilities used to parse inlined properties and add test
      property sources to the environment are currently private which
      prevents reuse by third-party frameworks like Spring Boot.
      
      This commit addresses this issue by making such utilities public.
      
       - TestPropertySourceUtils is now a public class.
      
       - Various utility methods in TestPropertySourceUtils have been made
         public.
      
       - addResourcePropertySourcesToEnvironment() has been renamed to
         addPropertiesFilesToEnvironment().
      
       - extractEnvironmentProperties() has been renamed to
         convertInlinedPropertiesToMap().
      
       - All public methods in TestPropertySourceUtils are now fully
         documented.
      
      Issue: SPR-12721
      (cherry picked from commit 75e0bc92)
      2b135f0d
    • S
      Preserve ordering of inlined props in @TestPropertySource · e5d41d91
      Sam Brannen 提交于
      The initial implementation for adding inlined properties configured via
      @TestPropertySource to the context's environment did not preserve the
      order in which the properties were physically declared. This makes
      @TestPropertySource a poor testing facility for mimicking the
      production environment's configuration if the property source mechanism
      used in production preserves ordering of property names -- which is the
      case for YAML-based property sources used in Spring Boot, Spring Yarn,
      etc.
      
      This commit addresses this issue by ensuring that the ordering of
      inlined properties declared via @TestPropertySource is preserved.
      Specifically, the original functionality has been refactored. extracted
      from AbstractContextLoader, and moved to TestPropertySourceUtils where
      it may later be made public for general purpose use in other frameworks.
      
      Issue: SPR-12710
      (cherry picked from commit d6a799ad)
      e5d41d91
    • R
      Pass SockJS session attributes to HandshakeHandler · f398dd03
      Rossen Stoyanchev 提交于
      Before this change the WebSocketTransportHandler passed
      Collections.emptyMap as attributes to the HandshakeHandler because
      it didn't matter what attributes the underlying WebSocketSession has
      since it is wrapped by the SockJsSession and that's what exposed for
      use everywhere.
      
      This change has the WebSocketTransportHandler passing the attributes
      from the SockJsSession instead since it's more accurate for the
      underlying WebSocketSession to have access to the same map instance
      and it allows the HandshakeHandler to change the attributes even if
      it doesn't need to do that today.
      
      Issue: SPR-12716
      f398dd03
  4. 13 2月, 2015 1 次提交
  5. 12 2月, 2015 4 次提交
    • A
      Fix Animal Sniffer · 9499e416
      Andy Wilkinson 提交于
      Jasper Reports’ transitive dependency on spring-context (via
      castor-xml which is a new dependency in 6.0.3) was being mapped by
      Gradle to a dependency on the spring-context project. For reasons that
      I do not fully understand this was causing -source and -javadoc jars
      to be added to the project's compile classpath which is used by the
      Animal Sniffer Ant task. When the task runs these jars do not exist
      which causes it to fail. This commit fixes the problem by adding an
      exclusion of org.springframework:spring-context to the Jasper Reports
      dependencies in spring-context-support and spring-webmvc.
      (cherry picked from commit 7a6a1320)
      9499e416
    • J
      bf442c09
    • J
      Combined backport of Jackson configuration enhancements: Locale/TimeZone... · fab8dd3d
      Juergen Hoeller 提交于
      Combined backport of Jackson configuration enhancements: Locale/TimeZone settings, refined module configuration
      
      Issue: SPR-12594
      Issue: SPR-12634
      fab8dd3d
    • S
      BeanWrapper auto-grows arrays if necessary · 1646f627
      Stephane Nicoll 提交于
      Previously, only indexed access for collections were supported. When
      attempting to access the element of an array that had not the requested
      size, the call would fail with an IndexOutOfBoundException
      
      This commit harmonize the binding support so that the array is updated
      according to the requested index if necessary.
      
      Issue: SPR-12706
      (cherry picked from commit aa213396)
      1646f627
  6. 11 2月, 2015 5 次提交
  7. 10 2月, 2015 1 次提交
    • R
      Add fromHttpRequest to UriComponentsBuilder · 4a423e50
      Rossen Stoyanchev 提交于
      Before this change, detection of X-Forwarded-* headers was only built
      into ServletUriComponentsBuilder.
      
      This change adds a new method for creating a UriComponentsBuilder from
      an existing HttpRequest. This is equivalent to the fromUri method +
      X-Forwarded-* header values.
      4a423e50
  8. 09 2月, 2015 10 次提交
    • B
      Revisit empty body response support in HTTP client · 0225a777
      Brian Clozel 提交于
      Prior to this commit, HTTP responses without body (response status 204
      or 304, Content-Length: 0) were handled properly by RestTemplates. But
      some other cases were not properly managed, throwing exceptions for
      valid HTTP responses.
      
      This commit better handles HTTP responses, using a response wrapper that
      can tell if a response:
      
      * has no message body (HTTP status 1XX, 204, 304 or Content-Length:0)
      * has an empty message body
      
      This covers rfc7230 Section 3.3.3.
      
      Issue: SPR-8016
      0225a777
    • B
      Sort handler matches in ResourceUrlProvider · d57f7f87
      Brian Clozel 提交于
      Prior to this change, the `ResourceUrlProvider.getForLookupPath` method
      would try to match handlers using the keySet order in the
      handlerMappings Map. In case of several matches, the handler used for
      the return value could vary, since the registration order in the
      handlerMappings can't be guaranteed in the configuration.
      
      This commit now collects all matching handlers and sort them using a
      `PatternComparator`, in order to try each handler from the most specific
      mapping to the least.
      
      Issue: SPR-12647
      d57f7f87
    • B
      Avoid loss of body content in AbstractRequestLoggingFilter · 4550b4a2
      Brian Clozel 提交于
      Prior to this commit, the `ContentCachingRequestWrapper` class would
      cache the response content only if the reponse would be consumed using
      its InputStream. In case of a Form request, Spring MVC consumes the
      response using the `getParameter*` Servlet API methods. This causes the
      cached content to never be written.
      
      This commit makes the `ContentCachingResponseWrapper` write the request
      body to the cache buffer by using the `getParameter*` API, thus avoiding
      those issues.
      
      Issue: SPR-7913
      4550b4a2
    • B
      Initialize ResourceUrlProvider only once · f902fb91
      Brian Clozel 提交于
      Prior to this change, the ResourceUrlProvider would listen to
      ContextRefreshedEvents and autodetect resource handlers each time. This
      can cause issues when multiple contexts are involved and the last one
      has no resource handler, thus clearing the previously detected ones.
      
      This commit disables resource handlers auto-detection once some have
      been detected with a refreshed context.
      
      Issue: SPR-12592
      f902fb91
    • B
      Allow relative paths within resource location path · 77c8aa53
      Brian Clozel 提交于
      Prior to this change, location paths used for resource handling would
      not allow "non-cleaned, relative paths" such as
      `file://home/user/static/../static/`. When checking if the resolved
      resource's path starts with the location path, a mismatch would happen
      when comparing for example:
      
      * the location `file://home/user/static/../static/`
      * and the resource `file://home/user/static/resource.txt`
      
      This commit cleans the location path before comparing it to the resource
      path.
      
      Issue: SPR-12624
      77c8aa53
    • B
      Allow protocol relative URLs in CssLink Transformer · bb5da15e
      Brian Clozel 提交于
      This commit allows the use of "protcol relative URLs" (i.e. URLs without
      scheme, starting with `//`), often used to serve resources automatically
      from https or http with third party domains.
      
      This syntax is allowed by RFC 3986.
      
      Issue: SPR-12632
      bb5da15e
    • B
      Fix context-relative default value in XML parsing · 0c8d07fc
      Brian Clozel 提交于
      This commit fixes the default value for the contextRelative attribute of
      a RedirectView, when this view is registered via a
      RedirectViewController in XML. The value is set to true.
      
      Note that the default value for this is correctly documented in
      spring-mvc-4.1.xsd. Also, the documentation and implementation for its
      javadoc counterpart also enforces true as a default value.
      
      Issue: SPR-12607
      0c8d07fc
    • S
      Clarify the use of @Cacheable in PostConstruct code · 47fdac92
      Stephane Nicoll 提交于
      Update documentation to explicitly mention that the cache interceptor
      must be fully initialized to provide the expected behavior and therefore
      initialization code should not rely on this feature, i;e. typically in
      PostConstruct callback.
      
      Since the Transactional infrastructure has the exact same infrastructure,
      update that section of the doc as well.
      
      Issue: SPR-12700
      47fdac92
    • S
      Fix broken build · 7ffa845a
      Stephane Nicoll 提交于
      Add required  `@Deprecated` annotation.
      7ffa845a
    • S
      Allow MBeans to be excluded additively · 09bd7037
      Stephane Nicoll 提交于
      Previously, one could only set the list of bean names to exclude from
      auto-detection and there was no way to add additional bean names.
      
      MBeanExporter now exposes a addExcludedBean method that can be invoked
      during the initialization phase to add bean names to ignore.
      
      Issue: SPR-12686
      09bd7037
  9. 03 2月, 2015 3 次提交
  10. 02 2月, 2015 1 次提交
    • S
      Allow subclasses to configure the Yaml instance · 6fce6d46
      Stephane Nicoll 提交于
      Provide an additional hook-point for YamlProcessor subclasses willing to
      change how the Yaml instance is configured. Also expose the default
      StrictMapAppenderConstructor so that  they can compose a custom instance
      with it.
      
      Issue: SPR-12671
      6fce6d46
  11. 24 1月, 2015 1 次提交
    • S
      Support @Configuration as meta-annotation in the TCF · 0c856b3d
      Sam Brannen 提交于
      Spring Framework 4.0 introduced support for using test-related
      annotations as meta-annotations in the Spring TestContext Framework
      (TCF) in order to create custom composed annotations within a test
      suite; however, the detection of default @Configuration classes in test
      classes was not updated to search for @Configuration declared as a
      meta-annotation. Specifically, AnnotationConfigContextLoaderUtils
      invokes Class.isAnnotated() which only searches for annotations
      declared directly on the class in question.
      
      This commit addresses this issue by refactoring the
      isDefaultConfigurationClassCandidate() method in
      AnnotationConfigContextLoaderUtils so that it uses
      AnnotationUtils.findAnnotation() instead of Class.isAnnotated() for
      detecting the presence of the @Configuration annotation, either
      directly or as a meta-annotation.
      
      Issue: SPR-12659
      (cherry picked from commit 2d918380)
      0c856b3d