Commit Graph

14848 Commits

Author SHA1 Message Date
Vladimir L
7da63c57b3 tests for asynchronous processing if controller returns StreamingResponseBody 2016-07-12 17:44:10 -04:00
Brian Clozel
e906a78e0f Move server testing infrastructure to test sources 2016-07-12 17:36:30 +02:00
Sam Brannen
c341b39f71 Move "What's New" reference manual chapter to the wiki
A "What's New" page has been created in the Spring Framework wiki:

https://github.com/spring-projects/spring-framework/wiki/What's-New-in-the-Spring-Framework

This commit therefore links to the new wiki page from the appendix of
the reference manual and deletes the existing "What's New" chapter from
the reference manual.

Issue: SPR-14449
2016-07-12 17:35:49 +02:00
Sam Brannen
68b3bc0394 Use Supplier<String> support in Assert in spring-test
This commit makes use of the new Supplier<String> variants of utility
methods in org.springframework.util.Assert within the spring-test
module.

Issue: SPR-14450
2016-07-12 16:41:03 +02:00
Sam Brannen
264f5860a8 Use Supplier<String> support in Assert in spring-core
This commit makes use of the new Supplier<String> variants of utility
methods in org.springframework.util.Assert within the spring-core
module.

Issue: SPR-14450
2016-07-12 16:41:03 +02:00
Sam Brannen
17dd5dd22d Introduce Supplier<String> support in Assert util
Prior to this commit, utility methods in
org.springframework.util.Assert accepted String arguments for custom
error messages. Such Strings are evaluated (e.g., concatenated)
eagerly, and for performance reasons, it was therefore not always
possible to make use of these utility methods. Consequently, there are
several places in the code base that "inline" identical functionality
in order to lazily evaluate error message concatenation and avoid an
unnecessary performance penalty. This leads to verbose code like the
following.

if (!contextPath.startsWith("/")) {
    throw new IllegalArgumentException("contextPath '" + contextPath +
    "' must start with '/'.");
}
if (contextPath.endsWith("/")) {
    throw new IllegalArgumentException("contextPath '" + contextPath +
    "' must not end with '/'.");
}

This commit addresses this shortcoming by introducing Supplier<String>
variants of all utility methods in org.springframework.util.Assert that
allow custom error messages to be evaluated lazily via a lambda
expression that is only evaluated if the assertion fails. This results
in a simplification of the previous examples as follows.

Assert.isTrue(contextPath.startsWith("/"), () -> "contextPath '" +
    contextPath + "' must start with '/'.");
Assert.isTrue(!contextPath.endsWith("/"), () -> "contextPath '" +
    contextPath + "' must not end with '/'.");

Issue: SPR-14450
2016-07-12 16:41:03 +02:00
Sam Brannen
3d4338f555 Clean up warnings in spring-core 2016-07-12 16:41:03 +02:00
Brian Clozel
147a35f4f1 Polish AntPathMatcher.setTrimTokens javadoc
Issue: SPR-14247
2016-07-12 14:47:18 +02:00
Arjen Poutsma
d736245f28 Changed from interval() to intervalMillis() 2016-07-12 13:25:18 +02:00
Stephane Maldini
c2c7e3b596 Polish timed operators and remove useTimer() 2016-07-12 12:13:50 +01:00
Brian Clozel
3ce49819f2 Update link to Spring CLA in CONTRIBUTING doc 2016-07-12 10:20:03 +02:00
Stephane Nicoll
c425e774a3 Polish 2016-07-12 09:10:34 +02:00
Stephane Nicoll
2ee42192b3 Merge pull request #1105 from fisache:master
* pr/1105:
  Polish doc
2016-07-12 08:54:58 +02:00
fisache
55ad5a448e Polish doc
Closes gh-1105
2016-07-12 08:52:15 +02:00
Stephane Nicoll
825a5ec029 Merge pull request #1107 from nkjackzhang:patch-5
* pr/1107:
  Polish doc
2016-07-12 08:51:02 +02:00
nkjackzhang
1fb93044af Polish doc
Closes gh-1107
2016-07-12 08:50:35 +02:00
Rossen Stoyanchev
b66cc71d66 Merge RequestMappingIntegrationTests refactoring 2016-07-11 21:09:35 -04:00
Rossen Stoyanchev
aa47616be2 Split TestRestController into use-case sub-classes 2016-07-11 18:08:11 -04:00
Rossen Stoyanchev
7e07fb16d8 Split RequestMappingIntegrationTests into sub-classes 2016-07-11 18:08:11 -04:00
Rossen Stoyanchev
35f791acf8 Extract base class for RequestMappingIntegrationTests 2016-07-11 18:08:11 -04:00
Rossen Stoyanchev
6fde86903d Declare HTTP method mappings TestRestController 2016-07-11 18:07:55 -04:00
Rossen Stoyanchev
aa1397b8ba Polish method order in RequestMappingIntegrationTests 2016-07-11 18:07:46 -04:00
Sam Brannen
22345f7c25 Upgrade tests to EhCache 2.10+
Issue: SPR-13794
2016-07-11 17:17:03 +02:00
Sam Brannen
f7f37cdb1b Introduce before/after test execution callbacks in the TCF
This commit introduces 'before' and 'after' test execution callbacks in
the Spring TestContext Framework. Specifically, this set of commits
introduces the following.

- beforeTestExecution() and afterTestExecution() callbacks in the
  TestExecutionListener API

- beforeTestExecution() and afterTestExecution() callbacks in
  TestContextManager

- RunBeforeTestExecutionCallbacks and RunAfterTestExecutionCallbacks
  JUnit 4 statements that are used by the SpringJUnit4ClassRunner

- Documentation in the class-level Javadoc for SpringMethodRule stating
  that before/after test execution callbacks cannot be supported with
  JUnit 4 Rules

