Commit Graph

557 Commits

Author SHA1 Message Date
Sam Brannen e086a637d5 Introduce BEFORE METHOD/CLASS modes in @DirtiesContext
Prior to this commit, @DirtiesContext could only be used to close a
test ApplicationContext after an entire test class or after a test
method; however, there are some use cases for which it would be
beneficial to close a test ApplicationContext before a given test class
or test method -- for example, if some rogue (i.e., yet to be
determined) test within a large test suite has corrupted the original
configuration for the ApplicationContext.

This commit provides a solution to such testing challenges by
introducing the following modes for @DirtiesContext.

 - MethodMode.BEFORE_METHOD: configured via the new methodMode attribute

 - ClassMode.BEFORE_CLASS and ClassMode.BEFORE_EACH_TEST_METHOD: both
   configured via the existing classMode attribute

Issue: SPR-12429
2015-03-22 21:33:20 +01:00
Brian Westrich 27b57ec332 fix typo 2015-03-14 07:43:02 -05:00
Stephane Nicoll c7fcf7cd4c `@Configuration` doc improvements
Various documentation improvements related to `@Configuration` and
`Bean`. Better describe how method parameter can be used to declare
dependencies of a particular bean. Also add an explicit mentions related
to "hard-wiring" of dependencies in configuration classes.

Issue: SPR-12773
2015-03-09 16:26:41 +01:00
Stephane Nicoll bd6d974561 Fix Admonition syntax
The upgrade to a more recent asciidoc format led to a bunch of of
broken Admonition as the text block now requires four equal signs while
previous versions tolerated only 3.

Issue: SPR-12791
2015-03-07 07:30:52 +01:00
Brian Clozel 74072237ee Break down Core and Web chapters in reference doc
Core and Web chapters are important chapters in the Spring Framework
reference documentation, and splitting them in multiple files will
help to evolve the documentation while not creating too many files.

Issue: SPR-12309
2015-03-06 16:59:25 +01:00
Brian Clozel 0baf228db5 Modularize asciidoc documentation
The reference documentation is now organized in asciidoc bookparts.
Bookparts sections can be also put in separate files, when their
size and theme are important enough to justify that.

Documentation Layout:
```
index
  |-- overview
  |
  |-- whats-new
  |
  |-- core
  |   |-- core-beans
  |   |-- core-aop
  |-- testing
  |
  |-- data-access
  |
  |-- web
  |   |-- web-mvc
  |   |-- web-view
  |-- integration
  |
  |-- appendix
      |-- appx-spring-tld
      |-- appx-spring-form-tld
```

Supersedes and closes #641

Issue: SPR-12309
2015-03-06 10:54:13 +01:00
Brian Clozel 503956d7c5 Update Asciidoctor Gradle plugin
Upgrade to asciidoctor-gradle-plugin version 1.5.2.
Various syntax fixes in the index.adoc reference documentation.
2015-03-06 10:54:13 +01:00
Stephane Nicoll babbf6e871 Harmonize resources location
Issue: SPR-12766
2015-02-28 10:32:40 +01:00
Sam Brannen 9d1e7fde3a Update Eclipse JDT settings for Java 8
- classes now compiled with `-parameters`
- formatting for lambda expressions
- formatting for type annotations
2015-02-27 21:41:52 +01:00
Stephane Nicoll facd2401cd Document lifecycle issue with JNDI-based beans
When a bean is retrieved via JNDI using Java config, we apply the same
inferred more for destruction callbacks as for any other bean. If an
object from the JNDI tree has a `close` or `shutdown` method, the
context calls it when it shutdowns.

Unfortunately, we have no way to know that the bean was retrieved via
JNDI and that its lifecycle is managed outside the application.

The documentation has been updated to reflect that problem explicitly.

Issue: SPR-12551
2015-02-20 14:54:33 +01:00
Stephane Nicoll aabf73dea4 Add Commons Pool 2 support
Deprecated CommonsPoolTargetSource (supporting commons pool 1.5+) in
favor of CommonsPool2TargetSource with a similar contract.

