123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <!-- Load-time weaving tests -->
-
- <ajc-test dir="ltw"
- title="Ensure 1st aspect is rewoven when weaving 2nd aspect"
- keywords="reweavable">
- <compile
- files="Main.java, Aspect1.aj"
- outjar="main1.jar"
- options="-showWeaveInfo"
- >
- <message kind="weave" text="method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)"/>
- </compile>
- <compile
- classpath="main1.jar"
- files="Aspect2.aj"
- outjar="aspect2.jar"
- options="-showWeaveInfo"
- >
- </compile>
- <run class="Main" ltw="aop-ltwreweavable.xml">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="weaveinfo Join point 'method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)"/>
- <line text="weaveinfo Join point 'method-execution(void Main.test2())' in Type 'Main' (Main.java:21) advised by before advice from 'Aspect2' (Aspect2.aj:16)"/>
- <line text="Aspect1.before_test1"/>
- <line text="Aspect2.before_test2"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="ltw"
- title="Ensure valid aop.xml file is generated"
- keywords="-outxml">
- <compile
- files="Main.java"
- outjar="main.jar"
- >
- </compile>
- <compile
- classpath="main.jar"
- files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
- outxmlfile="META-INF/aop.xml"
- >
- </compile>
- <run class="Main" ltw="">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="Aspect1.before_test1"/>
- <line text="Aspect2.before_test2"/>
- <line text="pakkage.Aspect3.before_test2"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="ltw"
- title="Ensure valid aop.xml is generated for -outjar"
- keywords="-outxml">
- <compile
- files="Main.java"
- outjar="main.jar"
- >
- </compile>
- <compile
- classpath="main.jar"
- files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
- outjar="aspects.jar"
- options="-outxml"
- >
- </compile>
- <run class="Main" ltw="">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="Aspect1.before_test1"/>
- <line text="Aspect2.before_test2"/>
- <line text="pakkage.Aspect3.before_test2"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="ltw"
- title="Ensure no weaving without visible aop.xml"
- keywords="reweavable">
- <compile
- files="TestMain.java, Main.java"
- >
- </compile>
- <run class="TestMain" ltw="">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="info register classloader org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
- <line text="info no configuration found. Disabling weaver for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
- </stderr>
- </run>
- </ajc-test>
-
-
- <ajc-test dir="ltw"
- title="Define concrete sub-aspect using aop.xml"
- keywords="aop.xml">
- <compile
- files="Main.java"
- outjar="main.jar"
- >
- </compile>
- <compile
- classpath="main1.jar"
- files="AbstractSuperAspect.aj"
- outjar="aspect.jar"
- >
- </compile>
- <run class="Main" ltw="aop-defineaspect.xml">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="AbstractSuperAspect.before_test1"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="ltw"
- title="Use abstract aspect for ITD using aop.xml"
- keywords="abstract aspect, ITD">
- <compile
- files="TestITDMethod.java"
- >
- </compile>
- <compile
- files="AbstractAspect.aj"
- >
- <message kind="warning" text="this affected type is not exposed to the weaver: TestITDMethod"/>
- </compile>
- <run class="TestITDMethod" options="test" ltw="aop-abstractaspect.xml">
- <stdout>
- <line text="TestITDMethod.main"/>
- </stdout>
- <stderr>
- <line text="weaveinfo Type 'TestITDMethod' (TestITDMethod.java) has intertyped method from 'AbstractAspect' (AbstractAspect.aj:'void TestITDMethod.test()')"/>
- <line text="AbstractAspect_TestITDMethod.test"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="ltw"
- title="Ensure a subset of inherited aspects is used for weaving"
- keywords="aspects, include">
- <compile
- files="Main.java"
- outjar="main.jar"
- >
- </compile>
- <compile
- classpath="main.jar"
- files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
- outjar="aspects.jar"
- options="-outxml"
- >
- </compile>
- <run class="Main" ltw="aop-aspectsinclude.xml">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="pakkage.Aspect3.before_test2"/>
- </stderr>
- </run>
- </ajc-test>
-
- <ajc-test dir="ltw"
- title="Ensure weaver lint warning issued when an aspect is not used for weaving"
- keywords="aspects, include, lint">
- <compile
- files="Main.java"
- outjar="main.jar"
- >
- </compile>
- <compile
- classpath="main.jar"
- files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
- outjar="aspects.jar"
- options="-outxml"
- >
- </compile>
- <run class="Main" ltw="aop-aspectsincludewithlintwarning.xml">
- <stdout>
- <line text="Main.main"/>
- <line text="Main.test1"/>
- <line text="Main.test2"/>
- </stdout>
- <stderr>
- <line text="warning aspect Aspect1 exluded for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader [Xlint:aspectExcludedByConfiguration]"/>
- <line text="warning aspect Aspect2 exluded for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader [Xlint:aspectExcludedByConfiguration]"/>
- <line text="pakkage.Aspect3.before_test2"/>
- </stderr>
- </run>
- </ajc-test>
-
|