Commit Graph

12956 Commits

Author SHA1 Message Date
Arjen Poutsma 56e50d6d68 Moved body processor to writeWithInternal()
Moved ResponseBodyProcessor creation from constructor to
writeWithInternal(), in preparation of supporting both
Publisher<DataBuffer> as well as Publisher<Publisher<DataBuffer>>.
2016-07-13 12:04:40 +02:00
Arjen Poutsma 7519d1de41 Moved log4j config to test tree
Moved log4j.properties from the main source tree to the test tree.
2016-07-13 09:56:45 +02:00
Arjen Poutsma f82f17d7f7 Moved Servlet Publisher and Processor
In preparation of supporting both Publisher<DataBuffer> and
Publisher<Publisher<DataBuffer>> as response body, moved
RequestBodyPublisher and ResponseBodyProcessor into
ServletServerHttpRequest and ServletServerHttpResponse respectively.
2016-07-13 09:53:39 +02:00
Arjen Poutsma 392a1660a4 Polishing 2016-07-13 09:53:39 +02:00
Arjen Poutsma e64907eed8 Removed ServletAsyncContextSynchronizer 2016-07-13 09:53:39 +02:00
Arjen Poutsma d2fce24eb4 Introduced ResponseBodyWriteResultPublisher
Refactored Publisher<Void> in AbstractResponseBodyProcessor into
separate ResponseBodyWriteResultPublisher.
2016-07-13 09:53:39 +02:00
Rossen Stoyanchev e91c1cd5a7 Merge pull request #1106 from darklynx/streaming_response_test 2016-07-12 17:50:40 -04:00
Rossen Stoyanchev 01a63dd84d Polish AsyncTests 2016-07-12 17:49:55 -04:00
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