- Support for JUnit Jupiter's BeforeTestExecutionCallback and
  AfterTestExecutionCallback extension APIs in the SpringExtension for
  JUnit 5

- Support for before/after test execution callbacks in
  AbstractTestNGSpringContextTests for TestNG

Issue: SPR-4365
2016-07-11 15:45:35 +02:00
Sam Brannen
80018c67e7 Introduce before/after test execution support in the SpringExtension
Issue: SPR-4365
2016-07-11 15:44:51 +02:00
Sam Brannen
da89332840 Introduce before/after test execution support in SpringJUnit4ClassRunner
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen
3da5fbe995 Introduce before/after test execution support in AbstractTestNGSpringContextTests
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen
087efa668c Introduce before/after test execution callbacks in TestContextManager
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Sam Brannen
5302566cbb Introduce before/after test execution callbacks in TestExecutionListener
Issue: SPR-4365
2016-07-11 15:13:40 +02:00
Stephane Nicoll
11ed26584d Polish 2016-07-11 10:50:44 +02:00
Stephane Nicoll
15c3cdd48d Fix NoOpCache handling of get(key,callable)
This commit fixes the method that takes a Callable to actually always
invoke it rather than returning null.

Issue: SPR-14445
2016-07-11 10:34:27 +02:00
Sam Brannen
629b95bd5c Ensure TestContextManager always tracks after-class exception
This commit fixes a minor bug introduced in 0adc4921ed.

Issue: SPR-14447
2016-07-10 16:04:00 +02:00
Rossen Stoyanchev
407715b89e Helpers for get/post in RequestMappingIntegrationTests
This commit replaces the current helper methods in
RequestMappingIntegrationTests with generic helper methods to perform
HTTP GET and POST requests.

This results in more transparent code that shows the exact HTTP
inputs and outputs and is also more flexible to change for
variations in testing.
2016-07-08 12:17:36 -04:00
Sam Brannen
966d951329 Remove deprecated @TransactionConfiguration & TxCfgAttributes
Issue: SPR-14430
2016-07-08 18:16:44 +02:00
Sam Brannen
57c43f4273 Delete unused import 2016-07-08 17:40:42 +02:00
Sam Brannen
d6d4251550 Utilize default methods in TestExecutionListener
Issue: SPR-14432
2016-07-08 17:38:41 +02:00
Sam Brannen
a0cad5c48f Use streams and lambdas in spring-test where feasible
Issue: SPR-13188
2016-07-08 17:38:40 +02:00
Sam Brannen
8fff1c2ac0 Polishing 2016-07-08 17:18:14 +02:00
Sam Brannen
80216c243d Annotate ContextCustomizer[Factory] with @FunctionalInterface
Issue: SPR-14432
2016-07-08 17:17:25 +02:00
Juergen Hoeller
e8b5374d87 Require EhCache 2.10+
Issue: SPR-13794
2016-07-08 16:28:24 +02:00
Rossen Stoyanchev
d84b989025 Update notes on deps for broker relay 2016-07-08 09:20:49 -04:00
Juergen Hoeller
c43e7497c1 Fixed typo: "occured"->"occurred" 2016-07-08 15:12:16 +02:00
Juergen Hoeller
23c2b6ad41 Added PathEditor for NIO file system resolution
Issue: SPR-14436
2016-07-08 14:58:38 +02:00
Brian Clozel
99697118d8 Add RxJava1 support for request building/extracting
This commit adds the required infrastructure to build HTTP requests as
well as extracting relevant information from HTTP responses using the
RxJava 1.x API, where Observable and Single don't extend Publisher.
2016-07-08 14:22:48 +02:00
Brian Clozel
4892436efe Refactor HTTP client contracts
This commit refactors the `ClientHttpRequestFactory` into an
`ClientHttpConnector` abstraction, in order to reflect that
`ClientHttpRequest`s only "exist" once the client is connected
to the origin server.

This is why the HTTP client is now callback-based, containing all
interactions with the request within a
`Function<ClientHttpRequest,Mono<Void>>` that signals when it's done
writing to the request.

The `ClientHttpRequest` contract also adopts `setComplete()`
and promotes that method to the `ReactiveHttpOutputMessage` contract.

This commit also adapts all other APIs to that change and fixes a few
issues, including:

* use `HttpMessageConverter`s instead of `Encoders`/`Decoders`
* better handle type information about request content publishers
* support client cookies in HTTP requests
* temporarily remove the RxNetty client support
2016-07-08 14:20:07 +02:00
Sam Brannen
40b2d26bd4 Avoid reflection for @Repeatable look-ups
Issue: SPR-13188
2016-07-08 13:21:31 +02:00
Juergen Hoeller
61db8e9f1e DigestUtils processes InputStream with buffered read instead of full copy
Issue: SPR-14427
2016-07-08 12:20:49 +02:00
Brian Clozel
b5bce1f017 Update after reactor.core.converter.Converters changes
Reactor's `DependencyUtils` has been renamed to `Converters` and
all the `from` converter methods have been disambiguated to
`fromPublisher`, `toPublisher`.
2016-07-08 12:00:06 +02:00
Stephane Nicoll
2bf9bc312e Remove Guava cache support
This commit removes `GuavaCache` and support classes. Caffeine supersedes
the caching support in the Google Guava library with an actively maintained
Java 8+ version in standalone form.

As it is the only Guava feature Spring framework integrates with, this
commit removes effectively any reference to Guava.

Issue: SPR-13797
2016-07-08 10:57:05 +02:00
Arjen Poutsma
799bb64275 Merge pull request #135 from violetagg/ondataavailable-concurrency
Refactor AbstractRequestBodyPublisher states
2016-07-08 09:45:05 +02:00