Sam Brannen

Upgrade mockito-core dependency to 1.10.19

Upgrade netty-all dependency to 4.0.27.Final

Add netty-all test dependency to spring-websocket

This commit fixes recent build failures involving

MessageBrokerBeanDefinitionParserTests and NoClassDefFoundError:

io/netty/channel/nio/NioEventLoopGroup.

Document & test status quo for getMetaAnnotationTypes()

This commit documents the status quo for the getMetaAnnotationTypes()

method in AnnotatedElementUtils and adds appropriate regression tests to

AnnotatedElementUtilsTests.

In addition, this commit also introduces a SimpleAnnotationProcessor

base class in AnnotatedElementUtils.

Issue: SPR-11514

Document return values in AnnotatedElementUtils

This commit documents return values throughout AnnotatedElementUtils and

improves the documentation for the internal Processor API.

Issue: SPR-11514

Fail if multiple @BootstrapWith's are present

Prior to this commit it was possible for two @BootstrapWith annotations

to be 'present' on a test class – for example, via competing custom

composed annotations. However, only one of the annotations will ever be

used to bootstrap the TestContext Framework. Thus, in such scenarios

one of the annotations will be silently ignored.

This commit introduces a check for such scenarios. BootstrapUtils'

resolveTestContextBootstrapper() method now throws an

IllegalStateException if more than one @BootstrapWith annotation is

'present' on a given test class.

Issue: SPR-12602

Update TODOs in AnnotatedElementUtils[Tests]

Issue: SPR-12738

Document AnnotatedElementUtils & assert preconditions

This commit consistently documents the 'element' and 'annotationType'

method arguments throughout AnnotatedElementUtils.

In addition, this commit introduces assertions against preconditions

for all 'element' and 'annotationType' method arguments.

Issue: SPR-11514

Eclipse project deps come after third-party libs

This commit is a backport of SPR-11836.

Prior to this commit, the ordering of classpath entries in the

generated Eclipse .classpath files did not align with the intended

dependency management configured in the Gradle build. Specifically,

project dependencies often came before dependencies on third-party

libraries required for the given project, causing the project not to

compile in Eclipse.

This commit fixes this issue by introducing new functionality in the

ide.gradle script that moves all project dependencies to the end of the

generated classpath.

Issue: SPR-12947, SPR-11836

Eclipse project deps come after third-party libs

This commit is a backport of SPR-11836.

Prior to this commit, the ordering of classpath entries in the

generated Eclipse .classpath files did not align with the intended

dependency management configured in the Gradle build. Specifically,

project dependencies often came before dependencies on third-party

libraries required for the given project, causing the project not to

compile in Eclipse.

This commit fixes this issue by introducing new functionality in the

ide.gradle script that moves all project dependencies to the end of the

generated classpath.

Issue: SPR-12947, SPR-11836

Polish Javadoc for condition annotation attributes

Support abstract, bridge, & interface methods in AnnotatedElementUtils

This commit introduces support for finding annotations on abstract,

bridge, and interface methods in AnnotatedElementUtils.

  • Introduced dedicated findAnnotationAttributes() methods in

    AnnotatedElementUtils that provide first-class support for

    processing methods, class hierarchies, interfaces, bridge methods,

    etc.

  • Introduced find/get search algorithm dichotomy in

    AnnotatedElementUtils which is visible in the public API as well as

    in the internal implementation. This was necessary in order to

    maintain backwards compatibility with the existing API (even though

    it was undocumented).

  • Reverted all recent changes made to the "get semantics" search

    algorithm in AnnotatedElementUtils in order to ensure backwards

    compatibility, and reverted recent changes to

    JtaTransactionAnnotationParser and SpringTransactionAnnotationParser

    accordingly.

  • Documented internal AnnotatedElementUtils.Processor<T> interface.

  • Enabled failing tests and introduced

    findAnnotationAttributesFromBridgeMethod() test in

    AnnotatedElementUtilsTests.

  • Refactored ApplicationListenerMethodAdapter.getCondition() and

    enabled failing test in TransactionalEventListenerTests.

  • AnnotationUtils.isInterfaceWithAnnotatedMethods() is now package

    private.

Issue: SPR-12738, SPR-11514, SPR-11598

Revert unintentional change in AnnotationUtils

Polish inline documentation in AnnotatedElementUtils

Favor local, composed annotations in the TCF

Prior to this commit, AnnotationAttributes retrieved from

MetaAnnotationUtils's AnnotationDescriptor could contain attributes

from the wrong annotation if an inherited annotation shadowed a locally

declared composed annotation.

This commit addresses this issue by invoking the new

getAnnotationAttributes() method in AnnotatedElementUtils that provides

a flag to control whether superclasses should be searched – which

coincidentally processes local annotations before searching the class

hierarchy.

Issue: SPR-12749, SPR-11598

Polish Javadoc for AnnotationUtils

Polish Javadoc & TODOs in ApplicationListenerMethodAdapter

Issue: SPR-12738

Introduce failing/ignored tests for SPR-12738

Issue: SPR-12738

Support annotations on interfaces in AnnotatedElementUtils

This commit introduces support in AnnotatedElementUtils for finding

annotations declared on interfaces at the type level.

NB: this commit does not include support for finding annotations

declared on interface methods.

In order to maintain backward compatibility with @Transactional

annotation attribute processing, a new getAnnotationAttributes() method

has been added to AnnotatedElementUtils that provides a flag to control

whether interfaces should be searched.

SpringTransactionAnnotationParser and JtaTransactionAnnotationParser

have been updated accordingly to ensure that interfaces are not

unintentionally searched in the @Transactional resolution process.

This commit also introduces additional tests and updates TODOs for

SPR-12738.

Issue: SPR-12944, SPR-12738

Assert status quo for interface support in AnnotationUtils

Polish ApplicationListenerMethodAdapter

Support n meta-annotation levels on methods in AnnotationUtils

Prior to this commit, the search algorithm used by the

findAnnotation(Method, Class) method in AnnotationUtils only found

direct annotations or direct meta-annotations (i.e., one level of

meta-annotations).

This commit reworks the search algorithm so that it supports arbitrary

levels of meta-annotations on methods. To make this possible, a new

findAnnotation(AnnotatedElement, Class) method has been introduced in

AnnotationUtils.

This fix also allows for the @Ignore'd tests in

TransactionalEventListenerTests to be re-enabled.

Issue: SPR-12941

Fix broken test in AnnotationUtilsTests

Document meta-annotation support in AnnotationUtils

Issue: SPR-12940

Reorganize tests in AnnotationUtilsTests for greater clarity

Fix typo in exception message

Introduce dedicated 'cache' subpackage in the TCF

Since the ContextCache is now a published SPI, it and its collaborators

have been moved to a dedicated 'org.sfw.test.context.cache' subpackage.

Issue: SPR-12683

  1. … 7 more files in changeset.

Polish Javadoc for ContextCache

Ensure that contexts loaded by the TCF are active

This commit adds an assertion to DefaultTestContext's

getApplicationContext() method to ensure that a context loaded by the

Spring TestContext Framework (TCF) or retrieved from the ContextCache

is still active. This extra check helps to avoid situations where

developers manually close a cached context instead of relying on the

@DirtiesContext support.

Issue: SPR-12932

Use ConcurrentHashMaps in DefaultContextCache

The changes made in 0cb22fc8f34a29c42313056671a947444b60050b would

result in contexts not being properly closed if evicted from the

ConcurrentReferenceHashMap by the Garbage Collector.

This commit reverts those changes and returns to using standard

ConcurrentHashMaps for the time being.

Issue: SPR-7687