Commit Graph

9320 Commits

Author SHA1 Message Date
Rossen Stoyanchev 50846e3288 Update reference 2014-09-03 13:09:24 -04:00
Rossen Stoyanchev 801658d362 Rename test class to match name of class being tested 2014-09-03 12:51:26 -04:00
Juergen Hoeller 2f93759d1b Cache.get(key, type) explicitly defines an IllegalStateException in case of a type mismatch
Issue: SPR-12145
2014-09-03 13:00:20 +02:00
Juergen Hoeller 6563405be5 ImportRegistry as a package-visible top-level interface which can easily be shared within the package
Issue: SPR-12128
2014-09-03 12:59:51 +02:00
Brian Clozel 125ae99035 Transform absolute links in ResourceTransformers
Prior to this change, ResourceTransformers that transformed resources by
updating the links to other resources, worked only if links were
relative to the resource being transformed.
For example, when the CssLinkResourceTransformer rewrote links within
a "main.css" resource, only links such as "../css/other.css" were
rewritten.

Using relative links is a recommended approach, because it's totally
independent from the application servlet path, context path, mappings...

This change allows absolute links to be rewritten by those Transformers,
provided those links are accurate and point to existing resources.

Issue: SPR-12137
2014-09-03 12:06:12 +02:00
Sebastien Deleuze 06f1f495c2 Update reference documentation for JSONP support
Issue: SPR-12113
2014-09-03 11:25:22 +02:00
Rossen Stoyanchev 7885a5975e Add section on building controller links from views 2014-09-03 00:30:25 -04:00
Rossen Stoyanchev 51a550b27b Add mention of ResponseBodyAdvice 2014-09-03 00:04:50 -04:00
Rossen Stoyanchev 3a8f30613d Update the what's new section 2014-09-03 00:04:49 -04:00
Phillip Webb abc343f407 Prevent incorrect ImportAware metdata injection
Update ImportRegistry to track all import registrations that occur
against an importing class (rather than just keeping the last). In
addition, prune imported classes from the registry when a configuration
class is removed during the REGISTER_BEAN ConfigurationPhase.

This update prevents incorrect metadata from being injected into an
ImportAware class which is imported twice by different configurations
classes (when one of the configuration classes will be ultimately skipped
due to a @Condition).

Issue: SPR-12128
2014-09-02 20:47:30 -07:00
Andy Clement 8bf141eca9 Documentation updates describing SpEL compiler usage 2014-09-02 17:30:54 -07:00
Juergen Hoeller f617d28eef Polishing 2014-09-03 00:31:19 +02:00
Juergen Hoeller 4432c41dbd AbstractAutowireCapableBeanFactory avoids early FactoryBean instantiation on currently created configuration bean
Issue: SPR-12141
2014-09-03 00:28:05 +02:00
Sam Brannen 1f6c40fd86 Polish recent changes to reference manual 2014-09-02 22:38:20 +02:00
Juergen Hoeller 98eb0f75bc Polishing 2014-09-02 22:15:53 +02:00
Juergen Hoeller cfd01ab100 ExtendedBeanInfo uses explicit hashCode calculation (as defensive measure against JDK PropertyDescriptor changes) 2014-09-02 22:15:33 +02:00
Juergen Hoeller 8c9274e017 LazyInitTargetSource works for @Bean targets as well
Issue: SPR-10508
Issue: SPR-8080
2014-09-02 22:13:35 +02:00
Juergen Hoeller b64f680f19 AbstractAutowireCapableBeanFactory calls postProcessBeforeInstantiation with fully resolved target type
Issue: SPR-12140
Issue: SPR-12142
2014-09-02 22:10:09 +02:00
Juergen Hoeller 53fbf1a509 ConfigurationClassParser checks REGISTER_BEAN conditions before processing configuration class imports
Issue: SPR-12128
2014-09-02 22:07:51 +02:00
Rossen Stoyanchev 96563c7eea Update Javadoc in SimpMessageSendingOperations
Issue: SPR-12143
2014-09-02 15:41:17 -04:00
Sebastien Deleuze 041479a0d5 Add Web Improvements to what's new in Spring 4.1 section 2014-09-02 15:47:24 +02:00
Brian Clozel 5490168037 List all spring-framework artifacts in Modules
This change adds the artifacts names in the Spring Framework Modules
documentation. Linking both concepts make it easier to decide which
Spring module should be importer in an application's build.

Issue: SPR-11534
2014-09-02 14:34:07 +02:00
Brian Clozel 2ef20f63bc Remove assertion making locations mandatory
This change finishes work started in SPR-12133.

