Commit Graph

6793 Commits

Author SHA1 Message Date
Sam Brannen
d4dcf4e4ec Merge from sbrannen/SPR-8032
* SPR-8032:
  Introduce TCP & UDP server port scanning utility
2013-06-15 13:51:27 +02:00
Sam Brannen
f311bf3daf Introduce TCP & UDP server port scanning utility
Prior to this commit the Spring Framework did not provide a public means
for scanning for available server ports. However, the Spring Framework
internally used a FreePortScanner in integration tests within its own
test suite. Furthermore, Spring Integration 2.2 provides similar support
in a SocketUtils class in the spring-integration-test module.

This commit introduces SocketUtils in spring-core to replace the
FreePortScanner which was previously only used internally within
Spring's test suite. This new implementation is inspired by both Spring
Framework's FreePortScanner and Spring Integration's SocketUtils and
consequently attempts to merge the best of both previous
implementations.

Issue: SPR-8032
2013-06-15 13:46:32 +02:00
Sam Brannen
e12311e364 Polish Javadoc 2013-06-14 16:06:57 +02:00
Phillip Webb
b78dcc59fe Make ConfClassPostPro Ordered.HIGHEST_PRECEDENCE
Make ConfigurationClassPostProcessor Ordered.HIGHEST_PRECEDENCE in
case several BeanDefinitionRegistryPostProcessors are registered.

Issue: SPR-10645
2013-06-12 11:46:48 -07:00
Phillip Webb
2e2e9b8dd0 Improve support for @Conditional on @Configuration
Introduce new ConfigurationCondition interface allowing more
fine-grained control for @Conditional when used with @Configuration
beans.

Primarily added so that the evaluation of conditions that inspect bean
definitions can be deferred until all @Configuration classes have been
parsed.

Issue: SPR-10534
2013-06-12 11:45:20 -07:00
Phillip Webb
e10e16cd6b Support fall-back to ASM parsing @Configuration
Update ConfigurationClassParser to fall-back to ASM parsing if standard
annotation processing fails. This change allows @Conditional annotations
that refer to missing classes to work.

This commit also introduces a new inner SourceClass object that
encapsulates the conditional logic required when reading the source
classes.

Issue: SPR-10646
2013-06-10 09:25:34 -07:00
Sam Brannen
51d828816d Throw ISEs in MockHttpSession for invalid session
The Javadoc for several methods in HttpSession specifies that an
IllegalStateException must be thrown if the method is called on an
invalidated session; however, Spring's MockHttpSession did not implement
this behavior consistently prior to this commit.

This commit therefore ensures that the following methods in
MockHttpSession properly throw an IllegalStateException as defined in
the Servlet specification.

 - long getCreationTime()
 - long getLastAccessedTime()
 - Object getAttribute(String)
 - Object getValue(String)
 - Enumeration<String> getAttributeNames()
 - String[] getValueNames()
 - void setAttribute(String, Object)
 - void putValue(String , Object)
 - void removeAttribute(String)
 - void removeValue(String)
 - void invalidate()
 - boolean isNew()

Issue: SPR-7659
2013-06-09 16:38:04 +02:00
Sam Brannen
ec5d81e78e Ensure method & requestURI are non-null in MHSR
Prior to this commit it was possible for the method and requestURI
fields in MockHttpServletRequest to be set to null.

This commit ensures that the method and requestURI fields are internally
stored as empty strings if the user sets them to a null value.

Issue: SPR-10643
2013-06-09 12:42:00 +02:00
Sam Brannen
86591e5e5a Support implicit ports in MHSR.getRequestURL()
Prior to this commit, MockHttpServletRequest.getRequestURL() always
included the server port number in the reconstructed request URL, even
for implicit ports (i.e., 80 and 443) and negative ports.

MockHttpServletRequest.getRequestURL() now omits the port number when
reconstructing a URL that has an implicit or negative port.

Issue: SPR-9726
2013-06-09 11:55:24 +02:00
Sam Brannen
97d152547d Reformatted GenericTypeResolverTests 2013-06-09 00:24:37 +02:00
Sam Brannen
b305f0005b Add test to assess claims in SPR-10411
This commit verifies that the return type of a parameterized instance
factory method is properly resolved.

Issue: SPR-10411
2013-06-09 00:21:58 +02:00
Sam Brannen
b3a693e356 Add test to assess claim in SPR-10330
This commit verifies that JdbcTestUtils.readScript() properly handles
SQL comments prefixed by tab characters.

Issue: SPR-10330
2013-06-08 21:45:29 +02:00
Sam Brannen
bc9e4ab106 Polish method names in JdbcTestUtilsTests 2013-06-08 21:05:16 +02:00
Sam Brannen
34e8ee94c4 Add deleteFromTableWhere() to base classes in TCF
This commit introduces a deleteFromTableWhere() convenience method in
AbstractTransactionalJUnit4SpringContextTests and
AbstractTransactionalTestNGSpringContextTests that delegates to the
recently introduced method of the same name in JdbcTestUtils.

