Commit Graph

140 Commits

Author SHA1 Message Date
Phillip Webb 65fb26f847 Move spring-build-junit into spring-core
Move code from spring-build-junit into spring-core/src/test along with
several other test utility classes. This commit removes the temporary
spring-build-junit project introduced in commit
b083bbdec7.
2013-01-01 19:49:45 -08:00
Phillip Webb 6626a38730 Fix [deprecation] compiler warnings
Fix deprecation compiler warnings by refactoring code or applying
@SuppressWarnings("deprecation") annotations. JUnit tests of
internally deprecated classes are now themselves marked as
@Deprecated.

Numerous EasyMock deprecation warnings will remain until the
migration to mockito can be completed.
2013-01-01 13:42:15 -08:00
Chris Beams 8472a2b2ab Update Apache license headers for affected sources 2012-12-28 23:09:31 +01:00
Phillip Webb 60032e0012 Ignore performance-sensitive tests by default
Make use of the new JUnit functionality introduced in the previous
commit to 'Assume' that perfomance- and timing-sensitive tests should
run only when TestGroup.PERFORMANCE is selected, i.e. when
-PtestGroups="performance" has been provided at the Gradle command line.

The net effect is that these tests are now ignored by default, which
will result in far fewer false-negative CI build failures due to
resource contention and other external factors that cause slowdowns.

We will set up a dedicated performance CI build to run these tests on
an isolated machine, etc.

Issue: SPR-9984
2012-12-28 23:08:37 +01:00
Phillip Webb d66c733ef4 Replace EasyMock with Mockito in test sources
Issue: SPR-10126
2012-12-28 23:07:04 +01:00
Chris Beams 4c8cd7b0bd Add @Override annotations to test sources
Issue: SPR-10129
2012-12-28 23:05:44 +01:00
Chris Beams 40357be72b Fix various compiler warnings in spring-context
All warning types other than [deprecation] and [unchecked] are now
fixed in spring-context/src/test
2012-12-28 22:50:46 +01:00
Chris Beams 8d2e125e7b Fix [rawtypes] compiler warnings
- Suppress rawtypes warnings for src/main
 - Enable rawtypes warnings for src/test

This commit attempts to to resolve all rawtypes problems across tests as
aggressively as possible, i.e. without regard for binary compatibility,
whereas main sources must be treated much more cautiously with an eye
toward compatibility.
2012-12-28 22:50:46 +01:00
Phillip Webb 6c14eaad61 Fix [cast] compiler warnings 2012-12-28 22:41:06 +01:00
Phillip Webb b0986049a3 Fix [serial] compiler warnings
Fix serialization warnings by applying @SuppressWarnings("serial")
when appropriate.

In certain cases and for unknown reasons, a correctly-placed
@SuppressWarnings("serial") annotation will fix the warning at the
javac level (i.e. the Gradle command-line), but will produce an
"unnecessary @SuppressWarnings" warning within Eclipse. In these
cases, a private static final serialVersionUID field has been added
with the default value of 1L.
2012-12-28 22:41:06 +01:00
Phillip Webb 7f0aa5cfb2 Fix [varargs] compiler warnings
Remove unnecessary 'null' argument from calls to vararg supported
methods and fix cast in ValidationUtils.invokeValidator().
2012-12-28 22:40:49 +01:00
Phillip Webb 731d5be644 Fix warnings due to unused import statements 2012-12-28 22:40:49 +01:00
Chris Beams 9540d2c81b Replace <code> with {@code} throughout Javadoc
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Chris Beams 8597ec25ec Fix various Javadoc warnings
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Phillip Webb 2cf45bad86 Replace space indentation with tabs
Issue: SPR-10127
2012-12-28 20:49:56 +01:00
Phillip Webb 1762157ad1 Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
    xargs perl -p -i -e "s/[ \t]*$//g" {} \;

Issue: SPR-10127
2012-12-28 20:49:45 +01:00
Chris Beams 44a474a014 Various updates to support IDEA
Remove the 'final' modifier from SingletonBeanFactoryLocatorTests
to work around the "cannot extend final class" error issued when
running all tests. The error was due to confusion with IDEA between
the two variants of SingletonBeanFactoryLocatorTests across
spring-context and spring-beans.

Rename one of the GroovyMessenger classes to GroovyMessenger2.
Previously there were multiple Groovy classes named
'GroovyMessenger', causing a compilation error in certain IDE
arrangements.

Update import-into-idea.md documentation

Add various IDEA artifacts to .gitignore
 - ignore derby.log wherever it is written
 - ignore IDEA's test-output directory
 - ignore IDEA's Atlassian connector config file
