aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs166
diff options
context:
space:
mode:
authoraclement <aclement>2009-09-23 21:00:59 +0000
committeraclement <aclement>2009-09-23 21:00:59 +0000
commit81638e94f858bae3ff5ea6e6aceb3df90d58d07e (patch)
treebc6575eff52a7d8e9fa6d8c9f01858444537b0b5 /tests/bugs166
parentede8a85199614e13e431721d4d90b602f0e116cb (diff)
downloadaspectj-81638e94f858bae3ff5ea6e6aceb3df90d58d07e.tar.gz
aspectj-81638e94f858bae3ff5ea6e6aceb3df90d58d07e.zip
286473: tests
Diffstat (limited to 'tests/bugs166')
-rw-r--r--tests/bugs166/pr286473/Anno.java11
-rw-r--r--tests/bugs166/pr286473/Bottom.java5
-rw-r--r--tests/bugs166/pr286473/LTWTest.java56
-rw-r--r--tests/bugs166/pr286473/Mark.java13
-rw-r--r--tests/bugs166/pr286473/Middle.java5
-rw-r--r--tests/bugs166/pr286473/Top.java5
-rw-r--r--tests/bugs166/pr286473/aop.xml6
7 files changed, 101 insertions, 0 deletions
diff --git a/tests/bugs166/pr286473/Anno.java b/tests/bugs166/pr286473/Anno.java
new file mode 100644
index 000000000..d7fce2edc
--- /dev/null
+++ b/tests/bugs166/pr286473/Anno.java
@@ -0,0 +1,11 @@
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface Anno {
+
+}
diff --git a/tests/bugs166/pr286473/Bottom.java b/tests/bugs166/pr286473/Bottom.java
new file mode 100644
index 000000000..531cf417d
--- /dev/null
+++ b/tests/bugs166/pr286473/Bottom.java
@@ -0,0 +1,5 @@
+
+@Anno
+public class Bottom extends Middle {
+ public void bottom() {}
+}
diff --git a/tests/bugs166/pr286473/LTWTest.java b/tests/bugs166/pr286473/LTWTest.java
new file mode 100644
index 000000000..59b596f86
--- /dev/null
+++ b/tests/bugs166/pr286473/LTWTest.java
@@ -0,0 +1,56 @@
+
+import java.lang.reflect.Method;
+import java.util.*;
+
+public class LTWTest {
+
+ public void noDoubles() throws Exception {
+ Method[] methods = Bottom.class.getMethods();
+ System.out.println("Bottom.getMethods()");
+ boolean broken = false;
+ List<String> l = new ArrayList<String>();
+ for (Method method : methods) {
+ if (!method.getDeclaringClass().equals(Object.class)) {
+ l.add(method.getName() + " : " + method.getDeclaringClass().getName());
+ }
+ if (method.getDeclaringClass().equals(Bottom.class)) {
+ if (method.getName().equals("markMethod")) {
+ broken=true;
+ }
+ }
+ }
+ Collections.sort(l);
+ for (String s: l) {
+ System.out.println(s);
+ }
+ if (broken) {
+ throw new IllegalStateException("Bottom.getMethods() should not include a markMethod() declared by Bottom");
+ }
+ }
+
+ public void grandChildInherits() throws Exception {
+ Method[] methods = Bottom.class.getDeclaredMethods();
+ for (Method method : methods) {
+ if (method.getName().equals("markMethod"))
+throw new RuntimeException();
+// assertThat(method.getName(), not(equalTo("doSomething")));
+ }
+
+/*
+ methods = Bottom.class.getMethods();
+ for (Method method : methods) {
+ if (method.getName().equals("doSomething")) {
+ System.out.println(method.getDeclaringClass().getName());
+ }
+ }
+*/
+
+ }
+
+ public static void main(String[] args) throws Exception {
+ LTWTest t = new LTWTest();
+ t.noDoubles();
+ t.grandChildInherits();
+ }
+
+}
diff --git a/tests/bugs166/pr286473/Mark.java b/tests/bugs166/pr286473/Mark.java
new file mode 100644
index 000000000..cbe018a11
--- /dev/null
+++ b/tests/bugs166/pr286473/Mark.java
@@ -0,0 +1,13 @@
+public aspect Mark {
+
+ public static interface IMarker {
+
+ }
+
+ public String IMarker.markMethod() {
+ return "something done";
+ }
+
+ declare parents : ((@Anno *)) implements IMarker;
+
+}
diff --git a/tests/bugs166/pr286473/Middle.java b/tests/bugs166/pr286473/Middle.java
new file mode 100644
index 000000000..7dddb06cf
--- /dev/null
+++ b/tests/bugs166/pr286473/Middle.java
@@ -0,0 +1,5 @@
+
+@Anno
+public class Middle extends Top {
+ public void middle() {}
+}
diff --git a/tests/bugs166/pr286473/Top.java b/tests/bugs166/pr286473/Top.java
new file mode 100644
index 000000000..f38360097
--- /dev/null
+++ b/tests/bugs166/pr286473/Top.java
@@ -0,0 +1,5 @@
+
+@Anno
+public class Top {
+
+}
diff --git a/tests/bugs166/pr286473/aop.xml b/tests/bugs166/pr286473/aop.xml
new file mode 100644
index 000000000..31fb5fe1c
--- /dev/null
+++ b/tests/bugs166/pr286473/aop.xml
@@ -0,0 +1,6 @@
+<aspectj>
+ <aspects>
+ <aspect name="Mark"/>
+ </aspects>
+ <weaver options="-showWeaveInfo -Xset:completeBinaryTypes=true"/>
+</aspectj>