issues
Class Sjc91Tests

java.lang.Object
  extended by issues.Sjc91Tests

public class Sjc91Tests
extends Object

SJC-91 deals with a compatibility issue between JavaConfig and Spring Core - checking @Required annotations. This is difficult to do in JavaConfig because the user has programmatic control over the objects during dependency injection time. The only way to track whether Required methods have been invoked is to do bytecode weaving, and so this has been done using AspectJ

See Also:
IMPORTANT: Some tests herein will fail if aspect weaving has not been performed. If failures are occuring in your IDE, you should turn on load time weaving with VM args: -javaagent:/path/to/.m2/repository/aspectj/aspectjweaver/1.5.3/aspectjweaver-1.5.3.jar -Daj.weaving.verbose=true If, on the other hand, failures occur via the maven build (which should always be doing build-time weaving), something more serious is going on. Either the aspectj-maven-plugin has gotten misconfigured or something is actually broken with processing Required annotations.

Constructor Summary
Sjc91Tests()
           
 
Method Summary
 void checkRequiredDefault()
           
 void checkRequiredExplicitlyFalse()
           
 void checkRequiredWithNoConfigurationAnnotation()
           
 void compareRequiredAnnotationExceptionMessages()
          JavaConfig and Spring Core should throw the same exception and message when detecting uncalled Required methods.
 void completeBeanInjectionShouldNotThrow()
           
 void enablingCheckRequiredWithoutAspectJWeavingShouldThrowHelpfulException()
           
 void incompleteBeanInjectionShouldThrow()
           
 void multipleBeansOfSameType()
          The process for tracking whether required methods have been set on a given bean must be fine-grained enough to differentiate between different object instances
 void setUp()
           
 void subsequentApplicationContextsShouldNotConflict()
          Create two application contexts, where the first initializes a bean of type Alice successfully (sets all required methods) and follow this up with a second context that misconfigures an Alice bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sjc91Tests

public Sjc91Tests()
Method Detail

setUp

public void setUp()

completeBeanInjectionShouldNotThrow

public void completeBeanInjectionShouldNotThrow()

incompleteBeanInjectionShouldThrow

public void incompleteBeanInjectionShouldThrow()

checkRequiredExplicitlyFalse

public void checkRequiredExplicitlyFalse()

checkRequiredDefault

public void checkRequiredDefault()

checkRequiredWithNoConfigurationAnnotation

public void checkRequiredWithNoConfigurationAnnotation()

multipleBeansOfSameType

public void multipleBeansOfSameType()
The process for tracking whether required methods have been set on a given bean must be fine-grained enough to differentiate between different object instances


subsequentApplicationContextsShouldNotConflict

public void subsequentApplicationContextsShouldNotConflict()
Create two application contexts, where the first initializes a bean of type Alice successfully (sets all required methods) and follow this up with a second context that misconfigures an Alice bean. Expect an exception from the second. This test proves that the registry tracking mechanism is fine-grained enough to know the difference between different object instances. It is similar to the multipleBeansOfSameType() test.


enablingCheckRequiredWithoutAspectJWeavingShouldThrowHelpfulException

public void enablingCheckRequiredWithoutAspectJWeavingShouldThrowHelpfulException()

compareRequiredAnnotationExceptionMessages

public void compareRequiredAnnotationExceptionMessages()
JavaConfig and Spring Core should throw the same exception and message when detecting uncalled Required methods.



Copyright ? 2005-2008 Spring Framework. All Rights Reserved.