|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectissues.Sjc91Tests
public class Sjc91Tests
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
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 |
---|
public Sjc91Tests()
Method Detail |
---|
public void setUp()
public void completeBeanInjectionShouldNotThrow()
public void incompleteBeanInjectionShouldThrow()
public void checkRequiredExplicitlyFalse()
public void checkRequiredDefault()
public void checkRequiredWithNoConfigurationAnnotation()
public void multipleBeansOfSameType()
public void subsequentApplicationContextsShouldNotConflict()
multipleBeansOfSameType()
test.
public void enablingCheckRequiredWithoutAspectJWeavingShouldThrowHelpfulException()
public void compareRequiredAnnotationExceptionMessages()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |