Commit Graph

99 Commits

Author SHA1 Message Date
Juergen Hoeller
b17d545bb7 @ActiveProfiles mechanism works with @ImportResource as well (SPR-8992) 2012-02-11 19:15:39 +01:00
Chris Beams
41c405998e Convert CRLF=>LF on files missed earlier
Complete pass with `dos2unix` found additional files missed on earlier
related commit.

Issue: SPR-5608
2011-12-22 14:06:44 +01:00
Chris Beams
88913f2b23 Convert CRLF (dos) to LF (unix)
Prior to this change, roughly 5% (~300 out of 6000+) of files under the
source tree had CRLF line endings as opposed to the majority which have
LF endings.

This change normalizes these files to LF for consistency going forward.

Command used:

$ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix

Issue: SPR-5608
2011-12-21 14:52:47 +01:00
Juergen Hoeller
dfc5b482c9 IntelliJ IDEA 11 project setup 2011-12-16 11:56:51 +01:00
Rossen Stoyanchev
63e235f215 SPR-8750 Refine 'Content-Type' update in MockHttpServletRequest/Response.
The initial solution kept these three in full sync at all times:
contentType field, characterEncoding field, 'Content-Type' header.
That is correct behavior, however it breaks existing tests that rely
on contentType and characterEncoding being equal to exactly what 
they were set to.

For example, consider:
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");

Ideally both contentType and the 'Content-Type' header would now be
"text/plain;charset=UTF-8". However, existing tests would expect 
that contentType is equal to "text/plain".

To avoid breaking existing tests, contentType and characterEncoding
will continue to be equal to exactly what they were set to while
the 'Content-Type' header will always include both the content 
type and the charset.

The only exception to this rule is when a 'Content-Type' header
is set explicitly, the contentType and characterEncoding fields will 
be updated accordingly, possibly overriding the existing values.
2011-11-17 15:07:15 +00:00
Rossen Stoyanchev
7918810366 SPR-8750 Update MockHttpServletRequest/Response handling of contentType.
The Content-Type header and the contentType field in HttpServletRequest/Response
are now always in sync. When a header is added the contentType field is updated
as well and vice versa. 

