Commit Graph

14134 Commits

Author SHA1 Message Date
Rossen Stoyanchev
e2e5e7653c Add mention of WebFlux testing support 2017-02-13 15:42:54 -05:00
Brian Clozel
4ff17676d3 Avoid duplicate Content-Length headers in Netty client
This commit checks that a "Content-Length" request header isn't already
present before adding one in `Netty4ClientHttpRequestFactory`.
`HttpMessageConverter` implementations can write that request header so
the Netty request factory should only write that value when the header
is missing.

If that header is not written (and since we're not dealing with
the HTTP exchange in a chunked-based fashion), the HTTP client might not
send the request body at all.

Issue: SPR-15241
2017-02-13 21:07:35 +01:00
Brian Clozel
28e77fa68a Assert XML without considering order in XmlExpectationsHelper
This commit changes the `assertXmlEqual` implementation to compare
expected and actual XML documents without considering the order of XML
nodes.

Issue: SPR-15156
2017-02-13 21:07:35 +01:00
Rossen Stoyanchev
6f68af6860 Uncomment test following fix in reactor-netty 2017-02-13 15:02:42 -05:00
Arjen Poutsma
febed19bf4 Use PathPatternParser in function.server
Use new PathPatternParser instead of PathMatcher in
web.reactive.function.server.
2017-02-13 16:44:03 +01:00
Arjen Poutsma
a31429be2b Add json, html, and xml RequestPredicates
Added RequestPredicate for JSON, HTML, and XML requests. All three tests
for their respective mime type in the Accept header, as well as checking
for a file extension.
2017-02-13 15:37:50 +01:00
Rossen Stoyanchev
896e4db411 ExchangeActions update
Put assertBodyXyz options behind a common assertBody() entry point
currently including "isEmpty" and "asMap" but in the future others
related to JSON content or XPath for example.

Now that ExchangeActions provides method to access the ExchangeInfo
it has been removed from constructors of assertion classes that
already have ExchangeActions.
2017-02-13 09:29:17 -05:00
Arjen Poutsma
dff9b3b85c Expose BodyInserter in EntityResponse 2017-02-13 15:09:43 +01:00
Juergen Hoeller
44ec6e0037 Polishing 2017-02-13 15:07:07 +01:00
Juergen Hoeller
199aa776c9 Support for Servlet 4.0 (PushBuilder argument, MockServletContext)
Issue: SPR-12674
2017-02-13 15:06:59 +01:00
Juergen Hoeller
d44325ec91 Defensively ignore multipart parsing failure in case of error dispatch
Issue: SPR-15231
2017-02-13 15:06:52 +01:00
Brian Clozel
2ac08afab5 Threadsafe use of pattern parser in ParsingPathMatcher
This commit ensures that the `PathPatternParser` and the associated
cache map are used in a threadsafe fashion, since the PathMatcher
instance can be used for concurrent requests.

Issue: SPR-15246
2017-02-13 14:34:49 +01:00
Sebastien Deleuze
ef550c43d6 Flush JSON stream after each element
Issue: SPR-15104
2017-02-13 14:20:19 +01:00
Arjen Poutsma
45770d73ed Remove parameterisation from ClientRequest
This commit removes the parameterisation from ClientRequest, similarly
to ServerResponse. Dropping the parameterisation facilitates a
ClientRequest.from method that also copies the body of the target
request.