2012-12-28 19:50:04 +01:00
Juergen Hoeller c242abada1 Fixed QualifierAnnotationAutowireCandidateResolver's detection of custom qualifier annotations
Issue: SPR-10107
2012-12-20 17:35:02 +01:00
Juergen Hoeller 047db8cdf8 Fixed AbstractAutoProxyCreator to accept null bean names again
Issue: SPR-10108
2012-12-20 17:33:26 +01:00
Juergen Hoeller c954d10be4 Allow for SpEL expressions in initial-delay attribute
Issue: SPR-10102
2012-12-19 12:09:18 +01:00
Juergen Hoeller b9df7d68d9 Consistent fine-tuning of synchronized and concurrent data structures
In particular, avoiding synchronized Sets and Maps wherever possible (preferring a ConcurrentHashMap even instead of a synchronized Set) and specifying appropriate ConcurrentHashMap initial capacities (even if we end up choosing 16).
2012-12-12 23:46:26 +01:00
Chris Beams f26534700a Eliminate all Javadoc warnings
- Support external Javadoc links using Gradle's javadoc.options.links

 - Fix all other Javadoc warnings, such as typos, references to
   non-existent (or no longer existent) types and members, etc,
   including changes related to the Quartz 2.0 upgrade (SPR-8275) and
   adding the HTTP PATCH method (SPR-7985).

 - Suppress all output for project-level `javadoc` tasks in order to
   hide false-negative warnings about cross-module @see and @link
   references (e.g. spring-core having a @see reference to spring-web).
   Use the `--info` (-i) flag to gradle at any time to see project-level
   javadoc warnings without running the entire `api` task. e.g.
   `gradle :spring-core:javadoc -i`

 - Favor root project level `api` task for detection of legitimate
   Javadoc warnings. There are now zero Javadoc warnings across the
   entirety of spring-framework. Goal: keep it that way.

 - Remove all @link and @see references to types and members that exist
   only in Servlet <= 2.5 and Hibernate <= 4.0, favoring 3.0+ and 4.0+
   respectively. This is necessary because only one version of each of
   these dependencies can be present on the global `api` javadoc task's
   classpath. To that end, the `api` task classpath has now been
   customized to ensure that the Servlet 3 API and Hibernate Core 4 jars
   have precedence.

 - SPR-8896 replaced our dependency on aspectjrt with a dependency on
   aspectjweaver, which is fine from a POM point of view, but causes
   a spurious warning to be emitted from the ant iajc task that it
   "cannot find aspectjrt on the classpath" - even though aspectjweaver
   is perfectly sufficient. In the name of keeping the console quiet, a
   new `rt` configuration has been added, and aspectjrt added as a
   dependency to it. In turn, configurations.rt.asPath is appended to
   the iajc classpath during both compileJava and compileTestJava for
   spring-aspects.

Issue: SPR-10078, SPR-8275, SPR-7985, SPR-8896
2012-12-12 12:55:10 +01:00
Juergen Hoeller c55446da9d Polishing 2012-12-12 03:29:47 +01:00
Juergen Hoeller 1cb6e3dbb6 Several enhancements with respect to CachingMetadataReaderFactory handling.
Added "clearCache()" method to CachingMetadataReaderFactory, for clearing the metadata cache once not needed anymore - in particular when the MetadataReaderFactory instance is long-lived. Also added "setMetadataReaderFactory" method to ClassPathScanningCandidateComponentProvider, analogous to ConfigurationClassPostProcessor.
2012-12-12 03:29:44 +01:00
Juergen Hoeller e298658ef0 Polishing 2012-12-12 03:29:44 +01:00
Juergen Hoeller 801d4714b1 Fixed CGLIB proxy class leaks through further equals/hashCode implementations in Spring AOP pointcuts
Issue: SPR-8008
2012-12-12 03:29:43 +01:00
Juergen Hoeller a92f7dd474 ConfigurationClassPostProcessor consistently uses ClassLoader, not loading core JDK classes via ASM
Issue: SPR-10058
2012-12-05 19:12:05 +01:00
Phillip Webb 0d73d199ec Reset MBean Servers after JRuby and JMX tests
Refactor MBean Server reset code from MBeanServerFactoryBeanTests
and reuse in AdvisedJRubyScriptFactoryTests and
AbstractMBeanServerTests.

Issue: SPR-9288
2012-11-29 14:47:24 -08:00
Juergen Hoeller f1923f406e Removed outdated EjbSupportTests 2012-11-29 23:42:26 +01:00
Juergen Hoeller 230dec8e6f Removed unnecessary dependency on JTA API 2012-11-29 23:14:08 +01:00
Juergen Hoeller 0614d312ed Polishing 2012-11-29 23:13:49 +01:00
Phillip Webb 6ca71abf93 Intermittent MBeanServerFactoryBeanTests failure
Prior to this commit the testWithLocateExistingAndExistingServer method
would fail if any preceding test called the ManagementFactory
getPlatformMBeanServer() method. In such situations the platform
server is located instead of the expected freshly created server.

These failures are more likely to happen when compiling with JDK 7
due to the fact that the reflection API no longer returns methods
in a consistent order.

