diff options
Diffstat (limited to 'tests/errors/CircularDominates.java')
-rw-r--r-- | tests/errors/CircularDominates.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/errors/CircularDominates.java b/tests/errors/CircularDominates.java new file mode 100644 index 000000000..3db4b691e --- /dev/null +++ b/tests/errors/CircularDominates.java @@ -0,0 +1,33 @@ +import org.aspectj.testing.Tester; + +class C { + public void a() { + T.add("a"); + } +} + +aspect A1 { declare dominates: A1, A2; + pointcut cut(): target(C) && execution(void a()); + + before(): A1.cut() { T.add("A1"); } +} + +aspect A2 { declare dominates: A2, A3; + before(): A1.cut() { T.add("A2"); } +} + +aspect A3 { declare dominates: A3, A1; + before(): A1.cut() { T.add("A3"); } +} + + +class T { + private static StringBuffer order = new StringBuffer(); + public static void add(String s) { order.append(s); order.append(':'); } + public static void reset() { order = new StringBuffer(); } + + public static void checkAndReset(String expectedValue) { + Tester.checkEqual(order.toString(), expectedValue); + order.setLength(0); + } +} |