Issue: SPR-12133
2014-09-02 10:44:08 +02:00
Stephane Nicoll da8771d5a9 polishing 2014-09-01 18:31:07 +02:00
Stephane Nicoll fafb2fce2f Improve what's new in Spring 4.1 section 2014-09-01 18:26:59 +02:00
Juergen Hoeller 5452144dab HibernateJpaDialect only resets Connection read-only status if actually necessary (avoiding side effects)
Issue: SPR-8959
Issue: SPR-12118
2014-09-01 17:47:48 +02:00
Stephane Nicoll 8c4388dd6e Place holder resolution in @JmsListener arguments
This commit allows to use place holder definitions for JmsListener
attributes, effectively allowing to externalize those settings from
the code.

Issue: SPR-12134
2014-09-01 16:27:47 +02:00
Sam Brannen b4a6cafc8a Update link to @SpringFramework team members 2014-09-01 14:58:06 +02:00
Sam Brannen 5f0ae2ffba Update link to JDK 8 download 2014-09-01 14:55:17 +02:00
Sam Brannen ede97d99ea Add 'new in Spring 4.1' section to reference manual
This commit introduces a new-in-4.1 section in the reference manual with
initial content for testing improvements.
2014-09-01 03:16:51 +02:00
Sam Brannen 4c2aa6adc6 Document support for merging TELs with defaults
This commit restructures the content of the "TestExecutionListener
registration and ordering" section of the Testing chapter in the
reference manual into cross-referenced subsections with more
appropriate titles.

In addition, this commit introduces a new "Merging
TestExecutionListeners" subsection which documents the new MergeMode
feature in @TestExecutionListeners, including an example demonstrating
the MERGE_WITH_DEFAULTS mode.

Issue: SPR-12083
2014-09-01 02:35:29 +02:00
Sam Brannen 7cd615c4f9 Document automatic discovery of default TELs
This commit introduces a new "TestExecutionListener registration and
ordering" section in the Testing chapter of the reference manual.

Issue: SPR-12082
2014-09-01 01:33:58 +02:00
Sam Brannen 10c5827956 Improve text for xref links in the reference manual 2014-08-31 23:23:16 +02:00
Sam Brannen cdc522242f Document programmatic tx mgt support in the TCF
This commit introduces a new "Programmatic transaction management"
section in the Testing chapter of the reference manual with an example
highlighting the new support provided via TestTransaction.

In addition, this commit begins the work to be addressed more
thoroughly in SPR-11399 by overhauling the entire "Transaction
management" section with in-depth discussions on the following topics.

 - Test-managed transactions
 - Enabling and disabling transactions
 - Transaction rollback and commit behavior
 - Executing code outside of a transaction
 - Configuring a transaction manager

Issue: SPR-11941, SPR-11399
2014-08-31 22:53:43 +02:00
Sam Brannen 9926badb33 Document @TestPropertySource support in the reference manual
This commit introduces a new "Context configuration with test property
sources" section in the Testing chapter of the reference manual.

In addition, the "Context caching" section has been updated regarding
support for test property source locations and properties in
MergedContextConfiguration.

Issue: SPR-12076
2014-08-31 21:05:42 +02:00
Sam Brannen 703cc0d6ae Polish Javadoc for MergedContextConfiguration 2014-08-31 21:03:38 +02:00
Sam Brannen d4f5901f1f Document Groovy script support in the TCF
This commit documents support for using Groovy scripts to load
ApplicationContexts using the Spring TestContext Framework (TCF) in the
reference manual.

Issue: SPR-12027
2014-08-31 19:02:21 +02:00
Sam Brannen 3220d46776 Document @Sql script support in the reference manual
- Introduced a new "Executing SQL scripts" section in the Testing
   chapter with a subsection covering programmatic script execution via
   ResourceDatabasePopulator, ScriptUtils, etc. and a subsection
   dedicated to the new declarative support via @Sql.

 - Documented @Sql, @SqlConfig, and @SqlGroup in the "Annotations" and
   "Meta-annotation" sections.

 - Fixed broken cross-reference links to "false positives" with ORM tip.

 - Documented methods in JdbcTestUtils.

 - Improved layout and information in sections covering
   AbstractTransactionalJUnit4SpringContextTests and
   AbstractTransactionalTestNGSpringContextTests.

