aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2019-01-23 12:08:55 -0800
committerAndy Clement <aclement@pivotal.io>2019-01-23 12:08:55 -0800
commit02337b3edca74530cd523f099915757a29a4fcdb (patch)
tree42c3aaf7a7d132b3cc21ab009eb93a197d997ac4 /tests
parent5719d79c2b162b6e09f9f6df18364b5cdbe76d87 (diff)
downloadaspectj-02337b3edca74530cd523f099915757a29a4fcdb.tar.gz
aspectj-02337b3edca74530cd523f099915757a29a4fcdb.zip
overweaving decp/decm tests
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java28
-rw-r--r--tests/src/org/aspectj/systemtest/ajc193/ajc193.xml153
2 files changed, 181 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java b/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java
index 801dd12f6..e0d6a2ede 100644
--- a/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java
@@ -21,6 +21,34 @@ import junit.framework.Test;
*/
public class Ajc193Tests extends XMLBasedAjcTestCaseForJava10OrLater {
+ public void testDeclareMixinOverweavingControl() {
+ runTest("overweaving decm - control");
+ }
+
+ public void testDeclareMixinOverweavingReweaving() {
+ runTest("overweaving decm - reweaving");
+ }
+
+ public void testDeclareMixinOverweaving() {
+ runTest("overweaving decm - 1");
+ }
+
+ public void xtestDeclareMixinOverweaving2() {
+ runTest("overweaving decm - 2");
+ }
+
+ public void xtestOverweavingDeclareMixinTargetingAspect() {
+ runTest("mood indicator 4");
+ }
+
+ public void testOverweavingAtDecPControl() {
+ runTest("overweaving atdecp - control");
+ }
+
+ public void testOverweavingAtDecP() {
+ runTest("overweaving atdecp");
+ }
+
public void testComplexOverweaving1() {
// This is the same code as the other test but overweaving OFF
runTest("overweaving");
diff --git a/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml b/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml
index f391c50d7..7d64d493e 100644
--- a/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml
+++ b/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml
@@ -2,6 +2,159 @@
<suite>
+ <ajc-test dir="bugs193/543657" vm="1.8" title="overweaving decm - control">
+ <compile files="MoodIndicator.java,Code1.java" options="-showWeaveInfo -1.8">
+ <message kind="weave" text="Mixing interface 'MoodIndicator$Moody' (MoodIndicator.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator' (MoodIndicator.java:'Mood MoodIndicator$Moody.getMood()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator' (MoodIndicator.java:21)"/>
+ </compile>
+ <run class="Code1">
+ <stdout>
+ <line text="I'm feeling HAPPY"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs193/543657" vm="1.8" title="overweaving decm - reweaving">
+ <compile files="MoodIndicator.java,Code1.java" options="-showWeaveInfo -1.8" outjar="one.jar">
+ <message kind="weave" text="Mixing interface 'MoodIndicator$Moody' (MoodIndicator.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator' (MoodIndicator.java:'Mood MoodIndicator$Moody.getMood()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator' (MoodIndicator.java:21)"/>
+ </compile>
+ <compile inpath="one.jar" options="-showWeaveInfo -1.8">
+ <message kind="weave" text="Mixing interface 'MoodIndicator$Moody' (MoodIndicator.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator' (MoodIndicator.java:'Mood MoodIndicator$Moody.getMood()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator' (one.jar!MoodIndicator.class(from MoodIndicator.java))"/>
+ </compile>
+ <run class="Code1">
+ <stdout>
+ <line text="I'm feeling HAPPY"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs193/543657" vm="1.8" title="overweaving decm - 1">
+ <compile files="MoodIndicator.java,Code1.java" options="-showWeaveInfo -1.8" outjar="one.jar">
+ <message kind="weave" text="Mixing interface 'MoodIndicator$Moody' (MoodIndicator.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator' (MoodIndicator.java:'Mood MoodIndicator$Moody.getMood()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator' (MoodIndicator.java:21)"/>
+ </compile>
+ <compile files="MoodIndicator2.java" inpath="one.jar" options="-showWeaveInfo -1.8 -Xset:overWeaving=true">
+ <message kind="warning" text="advice defined in MoodIndicator has not been applied [Xlint:adviceDidNotMatch]"/>
+ <message kind="weave" text="Mixing interface 'MoodIndicator2$Moody2' (MoodIndicator2.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator2' (MoodIndicator2.java:'Mood MoodIndicator2$Moody2.getMood2()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator2' (MoodIndicator2.java:20)"/>
+ </compile>
+ <run class="Code1">
+ <stdout>
+ <line text="I'm feeling SAD"/>
+ <line text="I'm feeling HAPPY"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs193/543657" vm="1.8" title="overweaving decm - 2">
+ <compile files="MoodIndicator.java,Code1.java" options="-showWeaveInfo -1.8" outjar="one.jar">
+ <message kind="weave" text="Mixing interface 'MoodIndicator$Moody' (MoodIndicator.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator' (MoodIndicator.java:'Mood MoodIndicator$Moody.getMood()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator' (MoodIndicator.java:21)"/>
+ </compile>
+ <compile files="MoodIndicator3.java" inpath="one.jar" options="-showWeaveInfo -1.8 -Xset:overWeaving=true">
+ <message kind="warning" text="advice defined in MoodIndicator has not been applied [Xlint:adviceDidNotMatch]"/>
+ <message kind="weave" text="Mixing interface 'MoodIndicator2$Moody2' (MoodIndicator2.java) into type 'Code1' (Code1.java)"/>
+ <message kind="weave" text="Type 'Code1' (Code1.java) has intertyped method from 'MoodIndicator2' (MoodIndicator2.java:'Mood MoodIndicator2$Moody2.getMood2()')"/>
+ <message kind="weave" text="Join point 'method-execution(void Code1.run())' in Type 'Code1' (Code1.java:2) advised by before advice from 'MoodIndicator2' (MoodIndicator2.java:20)"/>
+ </compile>
+ <run class="Code1">
+ <stdout>
+ <line text="I'm feeling SAD"/>
+ <line text="I'm feeling HAPPY"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs193/543657" vm="1.8" title="mood indicator 4">
+ <compile files="MoodIndicator4.java" options="-1.8" outjar="one.jar">
+ </compile>
+ <compile inpath="one.jar" options="-1.8 -Xset:overWeaving=true">
+ </compile>
+ <run class="Code1">
+ <stdout>
+ <line text="I'm feeling SAD"/>
+ <line text="I'm feeling HAPPY"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs193/543657" vm="1.8" title="overweaving atdecp - control">
+ <compile files="Basic3b.java" options="-showWeaveInfo -1.8" outjar="ow1.jar">
+ <message kind="weave" text="Extending interface set for type 'Basic3b' (Basic3b.java) to include 'X$I' (Basic3b.java)"/>
+ <message kind="weave" text="Type 'Basic3b' (Basic3b.java) has intertyped method from 'X' (Basic3b.java:'void X$I.m2()')"/>
+ <message kind="weave" text="Type 'Basic3b' (Basic3b.java) has intertyped method from 'X' (Basic3b.java:'void X$I.m3()')"/>
+ <message kind="weave" text="Type 'Basic3b' (Basic3b.java) has intertyped method from 'X' (Basic3b.java:'void X$I.m4()')"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:7) advised by before advice from 'X' (Basic3b.java:33)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m3())' in Type 'Basic3b' (Basic3b.java:8) advised by before advice from 'X' (Basic3b.java:33)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:9) advised by before advice from 'X' (Basic3b.java:33)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m4())' in Type 'Basic3b' (Basic3b.java:10) 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 'X$IIimpl' (Basic3b.java:23) 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 files="Y.java" inpath="ow1.jar" options=" -1.8">
+ </compile>
+ <run class="Basic3b">
+ <stdout>
+ <!-- BUG: one of these should be YImpl -->
+ <line text="X.IImpl.m2() ran"/>
+ <line text="X.IImpl.m2() ran"/>
+ <line text="Basic3b.main ran"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs193/543657" vm="1.8" title="overweaving atdecp">
+ <compile files="Basic3b.java" options="-showWeaveInfo -1.8" outjar="ow1.jar">
+ <message kind="weave" text="Extending interface set for type 'Basic3b' (Basic3b.java) to include 'X$I' (Basic3b.java)"/>
+ <message kind="weave" text="Type 'Basic3b' (Basic3b.java) has intertyped method from 'X' (Basic3b.java:'void X$I.m2()')"/>
+ <message kind="weave" text="Type 'Basic3b' (Basic3b.java) has intertyped method from 'X' (Basic3b.java:'void X$I.m3()')"/>
+ <message kind="weave" text="Type 'Basic3b' (Basic3b.java) has intertyped method from 'X' (Basic3b.java:'void X$I.m4()')"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:7) advised by before advice from 'X' (Basic3b.java:33)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m3())' in Type 'Basic3b' (Basic3b.java:8) advised by before advice from 'X' (Basic3b.java:33)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:9) advised by before advice from 'X' (Basic3b.java:33)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m4())' in Type 'Basic3b' (Basic3b.java:10) 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 'X$IIimpl' (Basic3b.java:23) 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 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 '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 java.io.PrintStream.println(java.lang.String))' in Type 'X$IIimpl' (Basic3b.java:23) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Extending interface set for type 'Basic3b' (Basic3b.java) to include 'Y$I' (Y.java)"/>
+ <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'Basic3b' (Basic3b.java:7) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:7) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'Basic3b' (Basic3b.java:8) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m3())' in Type 'Basic3b' (Basic3b.java:8) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'Basic3b' (Basic3b.java:9) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:9) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'Basic3b' (Basic3b.java:10) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m4())' in Type 'Basic3b' (Basic3b.java:10) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X.advice1())' in Type 'Basic3b' (Basic3b.java:11) 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 'Basic3b' (Basic3b.java:11) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m2())' in Type 'Basic3b' (Basic3b.java:1) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m3())' in Type 'Basic3b' (Basic3b.java:1) advised by before advice from 'Y' (Y.java:17)"/>
+ <message kind="weave" text="Join point 'method-call(void X$I.m4())' in Type 'Basic3b' (Basic3b.java:1) advised by before advice from 'Y' (Y.java:17)"/>
+ </compile>
+ <run class="Basic3b">
+ <stdout>
+ <!-- BUG: one of these should be YImpl -->
+ <line text="X.IImpl.m2() ran"/>
+ <line text="X.IImpl.m2() ran"/>
+ <line text="Basic3b.main ran"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs193/389678" vm="1.8" title="overweaving">
<compile files="OverWeave_1/src/Application.java,OverWeave_1/src/MyAspect.aj" options="-showWeaveInfo -1.8" outjar="ow1.jar">
<message kind="weave" text="Join point 'method-execution(void Application.main(java.lang.String[]))' in Type 'Application' (Application.java:2) advised by before advice from 'MyAspect' (MyAspect.aj:2)"/>