Skip to content

first support for meta-annotations for the integration tests #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 174 commits into from
Closed

first support for meta-annotations for the integration tests #201

wants to merge 174 commits into from

Conversation

giovannidalloglio
Copy link
Contributor

related to issue: https://jira.springsource.org/browse/SPR-7827

prior this commit, there was no support for meta-annotations in the Spring Intergation tests, now the @ContextConfiguration annotation is searched also in meta-annotations.

Eg: you can write:

@ContextConfiguration([...]) // config for HSQLDB environment
public @interface InRamEnvironment
@ContextConfiguration([...]) // config for common-core part
public @interface CommonCoreIntegrationTest
@CommonCoreIntegrationTest
@InRamEnvironment
public class OneBatchTest {

[...] // actual test methods
}

@giovannidalloglio
Copy link
Contributor Author

PS I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.

@ghost ghost assigned sbrannen Dec 12, 2012
@giovannidalloglio
Copy link
Contributor Author

WARNING!!!

I just discovered that I forgot an important thing: the inheritance of the AC configuration files in integration tests!

At the moment I "put together" all @ContextConfiguration in a single list, but I miss the necessary tests to understand how to behave in case the flags inheritLocations and inheritInitializers.

I suspect (very much) that my pull request should be extended.
I'll think about these days, and I hope to deal with them.

I apologize for this momentary oversight.

philwebb and others added 27 commits January 4, 2013 09:39
Update the TestSourceSetDependenciesPlugin to consider testCompile
configurations.
Remove all direct sourceSets.test.output dependencies and instead rely
on the 'test-source-set-dependencies' plugin.

This commit also updates the api JavaDoc task to ensure that
dependencies are not resolved too early.
* share-test-classes:
  Polish test sourceSet dependencies
  Add test dependencies sources for testCompile
Refactor spring-core tests to replace test beans from
'org.springframework.beans' with lighter test objects in
'org.springframework.tests.sample.objects'.
Prior to this commit many test utility classes and sample beans were
duplicated across projects. This was previously necessary due to the
fact that dependent test sources were not shared during a gradle
build. Since the introduction of the 'test-source-set-dependencies'
gradle plugin this is no longer the case.

This commit attempts to remove as much duplicate code as possible,
co-locating test utilities and beans in the most suitable project.
For example, test beans are now located in the 'spring-beans'
project.

Some of the duplicated code had started to drift apart when
modifications made in one project where not ported to others. All
changes have now been consolidated and when necessary existing tests
have been refactored to account for the differences.

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
* cleanup-test-duplicates:
  Update Apache license headers for affected sources
  Remove duplicate test classes
  Replace test beans with test objects

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
Catch up to latest changes on cleanup-3.2.x in order to avoid conflicts
when adding additional commits fixing compiler warnings.
The files deleted in this commit existed in identical form in two places
within a given module; typically in src/test/java and
src/test/resources. The version within src/test/resources has been
favored in all cases.

This change was prompted by associated Eclipse warnings, which have now
been quelled.

Issue: SPR-9431
 - Suppress an (intentional) AspectJ warning
 - Remove unused imports
 - Suppress a [hiding] warning
 - Fix a generics warning related to extension of final types

Issue: SPR-9431
Prior to this change, spring-beans contained its own META-INF containing
spring.handlers and spring.schemas files in src/main/resources; it also
had files of the same name within src/test/resources/META-INF, causing
'duplicate resource' warnings and confusion in general.

This commit moves the com.foo test package, it's associated namespace
parsing tests and test versions of META-INF files to the root project
and it's src/test integration testing folder.

Issue: SPR-9431
Prior to this commit, ClassWithAsyncAnnotation#return5 forced an
unsuppressable warning in Eclipse, making it virtually impossible to
get to a zero-warnings state in the codebase.

The 'solution' here is simply to comment out the method and it's
associated test case. The 'declare warnings' functionality around
@async is well-understood and has long been stable.

Also, the entire AnnotationAsyncExecutionAspectTests class has been
added to TestGroup#PERFORMANCE (SPR-9984), as opposed to just
asyncMethodGetsRoutedAsynchronously as it was previously, the
rationale being that all tests are actually timing dependent.

Issue: SPR-9431, SPR-9984
* SPR-9431:
  Eliminate AJ @async warning in test case
  Update Apache license headers for moved files
  Move namespace tests to root integration module
  Fix several miscellaneous compiler/Eclipse warnings
  Remove duplicate test resources
  Fix warnings due to unused import statements
* cleanup-3.2.x:
  Eliminate AJ @async warning in test case
  Update Apache license headers for moved files
  Move namespace tests to root integration module
  Fix several miscellaneous compiler/Eclipse warnings
  Remove duplicate test resources
  Fix warnings due to unused import statements
  Update Apache license headers for affected sources
  Remove duplicate test classes
  Replace test beans with test objects
  Polish test sourceSet dependencies
  Add test dependencies sources for testCompile
