Commit Graph

13811 Commits

Author SHA1 Message Date
Juergen Hoeller 84d3808b3b Upgrade to Mockito 2.2
Issue: SPR-14880
2016-11-03 22:53:35 +01:00
Juergen Hoeller 8ae0bd6ea9 ApplicationListenerDetector ignores non-managed bean instances
Issue: SPR-14879
2016-11-03 22:52:43 +01:00
Brian Clozel 95abd18fea Fix Exception Handling result handler resolution
Prior to this commit, the wrong `HandlerResultHandler` could be
resolved when handling exceptions; this could happen only if the
original handler and exception handler had different signatures:

```
Publisher<String> originalHandler() { ... }

@ExceptionHandler(MyCustomException.class)
ResponseEntity<Mono<String>> handleException() { ... }
```

In that case, the `ResponseBodyResultHandler` would be used when
handling exceptions instead of the `ResponseEntityResultHandler`.

This commit ensures that the `HandlerResult` returned by the exception
handler is used to resolve the `HandlerResultHandler`. The latter will
process the result and use it to write to the HTTP response.

Issue: SPR-14876
2016-11-03 17:13:54 +01:00
Juergen Hoeller a90e4b230f Polishing
Issue: SPR-14867
2016-11-03 14:41:41 +01:00
Juergen Hoeller 8053fefea8 Consistent support for early placeholder resolution in properties locations
Issue: SPR-10502
2016-11-03 14:33:48 +01:00
Juergen Hoeller 03468fd9ed ReloadableResourceBundleMessageSource sets file timestamp on merged holder
Issue: SPR-14583
2016-11-03 14:27:44 +01:00
Brian Clozel 0006957274 Support ResponseStatus on reactive controllers
This commit adds support for `@ResponseStatus` annotations on reactive
controller methods. `HandlerResultHandler`s implementations now
set the status on the `ServerWebExchange`, if and only if the
invocation of the controller method succeeded.

Issue: SPR-14830
2016-11-03 12:00:30 +01:00
Rossen Stoyanchev 87e01513fd Check SockJS session type
This commits adds a validation check whether the SockJS session type
matches the transport type and rejects requests for which they
don't match.

Issue: SPR-14867
2016-11-03 09:35:30 +02:00
Sebastien Deleuze 8705df502d Rename Verifier to StepVerifier
Issue: SPR-14800
2016-11-02 19:01:40 +01:00
Juergen Hoeller bb0d4c8ce0 Upgrade to Selenium 3.0.1, HtmlUnit 2.23 and JSONAssert 1.4 2016-11-02 14:55:12 +01:00
Juergen Hoeller be853d466b AnnotatedElementAdapter explicitly declares isAnnotationPresent method
Issue: SPR-14872
(cherry picked from commit 17863df)
2016-11-02 14:54:43 +01:00
Juergen Hoeller dc9a8ee933 Upgrade to Caffeine 2.3.4 and XNIO 3.4.1 2016-11-02 13:48:06 +01:00
Juergen Hoeller 3e419cde7d Polishing
Issue: SPR-14863
2016-11-02 12:44:12 +01:00
Juergen Hoeller 82fa4ef274 Polishing
Issue: SPR-14863
2016-11-02 11:45:59 +01:00
Rossen Stoyanchev 388e173ba3 Fix NPE in custom @InitBinder resolver initialization
Issue: SPR-14869
2016-11-02 10:00:19 +02:00
Rossen Stoyanchev 6c098b3301 Polish 2016-11-02 09:53:27 +02:00
Sebastien Deleuze b4b7c278df Update tests according to latest reactor-test changes
- ScriptedSubscriber has been renamed to Verifier
 - The Publisher is passed to create() instead of verify()
 - No more need to specify the generic type explicitly
 - Version is now sync with reactor-core

Issue: SPR-14800
2016-11-01 22:28:50 +01:00
Andy Clement 9000acd39d Rework compilation of OpNE/OpEQ SpEL operators
For SPR-14863 we need to adjust the code generation for OpNE
to use !x.equals(y) rather than x!=y. There are also further
cases in the equalityCheck() code in Operator that were not
being handled in the compilation case (when comparators are
used for example). This latter issue also affects OpEQ.

Rather than add yet more bytecode generation, both OpNE and
OpEQ generateCode() methods have been simplified. The
generated code now delegates to equalityCheck() in Operator
which is exactly what the interpreted case does.

This ensures that the compiled code continues to behave just
like the interpreted case. It ensures changes to the interpreted
case are automatically picked up for the compiled case. It
makes the bytecode generation simpler.

The benefit of compilation of SpEL expressions is to avoid
slow reflective calls - that doesn't apply for a basic
(in)equality test so there is no need to go crazy in bytecode
gen.

Issue: SPR-14863
2016-11-01 13:42:23 -07:00
Rossen Stoyanchev 99cacaa72d Improve reactive support for access to Principal
The method to access the Principal from the ServerWebExchange is now
a Mono<Principal> (rather than Optional<Principal>).

There is also support for Principal as a controller method argument.

Issue: SPR-14680, SPR-14865
2016-11-01 18:44:14 +02:00
Rossen Stoyanchev e1a382b61f Polish 2016-11-01 18:15:11 +02:00
Juergen Hoeller b07d40cc44 Polishing
(cherry picked from commit 77e00f1)
2016-10-31 20:56:00 +01:00
Rossen Stoyanchev 33dbbce182 ApplicationContext-based HttpHandler setup
This commit adds support for detecting the target WebHandler along with
WebFilters, WebExceptionHandlers, and other spring-web reactive
strategies in an ApplicationContext.

WebReactiveConfigurationSupport has @Bean factory methods for
DispatcherHandler and ResponseStatusExceptionHandler.