SPR-15234 Work in Progress
2017-02-13 13:54:23 +01:00
Rossen Stoyanchev
d513fe87f2 Refactor ExchangeActions 2017-02-11 16:25:22 -05:00
Rossen Stoyanchev
92f09c650f Unit test for reactive test support 2017-02-11 16:25:15 -05:00
Rossen Stoyanchev
4b4201efa1 WebFlux test support for server endpoints
Issue: SPR-14590
2017-02-10 17:53:12 -05:00
Brian Clozel
1901cc65fd Use ParsingPathMatcher by default in WebFlux
Issue:
2017-02-10 18:30:28 +01:00
Brian Clozel
fa4202f1bd Revert Path Pattern changes in WebFlux
Issue: SPR-14544
2017-02-10 18:30:01 +01:00
Juergen Hoeller
5b98a54c9b Latest dependency updates (RxJava 1.2.6 & 2.0.5, RxNetty 0.5.2 GA, Tyrus 1.13.1, Undertow 1.4.10) 2017-02-10 11:11:05 +01:00
Juergen Hoeller
e9019cd7d1 Polishing 2017-02-10 10:56:40 +01:00
Juergen Hoeller
e1bb697cf9 Correct explanation of example patterns
Issue: SPR-15240
2017-02-10 10:56:17 +01:00
Juergen Hoeller
c0f4d78ef9 Use Map.getOrDefault in getSqlType implementation
Issue: SPR-15238
2017-02-10 10:54:54 +01:00
Juergen Hoeller
81aca78579 Delegate to common ClassUtils.getQualifiedName
Issue: SPR-15237
2017-02-10 10:53:08 +01:00
Juergen Hoeller
ed85337901 MockHttpServletRequest exposes "HTTP/1.1" as default protocol
Issue: SPR-15232
2017-02-10 10:47:36 +01:00
Juergen Hoeller
65d8d698cd Test for ObjectFactory injection at constructor level
Issue: SPR-15222
2017-02-10 10:42:48 +01:00
Juergen Hoeller
448ea4cdfe Consistent logging in ignoreResourceNotFound scenarios
Issue: SPR-15218
2017-02-10 10:41:10 +01:00
Juergen Hoeller
b630c9bea7 Clear synchronization before triggering afterCompletion callbacks
Issue: SPR-15194
Issue: SPR-11590
2017-02-10 10:39:33 +01:00
Juergen Hoeller
5015613934 Enforce delegation through single overridable registerBean method
Issue: SPR-14832
2017-02-10 10:38:01 +01:00
Juergen Hoeller
caf11a49ff Drop unused LobCreator synchronization utilities
Issue: SPR-13827
2017-02-10 10:36:52 +01:00
Brian Clozel
5488906d0c Polish
Issue: SPR-15206
2017-02-09 22:36:28 +01:00
Greg Turnquist
e4be7131ca Implement reactive HiddenHttpMethodFilter
Provides the ability to embed an HTTP verb inside a hidden form field
(like Thymeleaf's th:method operator).

Issue: SPR-15206
2017-02-09 22:35:57 +01:00
Brian Clozel
8d43f45515 Reduce API Surface in PathPatternRegistry
This commit reduces the exposition of `PathPattern` instances throughout
the `HandlerMapping` API and removes some methods from its public API.

Issue: SPR-14544
2017-02-09 22:09:46 +01:00
Rob Winch
4999898617 Update to Gradle 3.4-rc-2
We need to explicitly apply Dependency Management to the root
project since it depends on modules that use dependency management.
We need to ensure dependency management is applied after propdeps-maven
to avoid an ordering issue [1]

An update to propdeps was necessary to be compatable with Gradle
3.4+

[1] https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/149

Issue: SPR-15207
2017-02-09 13:26:33 -06:00
Arjen Poutsma
6dd0e6bfac Reverse "Correct generic type in BodyExtractor for form data"
This commit reverses 9efa976d31, and adds
code comments to highlight why some Body[Inserter|Extractor] instances
returned from Body[Inserters|Extractors] use
ServerHttp[Request|Response] instead of using
Reactive[Input|Output]Message.
2017-02-09 17:23:20 +01:00
Arjen Poutsma
11efbaead9 Ignore JsonStreamingIntegrationTests
Ignoring JsonStreamingIntegrationTests for now, @sdeleuze is aware of the need to fix.
2017-02-09 16:43:12 +01:00
Stephane Nicoll
12de9643a6 Merge pull request #1322 from msysyamamoto:fix-javadoc
* pr/1322:
  Update copyright header
  Fix Javadoc in ContentResultMatchers
2017-02-09 16:06:12 +01:00
Stephane Nicoll
75b18d7b7b Update copyright header 2017-02-09 16:05:57 +01:00
Masayasu Yamamoto
6aa300d733 Fix Javadoc in ContentResultMatchers
Closes gh-1322
2017-02-09 16:04:46 +01:00
Brian Clozel
09d18f2ef5 Refactor HandlerMapping path match configuration
Since the introduction of `PathPatternRegistry`, the various path match
configuration flags are no longer needed in several places and that
configuration can live in the registry itself.

Issue: SPR-14544
2017-02-09 15:58:16 +01:00
Arjen Poutsma
da4af6157e Added ClientResponse.cookies()
Added cookies() method on ClientResponse, that exposes the response
cookies.

Issue: SPR-15236
2017-02-09 15:04:07 +01:00
Arjen Poutsma
2a512d7b9f Introduce EntityResponse
This commit introduces the EntityResponse, an entity-specific subtype of
ServerResponse that exposes the entity itself.
2017-02-09 13:46:00 +01:00
Brian Clozel
47ac3379ea Do not use ParsingPathMatcher by default in Spring MVC 2017-02-09 11:21:33 +01:00
Brian Clozel
18c04815a7 Add PathPatternRegistry
This commit adds the new `PathPatternRegistry`, which  holds a
sorted set of `PathPattern`s and allows for searching/adding patterns

This registry is being used in `HandlerMapping` implementations and
separates path pattern parsing/matching logic from the rest. Directly
using `PathPattern` instances should improve the performance of those
`HandlerMapping` implementations, since the parsing and generation of
pattern variants (trailing slash, suffix patterns, etc) is done only
once.

Issue: SPR-14544
2017-02-09 11:21:33 +01:00
Brian Clozel
a4da313a0a Polish
Issue: SPR-14544
2017-02-09 11:21:32 +01:00
Andy Clement
f786feb5e1 Ensure correct recognition for start of match-the-rest path elements
Without this change the /{*foobar} and /** path elements were
not correctly enforcing that the first character they encounter
must be a separator. This problem was introduced when adjusting
the generated path element chains for these constructs. Originally
the generated chain included a SeparatorPathElement but in order for
these to match 'nothing' (i.e. /foo matches /foo/{*foobar}) the separator
path element was removed, so the separator enforcement needed moving
into the CaptureTheRestPathElement and WildcardTheRestPathElement.

Issue: SPR-14544
2017-02-09 11:09:38 +01:00
Andy Clement
f58ffad939 Introduce PathPatternParser for optimized path matching
This commit introduces a PathPatternParser which parses request pattern
strings into PathPattern objects which can then be used to fast
match incoming string paths. The parser and matching supports the syntax
as described in SPR-14544. The code is optimized around the common usages
of request patterns and is designed to create very little transient
garbage when matching.

Issue: SPR-14544
2017-02-09 11:09:38 +01:00
Brian Clozel
6f029392c7 Move response status processing in InvocableHandlerMethod
Prior to this commit, WebFlux would look at the handler method
annotations (`@ResponseStatus`) for each handler execution, even calling
the expensive `synthesizeAnnotation`.

This commit moves this logic to the InvocableHandlerMethod so that this
executed once at instantiation time and for all result handlers.

Issue: SPR-15227
2017-02-09 10:30:02 +01:00
Juergen Hoeller
ab50f7b0d5 Merge pull request #1320 from dreis2211/SPR-15237
Use Class.getTypeName() where appropriate
2017-02-09 00:25:01 +01:00
Violeta Georgieva
706c72e1c7 Simplify the calculation of UndertowServerHttpRequest.uri 2017-02-08 16:55:58 -05:00