* cleanup-3.2.x: (37 commits)
  Eliminate AJ @async warning in test case
  Update Apache license headers for moved files
  Move namespace tests to root integration module
  Fix several miscellaneous compiler/Eclipse warnings
  Remove duplicate test resources
  Fix warnings due to unused import statements
  Update Apache license headers for affected sources
  Remove duplicate test classes
  Replace test beans with test objects
  Polish test sourceSet dependencies
  Add test dependencies sources for testCompile
  Use unmodified 'version' when not on a topic branch
  Enable execution of TestNG tests in spring-test
  Polish support for topic branch-specific versions
  Segregate add'l long-running and performance tests
  Eliminate EBR dependencies and repository config
  Skip creation of IDEA metadata for spring-aspects
  Fix Eclipse compilation error in Gradle plugin
  Polish build.gradle
  Recursively add test dependencies
  ...
This patch marks remaining/missed tests as ones belonging to
performance tests group.

Issue: SPR-9984
# By Stevo Slavic
* sslavic/SPR-9984:
  Mark all IsFastEnough tests as performance tests
* SPR-9984:
  Mark all IsFastEnough tests as performance tests
Split packages are a well-known anti-pattern for OSGi and a blocker for
Eclipse Virgo (which prevents split packages being accessed via its
Import-Library construct).

Split packages are also unhelpful with a traditional linear classpath
as a split package name does not uniquely identify the Spring framework
JAR from which it came, thus complicating problem diagnosis and
maintenance.

Juergen Hoeller supports this position in the following comment in
SPR-9990:

>FWIW, I generally find split packages a bad practice, even without
>OSGi in the mix. For the Spring Framework codebase, I consider a
>split-package arrangement a design accident that we want to detect
>in any case - and that we're willing to fix if it happened.
>
>I'm actually equally concerned about the source perspective: After
>all, we want a package to be comprehensible from a single glance
>at the project, not requiring the developer to jump into several
>source modules to understand the overall layout of a package.

Split packages have crept into Spring framework twice in recent months
- see SPR-9811 and SPR-9988. Currently, they are only detected once
the Spring framework has been converted to OSGi bundles and these
bundles have been tested with Eclipse Virgo.

This commit adds a build-time check for split packages to the Spring
framework build.

Issue: SPR-9990

Conflicts:

	build.gradle
Allow packages to be split across projects which will be merged into a
single JAR file.

Make split package detection a dependency of the 'check' task. This
is idiomatic gradle as well as allowing the 'test' task (another
dependency of 'check') to be executed without split packages being
detected.

Omit the project spring-instructment-tomcat from the check on the basis
of SPR-10150.

Issues: SPR-9990, SPR-10150

Conflicts:

	build.gradle
Update the gradle 'api' task to depend on the 'jar' task of all
subprojects. This intern ensures that the 'asmRepackJar' and
'cglibRepackJar' tasks run which is critical for JavaDoc
generation.
ServletUriComponentsBuilder now supports setting the host to the
value held in the X-Forwarded-Host [0] header used in reverse
proxy scenarios.

[0] http://tools.ietf.org/html/draft-ietf-appsawg-http-forwarded-10

Issue: SPR-10110
* cleanup-3.2.x:
  Gradle 'api' task depends on 'jar' tasks
  Mark all IsFastEnough tests as performance tests
@RequestMapping annotations now support ${...} placeholders.

Issue: SPR-9935
jhoeller and others added 25 commits January 23, 2013 01:32
Update DefaultListableBeanFactory.getBean(Class<?> beanClass) to
consider the 'primary' attribute of bean definitions. This makes
getBean() behave in the same way as autowiring.

Issue: SPR-7854
- fix @SInCE version in array()
- format method-level Javadoc
- unescape HTML-escaped angle brackets with {@code} blocks
- Corrected path to 'docs/spring-framework-reference'
- Minor formatting changes
Allow an embedded value resolver added to an AbstractBeanFactory to
return null without adversely effecting any subsequent resolvers.

Issue: SPR-8565
…tom ThreadPoolExecutor subclasses

Issue: SPR-9435
…(for EHCache CacheManager setup)

 Issue: SPR-9713
… with a specific encoding

Also added constructor with Charset argument to EncodedResource.

Issue: SPR-10096
Change 'compile' dependencies to 'provided' for projects that are
merged into other projects. This seems to prevent '-sources' and
'-javadoc' jars from appearing on the classpath which can break
javadoc generation.
…operties across all variants

Issue: SPR-9078
* SPR-9970:
  Avoid UnsupportedOperationEx. with active SecurityManager
Issue: SPR-7827

prior this commit, there was no support for meta-annotations in the Spring Intergation tests, now the @ContextConfiguration annotation is searched also in meta-annotations.

Eg: you can write:
---------------
@ContextConfiguration([...]) // config for HSQLDB environment
public @interface InRamEnvironment
---------------
@ContextConfiguration([...]) // config for common-core part
public @interface CommonCoreIntegrationTest
---------------
@CommonCoreIntegrationTest
@InRamEnvironment
public class OneBatchTest {

[...] // actual test methods
@giovannidalloglio
Copy link
Contributor Author

I fixed the problems, and rebased, but there are too much commits, I'm closing this pull request, and open a fresh new one.

@cbeams
Copy link
Contributor

cbeams commented Jan 24, 2013

new PR: #219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.