Unfortunately there is no easy way to reset the platform MBean server
so the new code must resort to using reflection to access the private
static ManagementFactory.platformMBeanServer field.

Issue: SPR-9288
2012-11-26 15:45:21 -08:00
Juergen Hoeller 9c6aa3e43b Java 5 Closeable and Java 7 AutoCloseable automatically detected as destroy methods
Also, @Bean destroy method inference not applying for DisposableBean implementers anymore (avoiding double destruction).

Issue: SPR-10034
2012-11-26 22:47:08 +01:00
Juergen Hoeller 52124fa31b Avoid wide locks in order to remove deadlock potential in case of multi-threaded singleton creation/destruction
Issue: SPR-10020
Issue: SPR-8471
2012-11-25 23:32:52 +01:00
Juergen Hoeller 87b7e3d8cf Fixed @Lazy and @DependsOn annotation definitions to be non-inheritable
Issue: SPR-9589
Issue: SPR-9476
2012-11-25 22:28:23 +01:00
Juergen Hoeller e2f418ab4c Added "transactionAware" bean property to EhCacheCacheManager and JCacheCacheManager
In the course of this enhancement, the "cache.ehcache" and "cache.jcache" packages moved from spring-context to the spring-context-support module, expecting further transaction-related functionality. Also aligns with the presence of Spring's Quartz support in the spring-context-support module, since Quartz and EHCache are sort of sister projects at Terracotta now.

Issue: SPR-9966
2012-11-25 21:58:35 +01:00
Juergen Hoeller 0ec19dc95e Removed OC4J tests 2012-11-25 21:12:59 +01:00
Juergen Hoeller b0c6a24974 Deprecated "scheduling.backportconcurrent" package in favor of native JDK 6 "scheduling.concurrent" support 2012-11-25 21:08:06 +01:00
Juergen Hoeller 4dc336920c Deprecated EJB 2.x implementation class hierarchy in "ejb.support" package 2012-11-25 21:06:25 +01:00
Juergen Hoeller 3d5bfc35b6 Deprecated Oracle OC4J support in favor of Oracle WebLogic 2012-11-25 21:00:56 +01:00
Juergen Hoeller df76f1497a Replaced use of EmbeddedValueResolverAware with ConfigurableBeanFactory's resolveEmbeddedValue in order to avoid a package cycle with the org.springframework.context package
Issue: SPR-10021
2012-11-25 20:18:59 +01:00
Phillip Webb 838ba79f55 Fix Javadoc references to incorrect XML
Replace references to <task:annotation-config> with
<task:annotation-driven>
2012-11-20 12:17:25 -08:00
Phillip Webb 63ca14c33e Clarify use of @Bean with @EnableAsync executors
Update Javadoc to indicate that the getAsyncExecutor() method may be
optionally annotated with @Bean and in such circumstance the
executor.initialize() method need not be called.

Issue: SPR-9934
2012-11-19 10:42:33 -08:00
Oliver Gierke 146a66fe0b Support *Aware ImportBeanDefinitionRegistars
Implementations of Spring's ImportBeanDefinitionRegistrar interface may
now implement any of the following *Aware interfaces and have their
respective methods called prior to #registerBeanDefinitions:

 - BeanFactoryAware
 - BeanClassLoaderAware
 - ResourceLoaderAware

Issue: SPR-9568
2012-11-12 18:26:50 +01:00
Juergen Hoeller f6209cd7af DefaultSingletonBeanRegistry avoids singletonObjects lock wherever possible for non-singleton factory performance
Also fixing setCurrentlyInCreation to use a concurrent Set and to apply to prototype beans as well.

Issue: SPR-9819
2012-11-09 00:54:57 +01:00
Juergen Hoeller de91d754d8 Re-added InitializingBean declaration 2012-11-09 00:13:40 +01:00
Juergen Hoeller ea95da126a Implement java.io.Closeable where appropriate
Issue: SPR-9962
2012-11-08 23:44:49 +01:00
Juergen Hoeller 0a3ea42fe1 DefaultSingletonBeanRegistry avoids singletonObjects lock wherever possible for non-singleton factory performance
Issue: SPR-9819
2012-11-08 23:21:18 +01:00
Sam Brannen 85ab789f2f Refactor & polish DateTimeFormatterFactory[Bean]
This commit refactors the logic in DateTimeFormatterFactory's
createDateTimeFormatter() method to ensure forward compatibility with
possible future changes to the ISO enum.

This commit also polishes the Javadoc for DateTimeFormatterFactoryBean.

Issue: SPR-9959
2012-11-06 18:07:32 +01:00
Phillip Webb 432c6ebdae Refactor DateTimeFormatterFactory
Refactor DateTimeFormatterFactory into two distinct classes; a general
purpose factory and a specialized FactoryBean.  These changes are
modeled after the existing VelocityEngineFactory and
VelocityEngineFactoryBean classes.

Issue: SPR-9959
2012-11-05 11:30:25 -08:00