Browse Source

Fix failing tests after previous commit

After the changes, the weaver's behaviour is now slightly different, but
not actually buggy. Actually, in one case there is now a weaver warning
for a non-matching pointcut which should have been there before, but was
not. I.e., things have improved and the tests are even a bit better now.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tags/V1_9_20
Alexander Kriegisch 1 year ago
parent
commit
43cb1e2fc4

+ 12
- 3
tests/bugs165/pr272233/Iffy2.java View File

import java.util.*; import java.util.*;
import org.aspectj.lang.annotation.*; import org.aspectj.lang.annotation.*;


@Aspect
@Aspect
class Iffy2 { class Iffy2 {


@Before("execution(!void[] *(..))")
@Before("execution(!void *(..))")
public void advice1() {} public void advice1() {}


@Before("execution(!void[] *(..))")
@Before("execution(!void[] *(..))")
public void advice2() {} public void advice2() {}


@Before("execution(!void *(..))")
public void advice3() {}

@Before("execution(*..Collection[] *(..))")
public void advice4() {}

@Before("execution(java.util.Collection<?>[] *(..))")
public void advice5() {}

public Collection<?>[] getCollectionArray() { public Collection<?>[] getCollectionArray() {
return null; return null;
} }

+ 1
- 0
tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml View File



<ajc-test dir="bugs162/pr240693" title="privileged generics"> <ajc-test dir="bugs162/pr240693" title="privileged generics">
<compile files="PayloadClass.java SomeInterface.java GenericClassInAdvice.java" options="-1.5"> <compile files="PayloadClass.java SomeInterface.java GenericClassInAdvice.java" options="-1.5">
<message kind="warning" text="advice defined in GenericClassInAdvice has not been applied [Xlint:adviceDidNotMatch]"/>
</compile> </compile>
</ajc-test> </ajc-test>



+ 18
- 15
tests/src/test/resources/org/aspectj/systemtest/ajc165/ajc165.xml View File

<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>


<suite> <suite>
<ajc-test dir="bugs165/pr277959" title="verifyerror"> <ajc-test dir="bugs165/pr277959" title="verifyerror">
<compile files="AOPTest.java CodeAspect.java" options="-1.5"/> <compile files="AOPTest.java CodeAspect.java" options="-1.5"/>
<run class="example.AOPTest"/> <run class="example.AOPTest"/>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr277508" title="if method names"> <ajc-test dir="bugs165/pr277508" title="if method names">
<compile files="Basic.java" options="-1.5"/> <compile files="Basic.java" options="-1.5"/>
<run class="Basic"> <run class="Basic">
</stdout> </stdout>
</run> </run>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr277508" title="if method names - 2"> <ajc-test dir="bugs165/pr277508" title="if method names - 2">
<compile files="Basic2.java" options="-1.5"/> <compile files="Basic2.java" options="-1.5"/>
<run class="Basic2"> <run class="Basic2">
</stdout> </stdout>
</run> </run>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr275625" title="dec anno method"> <ajc-test dir="bugs165/pr275625" title="dec anno method">
<compile files="A.java" options="-1.5"/> <compile files="A.java" options="-1.5"/>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr275625" title="dec anno field"> <ajc-test dir="bugs165/pr275625" title="dec anno field">
<compile files="F.java" options="-1.5"/> <compile files="F.java" options="-1.5"/>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr275032" title="itd default ctor"> <ajc-test dir="bugs165/pr275032" title="itd default ctor">
<compile files="A.java X.java" options="-1.5 -Xlint:ignore"/> <compile files="A.java X.java" options="-1.5 -Xlint:ignore"/>
<run class="A"> <run class="A">
</stdout> </stdout>
</run> </run>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr275032/c2" title="itd default ctor - 2"> <ajc-test dir="bugs165/pr275032/c2" title="itd default ctor - 2">
<compile files="A.java X.java" options="-1.5 -Xlint:ignore"> <compile files="A.java X.java" options="-1.5 -Xlint:ignore">
<message kind="error" text="inter-type declaration from X conflicts with existing"/> <message kind="error" text="inter-type declaration from X conflicts with existing"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr275032/c2" title="itd default ctor - 3"> <ajc-test dir="bugs165/pr275032/c2" title="itd default ctor - 3">
<compile files="A.java" options="-outjar foo.jar"/> <compile files="A.java" options="-outjar foo.jar"/>
<compile files="X.java" options="-1.5 -Xlint:ignore" inpath="foo.jar"> <compile files="X.java" options="-1.5 -Xlint:ignore" inpath="foo.jar">
<message kind="error" text="inter-type declaration from X conflicts with existing"/> <message kind="error" text="inter-type declaration from X conflicts with existing"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr275032" title="itd default ctor - 4"> <ajc-test dir="bugs165/pr275032" title="itd default ctor - 4">
<compile files="A.java" options="-outjar foo.jar"/> <compile files="A.java" options="-outjar foo.jar"/>
<compile files="X.java" options="-1.5" inpath="foo.jar"> <compile files="X.java" options="-1.5" inpath="foo.jar">
</stdout> </stdout>
</run> </run>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr272233" title="funky pointcut"> <ajc-test dir="bugs165/pr272233" title="funky pointcut">
<compile files="Iffy.java" options="-1.5"> <compile files="Iffy.java" options="-1.5">
<message kind="warning" text="void is not a generic type"/> <message kind="warning" text="void is not a generic type"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr272233" title="funky pointcut 2"> <ajc-test dir="bugs165/pr272233" title="funky pointcut 2">
<compile files="Iffy2.java" options="-1.5 -showWeaveInfo"> <compile files="Iffy2.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:11)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:8)"/> <message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:8)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:11)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:14)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:17)"/>
<message kind="weave" text="advised by before advice from 'Iffy2' (Iffy2.java:20)"/>
</compile> </compile>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr265356" title="annotation style message positions"> <ajc-test dir="bugs165/pr265356" title="annotation style message positions">
<compile files="Main.java" options="-1.5"> <compile files="Main.java" options="-1.5">
<message kind="warning" line="11"/> <message kind="warning" line="11"/>
<ajc-test dir="bugs165/pr271169" title="around call npe"> <ajc-test dir="bugs165/pr271169" title="around call npe">
<compile files="HypChecksums.java" options="-1.5"/> <compile files="HypChecksums.java" options="-1.5"/>
</ajc-test> </ajc-test>
<ajc-test dir="bugs165/pr273628" title="verifyerror on anno bind"> <ajc-test dir="bugs165/pr273628" title="verifyerror on anno bind">
<compile files="AnnotationAspect.java ApiDescriptor.java AspectTargetClass.java MonitorableMethod.java TestPointcutAnnotationAspect.java" options="-1.5"/> <compile files="AnnotationAspect.java ApiDescriptor.java AspectTargetClass.java MonitorableMethod.java TestPointcutAnnotationAspect.java" options="-1.5"/>
<run class="p.TestPointcutAnnotationAspect"/> <run class="p.TestPointcutAnnotationAspect"/>
</run> </run>
</ajc-test> </ajc-test>