Issue: SPR-10639
2013-06-08 21:03:45 +02:00
Sam Brannen
96da406057 Upgrade to TestNG 6.8.5
Issue: SPR-10638
2013-06-08 20:21:06 +02:00
Sam Brannen
96e1fbc3bb Polish @Conditional Javadoc and tests 2013-06-08 17:49:54 +02:00
Phillip Webb
239ce1466c Update @Conditional processing logic
Defer @Conditional processing on @Configuration classes until the bean
definitions are loaded, rather than when the @Configuration class is
parsed. This provides better support for @Conditional implementations
that inspect bean definitions.

This commit also fixes some minor problems with original implementation
and replaces the ConditionalAnnotationHelper class with
ConditionEvaluator.

Issue: SPR-10534
2013-06-04 10:27:51 -07:00
Phillip Webb
2ecc51f066 Do not consider all @Components as configuration
Update ConfigurationClassUtils to only consider beans with @Bean
methods as 'lite' configuration candidates.

Prior to this commit all @Component beans were considered 'lite'
configuration candidates which could result in a large number of
ConfigurationClass instance being created that would ultimately be
ignored.

Issue: SPR-10609
2013-06-04 10:26:31 -07:00
Phillip Webb
a8fd832818 Support meta @Component with non-string value
Update AnnotationBeanNameGenerator to only use the value attribute of
a @Component meta-annotated annotation when it is a String.

Issue: SPR-10580
2013-06-04 10:23:23 -07:00
Phillip Webb
5377fae7f5 Remove duplicate Javadoc line from PathResource
Remove duplicate Javadoc comment from PathResource that was
accidentally introduced during the merge.

Issue: SPR-10608
2013-06-03 22:10:57 -07:00
Phillip Webb
5006dcd0ec Merge pull request #295 from marschall/SPR-10608
# By Philippe Marschall
* SPR-10608-rebase:
  Introduce java.nio.file.Path based Resource
2013-06-03 16:25:56 -07:00
Philippe Marschall
2313c9a007 Introduce java.nio.file.Path based Resource
Develop new org.springframework.core.io.Resource implementation
backed by java.nio.file.Path. Primarily developed to allow custom
file system implementations to be used with Spring.

Since the minimum requirement for Spring is still Java 6 the
existing FileSystemResource can't be retrofitted (and no #getPath
method can be added to the Resource interface).

Unlike FileSystemResource, PathResource delegates to the underlying
file system instead of StringUtils. It has therefore slightly
different semantics. First, when building relative resources via
createRelative the relative path will apply to this path (like URL or
Unix). Second, equality is delegated to the underlying file system
provider so it's case-insensitive on Windows.

Issue: SPR-10608
2013-06-03 16:25:45 -07:00
Phillip Webb
1f5467a29d Merge pull request #286 from sslavic/SPR-10571
# By Stevo Slavic
* SPR-10571:
  Replace MaxPermSize use in build scripts
2013-06-03 14:10:33 -07:00
Stevo Slavic
ecf8464d2f Replace MaxPermSize use in build scripts
Since JDK 8 is required to build Spring framework 4, and permanent
generation is gone from Java 8, to eliminate warnings about no longer
available MaxPermSize switch, it should be removed or replaced with new
MaxMetaspaceSize switch.

This fix replaces old with new switch to limit the amount of native
memory used for class metadata.

Issue: SPR-10571
2013-06-03 14:09:33 -07:00
Phillip Webb
4d3383242e Support EnvironmentAware ImportSelector/Registrar
Add support for the EnvironmentAware interface with ImportSelector
and ImportBeanDefinitionRegistrar implementations.

Issue: SPR-10602
2013-06-03 12:19:47 -07:00
Phillip Webb
d7ec20a286 Test for property placeholder with defaults
Test property placeholder with multiple locations and default values.

Issue: SPR-10619
2013-06-03 09:37:43 -07:00
Carson McDonald
ae74a2158a Fix typo {explictly => explicitly}
- cherry-pick of pull request #257, which originally applied to 3.2.x
2013-05-31 08:22:36 +02:00
Rossen Stoyanchev
827e20e37f Upgrade javax.websocket and tyrus dependencies to 1.0 2013-05-30 15:25:01 -04:00
Phillip Webb
e63ee1ee5a Fixed typo in docbook id
Issue: SPR-10394
2013-05-28 14:25:57 -07:00
Chris Beams
ba45f70342 Merge pull request #291 from dsyer/10579
# By Chris Beams (1) and Dave Syer (1)
* SPR-10579:
  Polish pull request #291 per committer guidelines
  Make CommandLinePropertySource enumerable