Commons Pool 2.x uses object equality while Commons Pool 1.x used
identity equality. This clearly means that Commons Pool 2 behaves
differently if several instances having the same identity according to
their `Object#equals(Object)` method are managed in the same pool. To
provide a smooth upgrade, a backward-compatible pool is created by
default; use `setUseObjectEquality(boolean)` if you need the standard
Commons Pool 2.x behavior.

Issue: SPR-12532
2015-02-19 13:07:04 +01:00
Juergen Hoeller f20a62408b Correct reference to executeAndReturnKey method
Issue: SPR-12639
2015-02-18 22:28:36 +01:00
Sam Brannen c7a456c0bf Polish reference manual regarding WebSocket
- fixed typos
 - improved grammar and punctuation
 - fixed class names
2015-02-18 20:30:45 +01:00
Sebastien Deleuze 6062e15572 Change SockJS and Websocket default allowedOrigins to same origin
This commit adds support for a same origin check that compares
Origin header to Host header. It also changes the default setting
from all origins allowed to only same origin allowed.

Issues: SPR-12697, SPR-12685
2015-02-18 09:30:15 +01:00
Stephane Nicoll fa8d202a45 AspectJ support for javax.transaction.Transactional
Issue: SPR-11803
2015-02-12 14:45:47 +01:00
Stephane Nicoll 29a6d24d65 Clarify the use of @Cacheable in PostConstruct code
Update documentation to explicitly mention that the cache interceptor
must be fully initialized to provide the expected behavior and therefore
initialization code should not rely on this feature, i;e. typically in
PostConstruct callback.

Since the Transactional infrastructure has the exact same infrastructure,
update that section of the doc as well.

Issue: SPR-12700
2015-02-09 10:09:12 +01:00
Rossen Stoyanchev a32b5e61d0 Add support for Server-Sent Events
This commit adds ResponseBodyEmitter and SseEmitter (and also
ResponseEntity<ResponseBodyEmitter> and ResponseEntity<SseEmitter>) as
new return value types supported on @RequestMapping controller methods.

See Javadoc on respective types for more details.

Issue: SPR-12212
2015-01-29 17:55:09 -05:00
Sam Brannen c5c32ec206 Refer to static nested classes, not static inner classes
Various parts of the reference manual as well as the Javadoc for
AnnotationConfigContextLoaderUtils improperly refer to "static inner
classes" even though this terminology does not exist in Java. The Java
Language Specification explicitly refers to such classes as "static
nested classes." An "inner class" must be non-static by definition.
2015-01-23 21:41:12 +01:00
mgooty 9b24cc5035 Fix method documentation typo
Issue: SPR-12639
2015-01-22 19:22:57 +01:00
Sam Brannen dbbd1dacef Update Eclipse formatter settings for Java source code
- Copyright end date is now dynamic, based on the current year.

 - Added missing spaces in front of web link to ASL 2.0 license file.

 - Changed @since tag to 4.2.
2015-01-08 18:39:03 +01:00
Sam Brannen fc38d3bf06 Set source and target to JDK 1.8 for Eclipse projects 2015-01-08 18:33:33 +01:00
Stephane Nicoll 6790f55667 Fix typo 2015-01-01 11:42:00 +01:00
Sam Brannen 40449e2741 Suppress warnings in tests
This commit suppresses warnings in test classes that were polluting the
Gradle build output.
2014-12-31 02:10:30 +01:00
Juergen Hoeller 3791e7f653 TimeZone and ZoneId as supported arguments for MVC handler methods
Issue: SPR-12575
2014-12-29 16:41:31 +01:00
Juergen Hoeller 6f2de283c4 Doc: base-packages can be comma/semicolon/space/tab/linefeed-separated
Issue: SPR-12523
2014-12-29 13:39:48 +01:00
Stephane Nicoll 752bbbdd05 Fix scope inheritance documentation
Issue: SPR-12570
2014-12-29 10:54:19 +01:00
Sebastien Deleuze a770b151d9 Specify SockJS protocol and client supported versions
In order to avoid breaking changed due to the upcoming SockJS 1.0
release (see SPR-12422 for more details) and link to the right
SockJS documentation version, we now explicitly specify that we
support SockJS protocol 0.3.3 and SockJS client 0.3.x.
2014-12-26 22:38:49 +01:00
Stephane Nicoll c4049a989a Better doc reference of CachingConfigurer
Update the documentation to better reflect the fact that a @EnableCaching
configuration class must implement CachingConfigurer in order to provide
advanced customizations to the cache abstraction.
2014-12-22 11:37:44 +01:00
Sam Brannen 3125ef784c Polish documentation for inferred bean destruction mode 2014-12-18 13:41:59 +01:00
Stephane Nicoll 6ff2abcb83 Document destroy method name inference
Update the developer guide to explicitly reference the (inferred)
constant introduced in 38e90105a0.