</suite>
</suite>

+ 4
- 5
tests/src/test/resources/org/aspectj/systemtest/ajc193/ajc193.xml View File

</compile> </compile>
<run class="Basic3b"> <run class="Basic3b">
<stdout> <stdout>
<!-- BUG: one of these should be YImpl -->
<line text="X.IImpl.m2() ran"/>
<line text="X.IImpl.m2() ran"/>
<!-- BUG: There should be one of each X.IImpl and Y.IImpl, just like for @decm. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=543657#c5. -->
<line text="Y.IImpl.m2() ran"/>
<line text="Y.IImpl.m2() ran"/>
<line text="Basic3b.main ran"/> <line text="Basic3b.main ran"/>
</stdout> </stdout>
</run> </run>
<message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Basic3b' (Basic3b.java:11) advised by before advice from 'X' (Basic3b.java:33)"/> <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Basic3b' (Basic3b.java:11) advised by before advice from 'X' (Basic3b.java:33)"/>
</compile> </compile>
<compile files="Y.java" inpath="ow1.jar" options="-showWeaveInfo -1.8 -Xset:overWeaving=true"> <compile files="Y.java" inpath="ow1.jar" options="-showWeaveInfo -1.8 -Xset:overWeaving=true">

<message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Y$IIimpl' (Y.java:10) advised by before advice from 'Y' (Y.java:17)"/> <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Y$IIimpl' (Y.java:10) advised by before advice from 'Y' (Y.java:17)"/>
<message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Y$IIimpl' (Y.java:10) advised by before advice from 'X' (ow1.jar!X.class(from Basic3b.java))"/> <message kind="weave" text="Join point 'method-call(void java.io.PrintStream.println(java.lang.String))' in Type 'Y$IIimpl' (Y.java:10) advised by before advice from 'X' (ow1.jar!X.class(from Basic3b.java))"/>
<message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'X$IIimpl' (Basic3b.java:23) advised by before advice from 'Y' (Y.java:17)"/> <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'X$IIimpl' (Basic3b.java:23) advised by before advice from 'Y' (Y.java:17)"/>
</compile> </compile>
<run class="Basic3b"> <run class="Basic3b">
<stdout> <stdout>
<!-- BUG: one of these should be YImpl -->
<!-- BUG: There should be one of each X.IImpl and Y.IImpl, just like for @decm. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=543657#c5. -->
<line text="X.IImpl.m2() ran"/> <line text="X.IImpl.m2() ran"/>
<line text="X.IImpl.m2() ran"/> <line text="X.IImpl.m2() ran"/>
<line text="Basic3b.main ran"/> <line text="Basic3b.main ran"/>

Loading…
Cancel
Save