Commit Graph

13917 Commits

Author SHA1 Message Date
Juergen Hoeller bb9e561934 Upgrade to Hibernate Validator 5.4 CR1
(plus Jackson 2.8.6, Netty 4.1.7, JRuby 9.1.7)

Issue: SPR-14998
2017-01-16 08:58:31 +01:00
Sam Brannen c9835f0f6c Clean up warnings spring-test 2017-01-16 03:21:43 +01:00
Vedran Pavić 83beb9d57d Set MockSessionCookieConfig#maxAge default to -1
Issue: SPR-15142
2017-01-16 03:17:54 +01:00
Sebastien Deleuze 02409f74b9 Polish Kotlin routing DSL
This commit changes RouterFunctionDsl {...} (request)
to route(request) {...}, remove uneeded methods, add
missing ones and add tests useful to validate the
DSL syntax and behavior.

Issue: SPR-15065
2017-01-13 23:32:30 +01:00
Rossen Stoyanchev ba3cc535f1 Refactor reactive mock request and response support
MockServerHttpRequest and MockServerHttpResponse now extend the same
abstract base classes that server-specific implementations do and
therefore approximate their behavior more closely.

As an immediate consequence MockServerHttpRequest is read-only after
it is created. Instead it now exposes static builder methods similar
to those found in RequestEntity. This enforces more strictness as well
as recycling of requests in tests and provides nicer builder methods.

To simplify tests DefaultServerWebExchange now offers a constructor
with just a request and response, and automatically creating a
DefaultWebSessionManager.

The spring-test module now also contains client-side reactive mock
request and response implementations. The mock client request extends
the same AbstractClientHttpRequest as client-specific implementations
do. There is no abstract base class for client responses.

Issue: SPR-14590
2017-01-13 15:23:06 -05:00
Juergen Hoeller 4d6c1d0d3f Upgrade to Gradle 3.3
Issue: SPR-15138
2017-01-13 12:38:50 +01:00
Juergen Hoeller 1cb381e9a7 Consistent deprecation markers on JDK 9 2017-01-13 10:53:20 +01:00
Juergen Hoeller 08c2fd4e7c Upgrade to Groovy 2.4.8 and Mockito 2.6.1 2017-01-13 10:23:38 +01:00
Juergen Hoeller 7c05b427a7 MimeTypeUtils constants cleanup: removed web media types
Issue: SPR-15137
2017-01-12 23:30:57 +01:00
Juergen Hoeller 743ce2cda6 Polishing 2017-01-12 23:30:38 +01:00
Juergen Hoeller e19dff179e Polishing 2017-01-12 21:18:01 +01:00
Juergen Hoeller 02d727fd7c MockHttpServletRequestBuilder supports multiple locales
Includes revised content type handling.

Issue: SPR-15116
2017-01-12 21:17:54 +01:00
Juergen Hoeller d0e93284f3 SpringValidatorAdapter properly handles HV-5-style list constraint violations
Issue: SPR-15082
2017-01-12 21:16:56 +01:00
Juergen Hoeller b06423a5f8 AbstractMessageSource does not attempt to format code-as-default-message
Issue: SPR-15123
2017-01-12 21:16:48 +01:00
Juergen Hoeller 8084da59a7 Map resolution for multiple beans applies to plain Map interface declaration only
Issue: SPR-15117
2017-01-12 21:15:41 +01:00
Juergen Hoeller 9e6aa0ff59 BeanDefinitionBuilder supports factory method on factory bean
Issue: SPR-15098
2017-01-12 21:15:22 +01:00
Juergen Hoeller de4349792b GenericTableMetaDataProvider falls back to single schema as default
Issue: SPR-15090
2017-01-12 21:15:08 +01:00
Juergen Hoeller 50e5a65b2d LinkedCaseInsensitiveMap provides case-insensitive keySet again
Issue: SPR-15026
2017-01-12 21:14:07 +01:00
Juergen Hoeller 60882ceb4e Merge pull request #1286 from trisberg/SPR-15107
SPR-15107 Updating MySQLMaxValueIncrementer to not rely on MYISAM
2017-01-12 20:25:04 +01:00
Juergen Hoeller 0403fe340d Merge pull request #1287 from markhobson/SPR-15109
Introduce mime/media types for application/rss+xml
2017-01-12 20:24:27 +01:00
Juergen Hoeller 31f7860a40 Merge pull request #1285 from dreis2211/SPR-15094
Improve performance of StringUtils.capitalize()
2017-01-12 20:22:26 +01:00
Arjen Poutsma d724644588 Expose WebSession on ServerRequest
This commit exposes the WebSession on ServerRequest.
2017-01-12 11:37:48 +01:00
Thomas Risberg 5c7aee7d38 Updating MySQLMaxValueIncrementer to not rely on MYISAM
We should no longer rely on MYISAM for the sequence table since this
engine might not always be available. After this change the storage
engine used by the sequence table can be MYISAM or INNODB since the
sequences are allocated using a new connection without being
affected by any other transactions that might be in progress.

