While researching how and what to document for AJJ option '-xmlConfigured', I needed to find out what happens in case of multiple XML config files. Result: They are merged. the new test case for the old 1.6.4 release verifies and documents that. It can also serve as an example for reference in case of user questions. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>tags/V1_9_21_2
aspect A3 { | |||||
before():staticinitialization(*) {} | |||||
} |
<aspectj> | |||||
<aspects> | |||||
<aspect name="A" scope="B"/> | |||||
</aspects> | |||||
<weaver> | |||||
<!-- Do not apply on any aspects --> | |||||
<exclude within="A*"/> | |||||
</weaver> | |||||
</aspectj> |
<aspectj> | |||||
<aspects> | |||||
<aspect name="A2" scope="B2"/> | |||||
</aspects> | |||||
</aspectj> |
<aspectj> | |||||
<aspects> | |||||
<aspect name="A3"/> | |||||
</aspects> | |||||
</aspectj> |
runTest("aop config - 5"); | runTest("aop config - 5"); | ||||
} | } | ||||
/** | |||||
* If multiple XML files are given together with {@code -xmlConfigured}, they will be logically merged into one. | |||||
* I.e., given the following three XML config files: | |||||
* | |||||
* <pre>{@code | |||||
* <aspectj> | |||||
* <aspects> | |||||
* <aspect name="A" scope="B"/> | |||||
* </aspects> | |||||
* <weaver> | |||||
* <exclude within="A*"/> | |||||
* </weaver> | |||||
* </aspectj> | |||||
* }</pre> | |||||
* | |||||
* <pre>{@code | |||||
* <aspectj> | |||||
* <aspects> | |||||
* <aspect name="A2" scope="B2"/> | |||||
* </aspects> | |||||
* </aspectj> | |||||
* }</pre> | |||||
* | |||||
* <pre>{@code | |||||
* <aspectj> | |||||
* <aspects> | |||||
* <aspect name="A3"/> | |||||
* </aspects> | |||||
* </aspectj> | |||||
* }</pre> | |||||
* | |||||
* The result will be as if only one XML config file with this content was specified: | |||||
* | |||||
* <pre>{@code | |||||
* <aspectj> | |||||
* <aspects> | |||||
* <aspect name="A" scope="B"/> | |||||
* <aspect name="A2" scope="B2"/> | |||||
* <aspect name="A3"/> | |||||
* </aspects> | |||||
* <weaver> | |||||
* <exclude within="A*"/> | |||||
* </weaver> | |||||
* </aspectj> | |||||
* }</pre> | |||||
*/ | |||||
public void testMultipleXMLFiles() { | |||||
runTest("aop config - multiple XML files"); | |||||
} | |||||
public void testAjcThisNotRead() { | public void testAjcThisNotRead() { | ||||
runTest("ajcthis not read"); | runTest("ajcthis not read"); | ||||
} | } |
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features164/aopconfig/one" title="aop config - multiple XML files"> | |||||
<!-- Java, AspectJ and XML files can be specified in any order. See how they are mixed here. --> | |||||
<compile files="A.java A2.java A3.java multi1.xml multi2.xml B.java B2.java multi3.xml" options="-1.5 -showWeaveInfo -xmlConfigured"> | |||||
<message kind="weave" text="Join point 'staticinitialization(void B.<clinit>())' in Type 'B' (B.java:1) advised by before advice from 'A3' (A3.java:2)"/> | |||||
<message kind="weave" text="Join point 'staticinitialization(void B.<clinit>())' in Type 'B' (B.java:1) advised by before advice from 'A' (A.java:2)"/> | |||||
<message kind="weave" text="Join point 'staticinitialization(void B2.<clinit>())' in Type 'B2' (B2.java:1) advised by before advice from 'A3' (A3.java:2)"/> | |||||
<message kind="weave" text="Join point 'staticinitialization(void B2.<clinit>())' in Type 'B2' (B2.java:1) advised by before advice from 'A2' (A2.java:2)"/> | |||||
</compile> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs164/pr263310" title="inner handles"> | <ajc-test dir="bugs164/pr263310" title="inner handles"> | ||||
<compile files="HandleTestingAspect.java" options="-1.5 -emacssym -Xlint:ignore"/> | <compile files="HandleTestingAspect.java" options="-1.5 -emacssym -Xlint:ignore"/> | ||||
</ajc-test> | </ajc-test> |