Similarly when the Content-Type header or the contentType field includes a charset 
field, the character encoding is updated and vice versa.
2011-11-16 23:28:48 +00:00
Sam Brannen
1a34f6459d [SPR-8644][SPR-8633] introduced failing (ignored) test regarding support for invoking methods that accept var-args. 2011-08-30 14:20:12 +00:00
Sam Brannen
4d99ddba8a [SPR-8633] Introduced generic invokeMethod() in ReflectionTestUtils. 2011-08-24 17:26:59 +00:00
Sam Brannen
72da569aa3 [SPR-8386][SPR-8387] Revised Javadoc in the TestContext framework regarding changes in 3.1. 2011-08-20 23:14:20 +00:00
Sam Brannen
381ab6fcc2 [SPR-8627] Deprecated @ExpectedException. 2011-08-20 18:32:37 +00:00
Sam Brannen
9a40021f18 [SPR-8386][SPR-8387] Refined logging regarding detection of default resource locations and default configuration classes. 2011-08-13 15:38:45 +00:00
Sam Brannen
a298c2dde8 [SPR-8386][SPR-8387] Redesign of DelegatingSmartContextLoader and the SmartContextLoader SPI:
- Removed generatesDefaults() and supports() from the SmartContextLoader SPI and modified the DelegatingSmartContextLoader algorithm accordingly.
- DelegatingSmartContextLoader no longer operates on a list of candidate loaders but rather on explicit instances of GenericXmlContextLoader and AnnotationConfigContextLoader.
- Updated Javadoc regarding DelegatingSmartContextLoader as the new default loader.
- Updated and polished Javadoc regarding changes in 3.1.
- Now enforcing @ContextConfiguration's restriction on declaring locations or classes but not both.
2011-08-13 14:31:00 +00:00
Sam Brannen
8224af1938 [SPR-8549] ContextCache is now keyed by MergedContextConfiguration instead of String; MergedContextConfiguration now implements custom hashCode() and equals() methods and no longer generates a context cache key. 2011-07-20 22:06:05 +00:00
Sam Brannen
f874ed9790 [SPR-8387] Fleshed out the implementation of DelegatingSmartContextLoader and corresponding tests. 2011-07-17 17:16:12 +00:00
Sam Brannen
e34fa6abb1 [SPR-8387] Fixed logic error in DelegatingSmartContextLoader.processContextConfiguration(). 2011-07-15 19:19:29 +00:00
Sam Brannen
d2e6f82aa3 [SPR-8387] Fleshing out the implementation of processContextConfiguration() in DelegatingSmartContextLoader. 2011-07-15 17:15:45 +00:00
Sam Brannen
12eb9d7ed6 [SPR-8387] Fleshing out unit tests for DelegatingSmartContextLoader. 2011-07-15 16:12:34 +00:00
Juergen Hoeller
cc725d7e5c extended Servlet API mocks for Servlet 3.0 forward compatibility as far as possible; made MockHttpServletResponse compatible with Servlet 3.0 getHeader(s) method returning Strings (SPR-8529); added getHeaderValue(s) method to MockHttpServletResponse for raw value access 2011-07-15 14:51:01 +00:00
Sam Brannen
4aed64ea4b [SPR-8387] skeleton for DelegatingSmartContextLoaderTests. 2011-06-26 17:01:32 +00:00
Sam Brannen
4cbe2ae00a [SPR-8387] Introduced supports(MergedContextConfiguration) method in the SmartContextLoader SPI; updated existing loaders accordingly; and fleshed out implementation of and tests for the new DelegatingSmartContextLoader. 2011-06-26 16:46:18 +00:00
Sam Brannen
4ef895a018 [SPR-8387] Initial draft of the new DelegatingSmartContextLoader. 2011-06-26 15:39:58 +00:00
Sam Brannen
f7a849f9f4 [SPR-8386] AbstractContextLoader now adheres to the SmartContextLoader contract by verifying the existence of generated default resource locations. 2011-06-20 16:20:14 +00:00
Sam Brannen
4d27cde6b7 [SPR-8386] fleshing out JavaDoc for SmartContextLoader and related classes. 2011-06-19 22:41:18 +00:00
Sam Brannen
a77cf0f652 [SPR-8395][SPR-8386] AnnotationConfigContextLoader now generates a list of default configuration classes by finding all non-private, non-final, static, inner classes of the test class that are annotated with @Configuration; updated JavaDoc in AbstractGenericContextLoader and AnnotationConfigContextLoader to reflect changes resulting from the SmartContextLoader integration. 2011-06-19 17:36:25 +00:00
Sam Brannen
d904bcbf03 [SPR-8386] AnnotationConfigContextLoader now only considers static inner classes annotated with @Configuration when generating default configuration classes. 2011-06-18 19:58:53 +00:00
Sam Brannen
46639c5a1d [SPR-8386] Polishing SmartContextLoader SPI; AnnotationConfigContextLoader now only considers static inner classes annotated with @Configuration as configuration classes. 2011-06-18 19:45:39 +00:00
Sam Brannen
9a56deb283 [SPR-8386] SmartContextLoader enhancements:
- introduced processContextConfigurationAttributes() method in SmartContextLoader SPI
- refactored AnnotationConfigContextLoader, AbstractContextLoader, AbstractGenericContextLoader, ContextLoaderUtils, and TestContext implementations to take advantage of the SmartContextLoader SPI, MergedContextConfiguration, and ContextConfigurationAttributes
- deleted ResourceTypeAwareContextLoader
- deleted ContextLoaderUtils.LocationsResolver and implementations
- moved context key generation from TestContext to MergedContextConfiguration
2011-06-17 21:49:06 +00:00
Sam Brannen
3f58da1cd6 [SPR-7326] Added unit tests to verify proper semantics of TestContext's cache key generation. 2011-06-03 21:38:05 +00:00
Sam Brannen
da41c9bb11 polishing 2011-06-03 16:19:41 +00:00
Sam Brannen
0d4469d8e3 Suppressing warnings for deprecation of SimpleJdbcTemplate; polishing JavaDoc; using TestNG assertions in TestNG tests. 2011-06-03 14:10:16 +00:00
Sam Brannen
266e1096ce polishing 2011-06-03 13:40:45 +00:00
Sam Brannen
2b17ee0911 [SPR-6184] AnnotationConfigContextLoader now defines "$ContextConfiguration" as the resource suffix for generated default @Configuration class names. 2011-06-03 13:39:15 +00:00
Sam Brannen
39583d23fd [SPR-6184] AnnotationConfigContextLoader now defines "$ContextConfiguration" as the resource suffix for generated default @Configuration class names. 2011-06-03 13:11:06 +00:00
Sam Brannen
2913964b41 [SPR-7960][SPR-8386] Supporting declarative configuration of bean definition profiles in the TestContext framework:
- TextContext now works with MergedContextConfiguration instead of locations and loader
- TextContext now builds context caching key from MergedContextConfiguration
- Test context caching is now based on locations, classes, active profiles, and context loader
- TextContext now delegates to SmartContextLoader or ContextLoader as appropriate
- AbstractContextLoader now implements SmartContextLoader
- AbstractGenericContextLoader now sets active profiles in the GenericApplicationContext 
- Introduced integration tests for profile support in the TCF for both XML and annotation config
2011-06-02 17:51:37 +00:00
Sam Brannen
ac735d73ac [SPR-7960][SPR-8386] First draft of SmartContextLoader SPI, MergedContextConfiguration, and ContextConfigurationAttributes. 2011-06-02 14:45:22 +00:00
Sam Brannen
ff2a603f2f [SPR-7960] Trimming profiles for good measure. 2011-06-01 15:04:34 +00:00
Sam Brannen
24a97805ef [SPR-7960] Renamed @ActivateProfiles to @ActiveProfiles and fleshed out JavaDoc. 2011-06-01 14:40:53 +00:00
Sam Brannen
3a2afde41d [SPR-7960] Renamed resolveActivatedProfiles() to resolveActiveProfiles(). 2011-06-01 12:59:47 +00:00
Sam Brannen
f64344b296 [SPR-7960] resolveActivatedProfiles() now resolves a unique set of activated profiles 2011-06-01 12:56:50 +00:00
Sam Brannen
6981ee566c [SPR-7960] No longer tracking empty activated profiles. 2011-05-31 22:29:14 +00:00
Sam Brannen
f5a39ae7ff [SPR-7960] Initial support for @ActivateProfiles in tests. 2011-05-30 21:59:12 +00:00
Sam Brannen
174bf58308 [SPR-6184] added tests to verify support for @Configuration classes with TestNG; simplified existing TestNG tests using Spring 3.0 and 3.1 features. 2011-04-09 22:44:53 +00:00
Sam Brannen
522a879496 polishing 2011-04-09 21:40:08 +00:00
Sam Brannen
0584c26b2c [SPR-6184] additional sanity check tests analogous to those developed for [SPR-3896]. 2011-04-09 21:39:42 +00:00
Sam Brannen
c50d38ef8d [SPR-6184] Introduced ResourceType enum for context loaders; documented tests. 2011-04-08 22:57:45 +00:00
Sam Brannen
4dcc79d6eb [SPR-6184] Implemented recursive search for configuration classes; introduced LocationsResolver strategy in ContextLoaderUtils with ResourcePathLocationsResolver and ClassNameLocationsResolver implementations. 2011-04-03 23:10:28 +00:00
Sam Brannen
f3d125626d [SPR-6184] Refactored internals of ContextLoaderUtils; @Ignore'd broken test. 2011-04-03 17:45:20 +00:00
Sam Brannen
293baeeb88 [SPR-6184] Updated TODOs. 2011-04-03 17:23:57 +00:00
Sam Brannen
523c090551 [SPR-6184] Added DefaultConfigClassInheritedTests to verify proper recursive search for configuration classes configured via @ContextConfiguration. This test is currently failing (as expected) and therefore @Ignore'd. 2011-04-03 17:22:43 +00:00
Sam Brannen
70f883303f Removed unnecessary declaration of @TestExecutionListeners. 2011-04-03 17:20:02 +00:00