WebHttpHandlerBuilder has a static factory method that initializes the
builder from an ApplicationContext. This method is also used in the
DispatcherHandler#toHttpHandler(ApplicationContext) shortcut method.

Issue: SPR-14837
2016-10-31 20:45:26 +02:00
Juergen Hoeller 45fc449550 Polishing 2016-10-31 19:24:45 +01:00
Juergen Hoeller eaf80781e8 Upgrade to H2 1.4.193 and Derby 10.13.1.1 2016-10-31 19:24:09 +01:00
Rossen Stoyanchev 3da0295c12 Support for reactive controller @InitBinder methods
Issue: SPR-14543
2016-10-31 16:11:44 +02:00
Rossen Stoyanchev 0b76b6d7e9 Sync semantics for WebExchangeDataBinder factory
The createBinder method in BindingContext now returns the binder
instance rather than a Mono with the expectation that binder
initialization (e.g. @InitBinder) does not require blocking.

Issue: SPR-14543
2016-10-31 16:11:44 +02:00
Rossen Stoyanchev b55ab1119e Sync argument resolution and HandlerMethod invocation
HandlerMethodArgumentResolver is a non-blocking contract, however only
implementations that read the request body require blocking.

This commit introduces SyncMethodArgumentResolver as an extension of
the non-blocking contract that allows synchronous implementations to
use synchronous argument resolution.

There is also a SyncInvocableHandlerMethod extension that uses only
sync argument resolvers and allows a synchronous invocation.

Issue: SPR-14543
2016-10-31 16:11:44 +02:00
Juergen Hoeller c4ee876416 Polishing 2016-10-31 12:45:41 +01:00
Juergen Hoeller 7f280a3b17 Polishing 2016-10-31 12:28:44 +01:00
Juergen Hoeller 61d7d1621b ASM-generated class names get interned for better memory allocation
Issue: SPR-14862
(cherry picked from commit d859826)
2016-10-31 12:28:29 +01:00
Juergen Hoeller 9659bc5fe7 ObjectToObjectConverter properly handles constructors on non-public classes
Issue: SPR-14304
2016-10-30 22:29:53 +01:00
Juergen Hoeller ac80ac6f8b Consistent instanceof/casting of Class references 2016-10-30 21:40:27 +01:00
Juergen Hoeller 7627c38695 Exceptions thrown from @ExceptionHandler methods logged at warn level (instead of debug)
Issue: SPR-14861
2016-10-30 21:40:20 +01:00
Sebastien Deleuze 9ccffb6de5 Upgrade to RxJava 2.0.0 2016-10-29 16:38:35 +02:00
Stephane Nicoll e3f6b61743 Polish 2016-10-29 11:15:26 +02:00
Stephane Nicoll 30291a8cd7 Allow to customize TestDispatcherServlet
This commit introduces the `DispatcherServletCustomizer` callback
interface that can be used to customize the `DispatcherServlet` that a
`MockMvc` is using.

Previously, only the `dispatchOptions` flag can be customized. This
commit allows to customize any property of `DispatcherServlet` before it
is initialized.

Issue: SPR-14277
2016-10-29 10:58:29 +02:00
Juergen Hoeller c036e4019f Upgrade to Hibernate Validator 5.3.1 (and Gson 2.8) 2016-10-28 23:53:23 +02:00
Juergen Hoeller 2f9ed5917b Polishing 2016-10-28 23:49:21 +02:00
Juergen Hoeller dc080cb1be Revised NoSuchBeanDefinitionException message and ResolvableType handling
Includes consistent quoting of qualified type names in related classes.

Issue: SPR-14831
2016-10-28 23:39:05 +02:00
Juergen Hoeller 36332441ae DefaultListableBeanFactory allows early type matching against ScopedProxyFactoryBean
Issue: SPR-14816
2016-10-28 23:37:58 +02:00
Juergen Hoeller c946924431 ApplicationListener detection for inner beans behind post-processors
Issue: SPR-14783
2016-10-28 23:35:56 +02:00
Juergen Hoeller 5ac5ec1046 No external locking for singleton advice/aspect beans
Issue: SPR-14324
2016-10-28 23:35:01 +02:00
Juergen Hoeller 72e1f7e898 Avoid deadlock between SockJS heartbeat and XHR polling
Issue: SPR-14833
2016-10-28 23:34:19 +02:00
Juergen Hoeller bf9083d60f TypeDescriptor supports merged annotation lookups (for composable formatting annotations)
Issue: SPR-14844
2016-10-28 23:33:26 +02:00
Juergen Hoeller 08972eff9b Local merged annotation lookup in SpringCacheAnnotationParser
Issue: SPR-14781
Issue: SPR-14801
2016-10-28 23:32:55 +02:00
Rossen Stoyanchev 00a35897fe ServerWebExchange provides access to form data
The ServerWebExchange now has a getFormData() method that delegates to
FormHttpMessageReader for the parsing and then caches the result so
it may be used multiples times during request processing.

Issue: SPR-14541
2016-10-28 22:58:31 +03:00
Rossen Stoyanchev 81b4dedd08 Polish form reader/writer 2016-10-28 21:29:02 +03:00
Sebastien Deleuze 46599e7d03 Add FormHttpMessageReader/Writer
Issue: SPR-14540
2016-10-28 19:08:01 +03:00
Rossen Stoyanchev c3f22b7364 Add "mutate" builder to ServerWebExchange
This commit adds a default mutate method to ServerWebExchange which
prepares an immutable wrapper and returns the provided mutated
properties.
2016-10-28 19:05:05 +03:00
Rossen Stoyanchev afcc120b97 Better handling for AsyncRequestTimeoutException
Avoid call to sendError when response is committed and log a short
error message instead.

Issue: SPR-14739
2016-10-28 17:45:30 +03:00