aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AspectStaticInit.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/new/AspectStaticInit.java')
-rw-r--r--tests/new/AspectStaticInit.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/new/AspectStaticInit.java b/tests/new/AspectStaticInit.java
new file mode 100644
index 000000000..2a7e2a87b
--- /dev/null
+++ b/tests/new/AspectStaticInit.java
@@ -0,0 +1,16 @@
+
+import org.aspectj.testing.Tester;
+
+/** @testcase PR#804 aspect static initializers should run before instance constructed */
+public class AspectStaticInit {
+ public static void main(String[] args) {
+ Tester.check(A.i == 1, "1 != A.i=" + A.i);
+ }
+}
+// XXX need tests for other instantiations besides issingleton
+aspect A {
+ static int i = 1;
+ A() {
+ Tester.check(i == 1, "1 != i=" + i);
+ }
+}