]> source.dussan.org Git - aspectj.git/commitdiff
Add Bugs1921Tests::testGitHub_285
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Sat, 2 Mar 2024 08:08:48 +0000 (09:08 +0100)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sat, 2 Mar 2024 09:34:26 +0000 (10:34 +0100)
This is an additional reproducer for regression bug #285.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tests/bugs1921/github_285/Unwoven.java [new file with mode: 0644]
tests/bugs1921/github_285/aop.xml [new file with mode: 0644]
tests/src/test/java/org/aspectj/systemtest/ajc1921/Bugs1921Tests.java
tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml

diff --git a/tests/bugs1921/github_285/Unwoven.java b/tests/bugs1921/github_285/Unwoven.java
new file mode 100644 (file)
index 0000000..131cbec
--- /dev/null
@@ -0,0 +1,5 @@
+public class Unwoven {
+  public static void main(String[] args) {
+    System.out.println("Hello world");
+  }
+}
diff --git a/tests/bugs1921/github_285/aop.xml b/tests/bugs1921/github_285/aop.xml
new file mode 100644 (file)
index 0000000..05837da
--- /dev/null
@@ -0,0 +1,5 @@
+<aspectj>
+  <weaver>
+    <include within="*"/>
+  </weaver>
+</aspectj>
index a9dbeb5bb0426ed65697a1cb0836713589a1993e..40459ba8dc42d18d5640136cd479ee4d04b9dbe5 100644 (file)
@@ -19,6 +19,10 @@ public class Bugs1921Tests extends XMLBasedAjcTestCase {
     runTest("same class woven concurrently in parallel-capable classloader");
   }
 
+  public void testGitHub_285() {
+    runTest("shared cache negative test");
+  }
+
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Bugs1921Tests.class);
   }
index d5d4c1c69b1c07bb926af28e8a7e271b263145d7..975fa1c6c601a99db3141c097032a053ad3993f8 100644 (file)
                <ant file="ant.xml" target="same class woven concurrently in parallel-capable classloader" verbose="true"/>
        </ajc-test>
 
+       <!--
+               https://github.com/eclipse-aspectj/aspectj/issues/285, AspectJ 1.9.21.2
+
+               See also org.aspectj.systemtest.ajc171.NewFeatures::testSharedCache. This is a quasi negative test missing back in
+               1.7.2 when the shared cache was introduced.
+       -->
+       <ajc-test dir="bugs1921/github_285" title="shared cache negative test">
+               <compile files="Unwoven.java" options="-1.5"/>
+               <run class="Unwoven" ltw="aop.xml" usefullltw="true"
+                       vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=shared">
+                       <stdout>
+                               <line text="Hello world"/>
+                       </stdout>
+                       <!--
+                               Nothing should be printed on stderr, especially no fatal NPE with message
+                               'Cannot read the array length because "b" is null' and subsequent ajcore.*.txt
+                       -->
+                       <stderr/>
+               </run>
+       </ajc-test>
+
 </suite>