From fac5d8cb222719cddfc169d5285d918557b786c5 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 21 Feb 2024 10:35:44 +0700 Subject: Add Ajc164Tests::testMultipleXMLFiles 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 --- tests/features164/aopconfig/one/A3.java | 3 ++ tests/features164/aopconfig/one/multi1.xml | 9 ++++ tests/features164/aopconfig/one/multi2.xml | 5 +++ tests/features164/aopconfig/one/multi3.xml | 5 +++ .../org/aspectj/systemtest/ajc164/Ajc164Tests.java | 50 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc164/ajc164.xml | 10 +++++ 6 files changed, 82 insertions(+) create mode 100644 tests/features164/aopconfig/one/A3.java create mode 100644 tests/features164/aopconfig/one/multi1.xml create mode 100644 tests/features164/aopconfig/one/multi2.xml create mode 100644 tests/features164/aopconfig/one/multi3.xml (limited to 'tests') diff --git a/tests/features164/aopconfig/one/A3.java b/tests/features164/aopconfig/one/A3.java new file mode 100644 index 000000000..9339f2044 --- /dev/null +++ b/tests/features164/aopconfig/one/A3.java @@ -0,0 +1,3 @@ +aspect A3 { + before():staticinitialization(*) {} +} diff --git a/tests/features164/aopconfig/one/multi1.xml b/tests/features164/aopconfig/one/multi1.xml new file mode 100644 index 000000000..0aeec1b08 --- /dev/null +++ b/tests/features164/aopconfig/one/multi1.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/features164/aopconfig/one/multi2.xml b/tests/features164/aopconfig/one/multi2.xml new file mode 100644 index 000000000..9c2c39ce3 --- /dev/null +++ b/tests/features164/aopconfig/one/multi2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/features164/aopconfig/one/multi3.xml b/tests/features164/aopconfig/one/multi3.xml new file mode 100644 index 000000000..18c1513fc --- /dev/null +++ b/tests/features164/aopconfig/one/multi3.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java index 04b4b15d3..d9cbd381c 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc164/Ajc164Tests.java @@ -221,6 +221,56 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { 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: + * + *
{@code
+	 * 
+	 *   
+	 *     
+	 *   
+	 *   
+	 *     
+	 *   
+	 * 
+	 * }
+ * + *
{@code
+	 * 
+	 *   
+	 *     
+	 *   
+	 * 
+	 * }
+ * + *
{@code
+	 * 
+	 *   
+	 *     
+	 *   
+	 * 
+	 * }
+ * + * The result will be as if only one XML config file with this content was specified: + * + *
{@code
+	 * 
+	 *   
+	 *     
+	 *     
+	 *     
+	 *   
+	 *   
+	 *     
+	 *   
+	 * 
+	 * }
+ */ + public void testMultipleXMLFiles() { + runTest("aop config - multiple XML files"); + } + public void testAjcThisNotRead() { runTest("ajcthis not read"); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml index a14d8d0e7..c59523f92 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml @@ -180,6 +180,16 @@ + + + + + + + + + + -- cgit v1.2.3