Issue: SPR-11849
2014-08-31 17:17:04 +02:00
Sam Brannen f9855b7901 Polish Javadoc for @Sql and SqlScriptsTestExecutionListener 2014-08-31 17:17:04 +02:00
Sebastien Deleuze 36542549fa Add HTTP status to ServletRequestHandledEvent
Issue: SPR-12119
2014-08-29 21:47:03 -04:00
Sam Brannen 5857cef026 Revise JUnit vs. Spring timeout support in reference manual
Prior to this commit, the discussion of JUnit vs. Spring with regard to
timeout support in tests erroneously claimed that Spring's support for
JUnit's @Test(timeout=...) did not include set up and tear down or
repetitions. This information, however, was based on a previous version
of SpringJUnit4ClassRunner and is no longer valid.

This commit revises the affected section of the testing chapter in the
reference manual accordingly.
2014-08-30 02:03:47 +02:00
Sam Brannen ac164088d6 Fix typos in reference manual
manger --> manager
2014-08-30 01:40:19 +02:00
Brian Clozel 76c46fdbe3 Change resource handler XML Namespace
This commit changes the way a <mvc:resource-cache> can be configured
with a user defined Cache instance.

Now a reference to a CacheManager Bean and a Cache name must be
provided. This is a more flexible configuration for typical XML setups.

  <mvc:resource-cache
    cache-manager="resourceCache"
    cache-name="test-resource-cache"/>

Issue: SPR-12129
2014-08-29 18:55:39 +02:00
Rossen Stoyanchev 4df05d1f98 Remove assertion on number of resource locations
With the new ResourceResolver abstraction and resource resolver chain
in 4.1, the assumption that resources are found by checking for the URL
path under the configured locations is no longer accurate.

A custom ResourceResolver could find resources in ways that don't
depend on a list of locations.

Issuse: SPR-12133
2014-08-29 11:29:49 -04:00
Brian Clozel d9f4016c35 Update resource handler XML Namespace
This change introduces a new <mvc:resource-chain/> tag that mirrors
the ResourceChainRegistration java config counterpart.

Resolvers and Transformers can be registered with bean/ref tags, and
specific tags have been created for <mvc:version-resovlver> and
<mvc:resource-cache> in order to make common configurations easier.

Note that a specific "auto-configuration" attribute on the
resource-chain allows to completely disable default registration of
Resolvers and Transformers (sane defaults considered by the Framework).

  <mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/">
      <mvc:resource-chain>
        <mvc:resource-cache cache="resourceCache"/>
        <mvc:resolvers>
          <mvc:version-resolver>
            <mvc:fixed-version-strategy version="abc" patterns="/**/*.js"/>
            <mvc:content-version-strategy patterns="/**"/>
          </mvc:version-resolver>
        </mvc:resolvers>
        <mvc:transformers>
          <bean class="org.springframework.web.servlet.resource.AppCacheManifestTransformer"/>
        </mvc:transformers>
      </mvc:resource-chain>
  </mvc:resources>

This also fixes a typo in the class name of
AppCacheManifestResourceTransfo*r*mer.

Issue: SPR-12129
2014-08-29 16:02:49 +02:00
Sam Brannen 8008e466aa Refactor AssertThrows to support Throwable
Prior to this commit, AssertThrows in the spring-test module only
supported Exception; however, there are legitimate test cases where the
subject under test (SUT) may potentially throw a subclass of Throwable.

This commit refactors AssertThrows so that it supports exceptions of
type Throwable instead of the limiting support for Exception.
Furthermore, AssertThrows has been refactored to use generics (e.g.,
Class<? extends Throwable> instead of merely Class).

Issue: SPR-6362
2014-08-29 16:00:01 +02:00
Sam Brannen 1bce6ac60c Discontinue use of deprecated AssertThrows
This commit refactors ReflectionTestUtilsTests so that it no longer uses
the deprecated AssertThrows class.
2014-08-29 15:28:19 +02:00
Sam Brannen 27be396b06 Update Javadoc for AssertThrows 2014-08-29 15:28:19 +02:00
Rossen Stoyanchev a0b231d36d Update port related code in UriComponentsBuilder
Use null to indicate no port has been provided.
Raise exception when port has not been expanded.

Issue: SPR-12123
2014-08-29 09:21:15 -04:00
Sebastien Deleuze 8fbd310b07 Support port URI template variables
This commit makes it possible to specify port with an URI template variable.

For example :
RestTemplate restTemplate = new RestTemplate();
restTemplate.getForObject("http://localhost:{port}/resource", String.class, 8080);

Issue: SPR-12123
2014-08-29 08:59:11 -04:00