]> source.dussan.org Git - aspectj.git/commitdiff
Fix XML config for Bugs1919Tests.test_GitHub_214
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 4 Jun 2023 10:52:54 +0000 (12:52 +0200)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 4 Jun 2023 11:01:54 +0000 (13:01 +0200)
The test started breaking on GitHub, but ran fine locally, which implied
some kind of classpath ordering issue. As it turned out, for XML tests
all JARs found in the sandbox directory are added to the classpath
automatically. So if we do not want them on the classpath, we need to
delete or rename them before running.

In this case, however, it was enough to make sure the classpath order is
correct, so that the duplicate 'Application' class is found in the woven
version, not in the unwoven one by chance. We therefore need to use the
correct syntax,
  1. separating classpath entries by comma, not space,
  2. prepending '$sandbox/' to the JAR name.

Now the test reliably does what it should have done from the start: run
the woven code. Until now, the output assertions were adjusted to the
weird result of no aspect logs being present on the console, which was
wrong right from the start.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml

index 5ff07be04e7b550d1adfaf70fbb781efe40e06f8..d31b35aa192ca5cd29b1dce4b31bf8d871537830 100644 (file)
                        <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
                        <message kind="warning" text="advice defined in FirstAspect has not been applied [Xlint:adviceDidNotMatch]"/>
                </compile>
-               <compile files="Application.java MarkerTwo.java" options="-1.5 -showWeaveInfo -Xlint:warning" classpath="first-aspect.jar" outjar="application.jar"/>
+               <compile files="Application.java MarkerTwo.java" options="-1.5 -showWeaveInfo -Xlint:warning" classpath="$sandbox/first-aspect.jar" outjar="application.jar"/>
                <compile files="SecondAspect.java" options="-1.5 -showWeaveInfo -Xlint:warning" aspectpath="first-aspect.jar" inpath="application.jar" outjar="second-aspect.jar">
                        <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
                        <message kind="warning" text="at this shadow method-execution(void Application.greet(java.lang.String)) no precedence is specified between advice applying from aspect FirstAspect and aspect SecondAspect [Xlint:unorderedAdviceAtShadow]"/>
                        <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by around advice from 'SecondAspect'"/>
                        <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by before advice from 'FirstAspect'"/>
                </compile>
-               <run class="Application" classpath="second-aspect.jar first-aspect.jar">
+               <run class="Application" classpath="$sandbox/second-aspect.jar,$sandbox/first-aspect.jar">
                        <stdout>
+                               <line text="FirstAspect: execution(void Application.greet(String))"/>
+                               <line text="SecondAspect: execution(void Application.greet(String))"/>
                                <line text="Hello world!"/>
                        </stdout>
                </run>