Also emphasis the fact that the (inferred) mode is enabled by default
with Java config and how to disable it if necessary.

Issue: SPR-12534
2014-12-18 11:10:17 +01:00
Sam Brannen 866d8fea0d Polish grammar and wording in the reference manual 2014-12-10 14:47:15 +01:00
Sam Brannen b0a72b311f Polish Spring Framework Artifacts table
Issue: SPR-12517
2014-12-10 13:54:04 +01:00
Sebastien Deleuze 1f6a15e4da List Spring Framework artifacts in the reference manual
Issue: SPR-12517
2014-12-10 10:52:12 +01:00
Sebastien Deleuze 67f1967eee Polish reference manual
This commit put more emphasis on Spring Boot in the
"Getting Started" section, and update some outdated excerpts.
2014-12-10 10:52:12 +01:00
Sebastien Deleuze 84ef269d54 Remove outdated reference to Spring Modules 2014-12-09 15:29:24 +01:00
Rossen Stoyanchev 03f5176df1 List Tomcat and Jetty Web first. 2014-12-05 12:19:06 -05:00
Sebastien Deleuze ea7f787ad8 Update supported WebSocket runtimes in the reference documentation 2014-12-05 17:13:33 +01:00
Stephane Nicoll 2602bcbb7c Fix typo 2014-11-24 15:57:18 +01:00
Stephane Nicoll 0d00b674f4 Fix documentation formatting
Using the "quotes" substitution group by default leads to side effect
when the "*" character is used. This is especially true for AOP pointcut
or for MVC mappings.

Plain verbatim might work most of the time unless you intend to highlight
a piece of code or a comment.

Issue: SPR-12456
2014-11-24 15:55:54 +01:00
Gary Russell 4942c5c1fb Add Id to JmsListenerEndpoint Docs
Issue: SPR-12425
2014-11-13 15:51:12 +01:00
Juergen Hoeller 6a96850aa7 Polishing 2014-11-06 14:29:43 +01:00
Sam Brannen da04362a5e Log context cache statistics in the TCF
Prior to this commit, finding out how many application contexts had
been loaded within a test suite required the use of reflection and a
bit of hacking.

This commit addresses this issue by logging ContextCache statistics
whenever an application context is loaded by the Spring TestContext
Framework (TCF).

The log output can be enabled by setting the
"org.springframework.test.context.cache" logging category to DEBUG.

Issue: SPR-12409
2014-11-03 15:26:44 +01:00
Sebastien Deleuze 8b5fda5ad9 Use unversioned XSD links in code examples 2014-11-03 15:03:03 +01:00
Stephane Nicoll 6534d0035d Add documentation for the keep-alive flag
This commit updates the documentation of the task:executor element to
reference the keep-alive flag.

Issue: SPR-12407
2014-11-03 14:50:16 +01:00
Rossen Stoyanchev 62620de3f1 Update log settings for spring-websocket tests 2014-10-29 18:18:01 -04:00
Juergen Hoeller ffc4e03293 Removed outdated TimerTaskExecutor reference
Issue: SPR-12389
2014-10-29 11:21:23 +01:00
Rossen Stoyanchev a377878038 Minor doc update
Issue: SPR-12375
2014-10-27 17:27:24 -04:00
Juergen Hoeller 03bd08a6a5 Corrected note on JPA <exclude-unlisted-classes>
Issue: SPR-10767
2014-10-27 11:59:26 +01:00
Sebastien Deleuze 58f4014b17 Add an option to disable automatic addition of CORS header
Issues: SPR-12283
2014-10-26 21:20:53 +01:00
Rossen Stoyanchev d5eb669416 Add mention of java.util.Optional in @MVC
Issue: SPR-12370
2014-10-23 16:53:00 -04:00