Permalink
Switch branches/tags
Commits on Oct 28, 2013
  1. Renamed @webtests to @webtest

    sbrannen committed Oct 28, 2013
    @webtests has been renamed to @webtest so that the Gradle build does not
    attempt to run it as a JUnit test.
  2. Merge pull request spring-projects#393 from sbrannen/SPR-7827

    sbrannen committed Oct 28, 2013
    * SPR-7827:
      Provide meta-annotation support in the TCF
  3. Provide meta-annotation support in the TCF

    sbrannen committed Jul 2, 2013
    Spring 3.0 already allows component stereotypes to be used in a
    meta-annotation fashion, for example by creating a custom
    @TransactionalService stereotype annotation which combines
    @transactional and @service in a single, reusable, application-specific
    annotation. However, the Spring TestContext Framework (TCF) currently
    does not provide any support for test-related annotations to be used as
    meta-annotations.
    
    This commit overhauls the TCF with regard to how annotations are
    retrieved and adds explicit support for the following annotations to be
    used as meta-annotations in conjunction with the TCF.
    
    - @ContextConfiguration
    - @ContextHierarchy
    - @ActiveProfiles
    - @DirtiesContext
    - @IfProfileValue
    - @ProfileValueSourceConfiguration
    - @BeforeTransaction
    - @AfterTransaction
    - @TransactionConfiguration
    - @Rollback
    - @TestExecutionListeners
    - @repeat
    - @timed
    - @WebAppConfiguration
    
    Note that meta-annotation support for @transactional was already
    available prior to this commit.
    
    The following is a summary of the major changes included in this commit.
    
    - Now using AnnotationUtils.getAnnotation() instead of
      Class.getAnnotation() where appropriate in the TestContext Framework.
    - Now using AnnotationUtils.findAnnotation() instead of
      Class.isAnnotationPresent() where appropriate in the TestContext
      Framework.
    - Introduced findAnnotationPrefersInteracesOverLocalMetaAnnotations() in
      AnnotationUtilsTests in order to verify the status quo.
    - AnnotationUtils.findAnnotationDeclaringClass() and
      AnnotationUtils.findAnnotationDeclaringClassForTypes() now support
      meta annotations.
    - Introduced MetaAnnotationUtils and AnnotationDescriptor in the
      spring-test module.
    - Introduced UntypedAnnotationDescriptor in MetaAnnotationUtils.
    - Introduced findAnnotationDescriptorForTypes() in MetaAnnotationUtils.
    - ContextLoaderUtils now uses MetaAnnotationUtils for looking up
      @ActiveProfiles as a potential meta-annotation.
    - TestContextManager now uses MetaAnnotationUtils for looking up
      @TestExecutionListeners as a potential meta-annotation.
    - DirtiesContextTestExecutionListener now uses AnnotationUtils for
      looking up @DirtiesContext as a potential meta-annotation.
    - Introduced DirtiesContextTestExecutionListenerTests.
    - ProfileValueUtils now uses AnnotationUtils for looking up
      @IfProfileValue and @ProfileValueSourceConfiguration as potential
      meta-annotations.
    - @BeforeTransaction and @AfterTransaction now support ANNOTATION_TYPE
      as a target, allowing them to be used as meta-annotations.
    - TransactionalTestExecutionListener now uses AnnotationUtils for
      looking up @BeforeTransaction, @AfterTransaction, @Rollback, and
      @TransactionConfiguration as potential meta-annotations.
    - Introduced TransactionalTestExecutionListenerTests.
    - @repeat and @timed now support ANNOTATION_TYPE as a target, allowing
      them to be used as meta-annotations.
    - SpringJUnit4ClassRunner now uses AnnotationUtils for looking up
      @repeat and @timed as potential meta-annotations.
    - Moved all remaining logic for building the MergedContextConfiguration
      from the DefaultTestContext constructor to
      ContextLoaderUtils.buildMergedContextConfiguration().
    - Verified meta-annotation support for @WebAppConfiguration and
      @ContextConfiguration.
    
    Issue: SPR-7827
Commits on Oct 27, 2013
  1. Aligned with refinements in 3.2.x branch

    jhoeller authored and unknown committed Oct 27, 2013
    Issue: SPR-11034
  2. Polishing

    jhoeller committed Oct 27, 2013
  3. Fixed resolveReturnTypeForFactoryMethod to unwrap TypedStringValue

    jhoeller committed Oct 27, 2013
    XML-defined arguments values are initially turned into TypedStringValue wrappers. If we encounter an unresolved argument, we need to unwrap such a TypedStringValue and then try to treat its content as a class name.
    
    Issue: SPR-11034
  4. Added further tests for raw matching of generic types

    jhoeller committed Oct 27, 2013
    Issue: SPR-11034
    Issue: SPR-11004