To allow users to fall back on the original functionality of using
MYISAM tables for the incrementer, we add a `useNewConnection` flag to
indicate whether or not to use a new connection for the incrementer.
This flag defaults to true.

Issue: SPR-15107
2017-01-11 17:24:41 -05:00
Sebastien Deleuze b7471e7fca Add a Kotlin Web functional DSL
This commit introduces a router DSL for RouterFunctions
and RouterFunction in order to be able to write idiomatic
Kotlin code as below:

fun route(request: ServerRequest) = RouterFunctionDsl {
    accept(TEXT_HTML).apply {
            (GET("/user/") or GET("/users/")) { findAllView() }
            GET("/user/{login}") { findViewById() }
    }
    accept(APPLICATION_JSON).apply {
            (GET("/api/user/") or GET("/api/users/")) { findAll() }
            POST("/api/user/") { create() }
            POST("/api/user/{login}") { findOne() }
    }
 } (request)

Issue: SPR-15065
2017-01-11 14:54:31 +01:00
Sebastien Deleuze b04b41b93b Add bodyToMono/Flux<Foo>() Kotlin extensions
Issue: SPR-15128
2017-01-11 08:59:10 +01:00
Sebastien Deleuze 0a988fd2b1 Remove object wrappers in Kotlin extensions
This commit also improve significantly Kotlin extensions
documentation.

Issue: SPR-15127
2017-01-11 08:52:01 +01:00
Sebastien Deleuze 4f1fe74912 Polish ListableBeanFactoryExtension 2017-01-11 07:57:02 +01:00
Sebastien Deleuze 8f14e29067 Support AnnotationConfigApplicationContext{} in Kotlin
Issue: SPR-15126
2017-01-10 22:47:33 +01:00
Sebastien Deleuze f8461d856a Support Gradle-style Kotlin bean API
val context = GenericApplicationContext {
    registerBean<Foo>()
    registerBean { Bar(it.getBean<Foo>()) }
}

Issue: SPR-15126
2017-01-10 21:43:27 +01:00
Mario Arias 1af905ca0a Add Model and ModelMap Kotlin extensions
Issue: SPR-15119
2017-01-10 14:22:54 +01:00
Sebastien Deleuze 6ee5e2a817 Polishing
Issue: SPR-15118
2017-01-10 10:54:24 +01:00
Sebastien Deleuze c5cfd8c8fc Make the Kotlin bean registration API even more idiomatic
Put the lambda parameter at the end and use a function
instead of a supplier to be able to register beans like this:

val context = GenericApplicationContext()
context.registerBean(Foo::class)
context.registerBean{ Bar(it.getBean(Foo::class)) }

Issue: SPR-15118
2017-01-10 10:38:24 +01:00
Sebastien Deleuze 715274e327 Avoid the need to specify Supplier in Kotlin bean registration API
Based on an idea from Mario Arias, we can avoid requiring specifying
explicitly Supplier lambda type in Kotlin API by declaring the supplier
parameter as "crossinline supplier: () -> T" instead of
"supplier: Supplier<T>".

Issue: SPR-15118
2017-01-09 20:22:30 +01:00
Sebastien Deleuze b503e4679c Add reactive ScriptTemplateView
For now if sharedEngine is set to false, a new
ScriptEngine instance is created for each request.

