summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2004-12-06 10:38:07 +0000
committeraclement <aclement>2004-12-06 10:38:07 +0000
commit9052d5d86cfcdeb9a64ed903beea53d077f0de08 (patch)
treee33f3ec7bcbccbbcf2d215379a16292f0bd6f65c /tests
parent1370ad77d229efcd27d25a8732a60cc092b3fcf6 (diff)
downloadaspectj-9052d5d86cfcdeb9a64ed903beea53d077f0de08.tar.gz
aspectj-9052d5d86cfcdeb9a64ed903beea53d077f0de08.zip
Fixes for Bug 80249: Order of types passed to compiler determines weaving behavior
Diffstat (limited to 'tests')
-rw-r--r--tests/decp/A.java2
-rw-r--r--tests/decp/AspectX.java3
-rw-r--r--tests/decp/B.java12
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java8
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150-tests.xml12
5 files changed, 33 insertions, 4 deletions
diff --git a/tests/decp/A.java b/tests/decp/A.java
new file mode 100644
index 000000000..f7e8cc3b9
--- /dev/null
+++ b/tests/decp/A.java
@@ -0,0 +1,2 @@
+public class A {
+}
diff --git a/tests/decp/AspectX.java b/tests/decp/AspectX.java
new file mode 100644
index 000000000..9fb992f50
--- /dev/null
+++ b/tests/decp/AspectX.java
@@ -0,0 +1,3 @@
+public aspect AspectX {
+ declare parents: A+ implements java.io.Serializable;
+}
diff --git a/tests/decp/B.java b/tests/decp/B.java
new file mode 100644
index 000000000..6a96c2e00
--- /dev/null
+++ b/tests/decp/B.java
@@ -0,0 +1,12 @@
+public class B extends A {
+
+ public static void main(String[] args) {
+ B b = new B();
+ if (b.getClass().getInterfaces().length>0) {
+ throw new RuntimeException("B should not implement any interfaces: "+b.getClass().getInterfaces()[0].toString());
+ }
+ if (!(b instanceof java.io.Serializable)) {
+ throw new RuntimeException("B should be serializable! Inherited from A");
+ }
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index e79edf0ba..25d4e8f80 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -26,7 +26,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
}
- public void test() {
- // placeholder for the first test...
+ public void test_typeProcessingOrderWhenDeclareParents() {
+ try {
+ runTest("Order of types passed to compiler determines weaving behavior");
+ } finally {
+ System.err.println(ajc.getLastCompilationResult().getStandardError());
+ }
}
} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150-tests.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150-tests.xml
index b770e0de2..f2023d6c9 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150-tests.xml
@@ -1,7 +1,15 @@
-<!-- AspectJ v1.5.0 Tests: Bridge attribute on methods generated to support generics -->
-
+<!-- AspectJ v1.5.0 Tests -->
+
+
<ajc-test dir="java5/bridgeMethods" pr="72766" title="Ignore bridge methods">
<compile files="AspectX.aj" inpath="testcode.jar" options="-showWeaveInfo">
<message kind="warning" line="7" text="pointcut did not match on the method call to a bridge method."/>
</compile>
</ajc-test>
+
+ <ajc-test dir="decp" pr="80249" title="Order of types passed to compiler determines weaving behavior">
+ <compile files="A.java,B.java,AspectX.java"/>
+ <run class="B"/>
+ <compile files="B.java,A.java,AspectX.java"/>
+ <run class="B"/>
+ </ajc-test> \ No newline at end of file