Commits on Oct 26, 2013
  1. Polishing

    jhoeller committed Oct 26, 2013
  2. Proper matching of raw generic types and generically typed factory me…

    jhoeller committed Oct 26, 2013
    …thods
    
    Also optimized getTypeForFactoryMethod's implementation for non-generic factory methods, and reduced calls to getResolvedFactoryMethod in order to avoid repeated synchronization.
    
    Issue: SPR-11034
  3. Convert TestContext to interface & default impl

    sbrannen committed Oct 26, 2013
    Since the Spring TestContext Framework was introduced in Spring
    Framework 2.5, the TestContext class has always been a public class
    with package private constructors. The visibility of TestContext's
    constructor and methods was intentionally limited in order to hide the
    implementation details of the context cache, etc. However, this fact
    has made it difficult (if not impossible) to unit test custom
    TestExecutionListener implementations.
    
    This commit addresses this issue by converting TestContext into a
    public interface with a package private DefaultTestContext
    implementation. This enables unit testing of any components that depend
    on a TestContext (e.g., TestExecutionListeners) while at the same time
    preserving the encapsulation of the inner workings of the TestContext
    implementation with regard to context loading and caching.
    
    Issue: SPR-7692
  4. Increased ResolvableType unit test coverage

    Phillip Webb
    Phillip Webb committed Oct 26, 2013
    Issue: SPR-11034
  5. Avoid NPE in hasUnresolvableGenerics()

    jhoeller committed Oct 26, 2013
    Issue: SPR-11034
  6. Polishing

    jhoeller committed Oct 26, 2013
    (cherry picked from commit 6021822)
  7. Fixed detection of setter in case of getter with covariant return typ…

    jhoeller committed Oct 26, 2013
    …e narrowing
    
    Issue: SPR-10995
    (cherry picked from commit 045f78e)
  8. Polishing

    jhoeller committed Oct 26, 2013
  9. Factory method type resolution works with indexed and named arguments…

    jhoeller committed Oct 26, 2013
    … as well
    
    Issue: SPR-11019
  10. Update MvcUriComponentsBuilder to use DispServlet WAC

    rstoyanchev committed Oct 26, 2013
    Issue: SPR-8826
  11. Replace MvcUrls with MvcUriComponentsBuilder

    rstoyanchev committed Oct 26, 2013
    Issue: SPR-8826
  12. Fix off-by-one error in parseLocaleString

    Phillip Webb
    Phillip Webb committed Oct 26, 2013
    Fix off-by-one error in StringUtils.parseLocaleString()
    
    Issue: SPR-10364
  13. Add getSource() to ResolvableType & TypeDescriptor

    Phillip Webb
    Phillip Webb committed Oct 23, 2013
    Add getSource() method to ResolvableType and TypeDescriptor allowing
    access to the underlying source field or method parameter when possible.
    
    Primarily added to provide access to additional type information or
    meta-data that alternative JVM languages may provide.
    
    Issue: SPR-10887
  14. Make EvaluationException more informative

    Phillip Webb
    Phillip Webb committed Oct 26, 2013
    Update EvaluationException to expose the toDetailedString() method as
    the exception message. The simple message can now be accessed via the
    new getSimpleMessage() method.
    
    Issue: SPR-10938
  15. Restore prior resolveTypeArguments behavior

    Phillip Webb
    Phillip Webb committed Oct 26, 2013
    Restore prior behavior of GenericTypeResolver.resolveTypeArguments to
    never include null elements in the returned array.
    
    Issue: SPR-11030
  16. Cache InjectionMetadata per bean name instead of per Class

    jhoeller authored and unknown committed Oct 26, 2013
    Issue: SPR-11027
  17. Changed spring-beans-groovy's Groovy dependency to optional

    jhoeller authored and unknown committed Oct 26, 2013
    Issue: SPR-11028
  18. Polishing

    jhoeller authored and unknown committed Oct 25, 2013
  19. Introduced ScriptEvaluator strategy interface

    jhoeller authored and unknown committed Oct 25, 2013
    Including ScriptEvaluator implementations for JSR-223, Groovy and BeanShell. BeanShell consistently receives the bean ClassLoader now. Also revised ScriptFactory and its implementations for varargs.
    
    Issue: SPR-11007
Commits on Oct 25, 2013
  1. Polish

    Phillip Webb
    Phillip Webb committed Oct 25, 2013
  2. ExpressionState.getConfiguration() should never return null

    jhoeller committed Oct 25, 2013
    Issue: SPR-11031
  3. Accept non-generic type match as a fallback

    jhoeller committed Oct 25, 2013
    DefaultListableBeanFactory performs a fallback check for autowire candidates now, which GenericTypeAwareAutowireCandidateResolver implements to accept raw type matches if the target class has unresolvable type variables. Full generic matches are still preferred; the BeanFactory will only start looking for fallback matches if the first pass led to an empty result.
    
    Issue: SPR-10993
    Issue: SPR-11004