2013-05-28 13:52:01 +02:00
Chris Beams
46d47fef9a Polish pull request #291 per committer guidelines
- Update Apache license headers
 - Remove trailing whitespace
 - Edit original commit comment to use 'Issue:' syntax
 - Revert use of diamond operator (<>) in main sources

See committer guidelines at
https://github.com/SpringSource/spring-framework/blob/master/CONTRIBUTING.md

Issue: SPR-10579
2013-05-28 13:51:35 +02:00
Dave Syer
7860af8624 Make CommandLinePropertySource enumerable
JOpt 4.4 has enumerable options, so this change can be made
if we upgrade. The only awkward thing is that JOpt allows
aliases for options, so we have to pick one to avoid double
counting. This implementation picks the last one in the list
which is the alphebtically last of the long options, if there
are any (e.g. "o1", "option1" returns "option1"). Most of the
time there will only be one or two aliases for each option so
it won't matter.

Issue: SPR-10579
2013-05-28 12:57:01 +02:00
Chris Beams
3c73a8fc4f Instruct contributors to branch from master 2013-05-28 13:54:14 +03:00
Sam Brannen
00fea1f715 Fix minor typo in README.md 2013-05-26 14:28:37 +02:00
Rob Winch
07b7553355 Fix MergePlugin
The submitted pull requests for SPR-10572 did not build.

This commit fixes the MergePlugin to create from configurations rather
than the project. It also removes unnecessarily added code that was
commented out.

Issue: SPR-10572
2013-05-22 14:57:22 -05:00
Stevo Slavic
bf205bfe79 Eliminate Gradle 1.6 deprecation warnings
Recently Spring framework build has been updated to use Gradle 1.6.
With the new version some of the Gradle APIs have been deprecated.
These deprecated APIs have been used by Spring build specific Gradle
plugins, which resulted in deprecation warnings in build output.

This patch changes Spring build specific Gradle plugins to use new
Gradle APIs instead of deprecated ones.

Even after this change build still produces warnings about Gradle
deprecated APIs being used. These come from Spring shared Gradle
plugins and other 3rd party Gradle plugins in use, like Gradle
Artifactory Plugin (GAP), which are still not updated to Gradle 1.6.
Related tickets for updating of these plugins to Gradle 1.6 are
GRADLE-53 and GAP-144, and once they get resolved Spring framework
build should further be updated.

Issue: SPR-10572
2013-05-22 14:57:21 -05:00
Chris Beams
3865a8706c Revise note on avoiding "lambda" JDK 2013-05-22 10:06:13 +02:00
Chris Beams
eae0f8b53a Merge pull request #288 from dsyer/patch-1
Update README adding explicit JDK instructions
2013-05-22 00:58:23 -07:00
Chris Beams
08f255d746 Mention JDK 8 in IDE import instructions 2013-05-22 09:55:18 +02:00
Chris Beams
d97f6cf5b8 Clarify instructions for building from source
Re-order subsections to make it clear that running a full
`./gradlew build` is not necessary just to import projects
into your IDE or to build and install jars to your .m2 cache.
2013-05-22 09:48:14 +02:00
Dave Syer
c3a5b415cf Update README adding explicit JDK instructions 2013-05-22 09:37:29 +02:00
Spring Buildmaster
f9b5b1df53 Increment version to 4.0.0.BUILD-SNAPSHOT 2013-05-17 09:55:02 -07:00
Spring Buildmaster
9ee292aaf7 Release version 4.0.0.M1 2013-05-16 21:43:41 -07:00
Phillip Webb
6fe50b502f Enforce JDK version on CI server
Add a test to ensure that the CI server does not accidentally build
with the wrong JDK version.

Issue: SPR-10569
2013-05-16 17:06:30 -07:00
Rossen Stoyanchev
87a9602f65 Fix bug in WebSocketClient implementations 2013-05-16 19:12:27 -04:00
Rossen Stoyanchev
fb4e34fce4 Add partial WebSocketMessage support 2013-05-16 12:17:40 -04:00
Juergen Hoeller
814d24e64f Consistent detection of Order annotation in superclasses and interfaces
Issue: SPR-10514
2013-05-16 18:05:56 +02:00
Juergen Hoeller
16548d23e9 Consistent use of Class<?> in Assert 2013-05-16 16:10:36 +02:00
Juergen Hoeller
a19c976f7f Avoid NPE in ContextLoader when dealing with an untyped ApplicationContextInitializer
Issue: SPR-10449
2013-05-16 16:09:54 +02:00
Juergen Hoeller
c8b071c89e Fixed BeanPropertyRowMapper to only prefix actual upper-case letters with underscores
Issue: SPR-10547
2013-05-16 14:33:15 +02:00