summaryrefslogtreecommitdiffstats
path: root/tests/base/test138/Driver.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/base/test138/Driver.java')
-rw-r--r--tests/base/test138/Driver.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/base/test138/Driver.java b/tests/base/test138/Driver.java
new file mode 100644
index 000000000..f61d360af
--- /dev/null
+++ b/tests/base/test138/Driver.java
@@ -0,0 +1,34 @@
+//only register things once.
+
+import org.aspectj.testing.Tester;
+
+public class Driver {
+ public static void test() {
+ A a = new A();
+ B b = new B();
+
+ // instances of A, B are created (the instanceof Aspect isn't counted for timing reasons)
+ Tester.checkEqual(Aspect.count, 2, "instance count");
+ }
+
+ public static void main(String[] args) { test(); }
+}
+
+
+class A {
+ public A() {}
+ public void foo() {}
+}
+
+class B extends A {
+ public B() {}
+ public void bar() {}
+}
+
+aspect Aspect {
+ public static int count = 0;
+
+ after() returning(): /*target(*) &&*/ call(new()) {
+ count++;
+ }
+}