aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2008-03-24 18:36:57 +0000
committeraclement <aclement>2008-03-24 18:36:57 +0000
commite372e390116d3d90f3ed5f6d8d1689c29932655f (patch)
tree1e0f68ece7b6af0b105758507bf4eb2eb26b4c83 /tests
parent8ce9dcfa94ad3c702fa0bbc8529d6e4b169661a6 (diff)
downloadaspectj-e372e390116d3d90f3ed5f6d8d1689c29932655f.tar.gz
aspectj-e372e390116d3d90f3ed5f6d8d1689c29932655f.zip
223605: itd on generic type: test and fix
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs160/pr223605/GenericConfigurableBugTest.java51
-rw-r--r--tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc160/ajc160.xml6
3 files changed, 60 insertions, 0 deletions
diff --git a/tests/bugs160/pr223605/GenericConfigurableBugTest.java b/tests/bugs160/pr223605/GenericConfigurableBugTest.java
new file mode 100644
index 000000000..b62f3f995
--- /dev/null
+++ b/tests/bugs160/pr223605/GenericConfigurableBugTest.java
@@ -0,0 +1,51 @@
+package test;
+
+import junit.framework.TestCase;
+
+/**
+ * Test case to illustrate problem with SPR-4587.
+ *
+ * @author Ramnivas Laddad
+ *
+ */
+public class GenericConfigurableBugTest {
+ public static void main(String[] argv) {
+ RegularClass regular = new RegularClass();
+ GenericParameterClass generic = new GenericParameterClass();
+
+ if (!(regular instanceof ConfigurableObject))
+ throw new RuntimeException("regular not instanceof ConfigurableObject");
+
+ if (!(generic instanceof ConfigurableObject))
+ throw new RuntimeException("generic not instanceof ConfigurableObject");
+
+ if (TestAspect.aspectOf().count!=4)
+ throw new RuntimeException("Count should be 4 but is "+TestAspect.aspectOf().count);
+ }
+}
+
+aspect TestAspect {
+ int count = 0;
+
+ after() : initialization(ConfigurableObject+.new(..)) {
+ System.out.println(thisJoinPoint);
+ count++;
+ }
+
+ declare parents: @Configurable * implements ConfigurableObject;
+}
+
+interface ConfigurableObject {
+}
+
+@interface Configurable {
+}
+
+@Configurable
+class RegularClass {
+}
+
+@Configurable
+class GenericParameterClass<T> {
+}
+
diff --git a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
index 2d2fc87e1..93f01640b 100644
--- a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
@@ -22,6 +22,9 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.0rc1
+ public void testGenericDecpLtw_pr223605() {
+ runTest("generic decp ltw");
+ }
public void testDuplicateITDsNPE_pr173602() {
runTest("duplicate itd npe");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml
index 3669dce2f..b7167cc78 100644
--- a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml
+++ b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml
@@ -3,6 +3,12 @@
<!-- AspectJ v1.6.0 Tests -->
<suite>
+ <ajc-test dir="bugs160/pr223605" title="generic decp ltw">
+ <compile files="GenericConfigurableBugTest.java" options="-1.5"><!-- -showWeaveInfo"-->
+ </compile>
+ <run class="test.GenericConfigurableBugTest"/>
+ </ajc-test>
+
<ajc-test dir="bugs160/pr173602" title="duplicate itd npe">
<compile files="X.java">
<message kind="error" line="2" text="intertype declaration from "/>