Issue: SPR-15063
2017-01-09 19:47:07 +01:00
Juergen Hoeller 74fa088c7e Latest dependency updates (HtmlUnit 2.24, Joda-Time 2.9.7, RxJava 1.2.5 & 2.0.4) 2017-01-09 19:19:27 +01:00
Sebastien Deleuze aa43472f2e Fix error handling in Jackson2JsonDecoder
Issue: SPR-15112
2017-01-09 14:51:16 +01:00
Mark Hobson 2ce2f7d9a5 Introduce mime/media types for application/rss+xml
Issue: SPR-15109
2017-01-07 17:13:32 +00:00
Sam Brannen e4a599f961 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.
2017-01-07 02:24:46 +01:00
Sam Brannen 08cc92176a Enable compilation on Eclipse 4.6 2017-01-07 02:15:02 +01:00
Sam Brannen 9ed66bf2eb Clean up warnings across code base 2017-01-07 01:54:38 +01:00
Sam Brannen 055da43e30 Clean up warnings in spring-test 2017-01-07 00:57:17 +01:00
Brian Clozel 87f498195c Fix RequestUpgradeStrategy impl. class loading
Issue: SPR-15106
2017-01-06 23:19:51 +01:00
Brian Clozel afd93a0b52 Disable streaming when reading to Resources in RestTemplate
Prior to this commit, the `ResourceHttpMessageConverter` would support
converting from an `HttpInputMessage` to a `InputStreamResource`. This
is valid when reading resources on the server side, but it's not
compatible with the way `RestTemplate` works.

The API exposed by `RestOperations` imply that the HTTP server response
should be fully consumed and properly closed by the time the `exchange`
method returns. In other words, this HTTP client does not support
streaming the HTTP response.

This commit allows the `ResourceHttpMessageConverter` to be configured
to disable read streaming when used in `RestTemplate`.

Issue: SPR-14882
2017-01-05 14:48:35 +01:00
Stephane Nicoll 848a2b2ef8 Merge pull request #1284 from garyrussell:SPR-15091
* pr/1284:
  Implement MessagingException.toString()
2017-01-05 10:25:31 +01:00
Gary Russell 80bc8fc596 Implement MessagingException.toString()
Issue: SPR-15091
Closes gh-1284
2017-01-05 10:25:04 +01:00
Christoph Dreis 83929b2b98 Improve performance of StringUtils.capitalize()
Issue: SPR-15094
2017-01-04 19:23:08 +01:00
Stephane Nicoll 9e0a08753d Merge pull request #1281 from marschall:SPR-15076
* pr/1281:
  Remove use of Boolean constructors
2017-01-04 09:31:49 +01:00
Philippe Marschall 19e77cd140 Remove use of Boolean constructors
Codacy warns us that there are several references to Boolean
constructors in the tests. Direct usage of the Boolean constructor is
discouraged and even deprecated in Java 9 [1]. Boolean constructor use
can easily be replaced with the constant instances.

This commit contains the following changes:

 - replace references to Boolean constructors with boolean constants in
   JSP tag tests
 - update the copyright year where necessary
 - BooleanComparatorTests is intentionally left unchanged as it should
   also work with the non-constant instances correctly

 [1] http://download.java.net/java/jdk9/docs/api/java/lang/Boolean.html#Boolean-boolean-

Issue: SPR-15076
2017-01-04 09:31:14 +01:00
Stephane Nicoll 4cd9710a0d Merge pull request #1282 from marschall:SPR-15077
* pr/1282:
  Avoid use of double constructor of BigDecimal
2017-01-04 09:30:55 +01:00
Philippe Marschall 3f97ab183e Avoid use of double constructor of BigDecimal
Codacy warns about an Error Prone [1] use of the double constructor of
BigDecimal in tests. The reason given is that it is a source of
precision loss if the number does not have an exact double
representation. The recommendation is to use the String constructor of
BigDecimal instead as it does not require using a lossy argument.

This commit contains the following changes:

 - replace usage of the double constructor of BigDecimal with the
   String constructor of BigDecimal in JdbcTemplateQueryTests
 - update the copyright year

 [1] http://errorprone.info/bugpattern/BigDecimalLiteralDouble

Issue: SPR-15077
2017-01-04 09:29:48 +01:00