diff options
author | jhugunin <jhugunin> | 2003-05-01 00:21:12 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-05-01 00:21:12 +0000 |
commit | 50a7291088bb04a856e5cf6ff31606b86213b052 (patch) | |
tree | 8976ab069a905be53cfa913bc35ec8c23004cfa6 /tests/new/SourceLocationWithinExprHard.java | |
parent | a9823f122ff3c9322c136292c45c1f9ea7cddc0a (diff) | |
download | aspectj-50a7291088bb04a856e5cf6ff31606b86213b052.tar.gz aspectj-50a7291088bb04a856e5cf6ff31606b86213b052.zip |
Added easy to understand test for issue of Class.forName differences
between IBM and SUN's JDKs
Moved a nit-picking part of SourceLocationWithExpr to its own test that
is listed as a known limitation.
Diffstat (limited to 'tests/new/SourceLocationWithinExprHard.java')
-rw-r--r-- | tests/new/SourceLocationWithinExprHard.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/new/SourceLocationWithinExprHard.java b/tests/new/SourceLocationWithinExprHard.java new file mode 100644 index 000000000..013e1447b --- /dev/null +++ b/tests/new/SourceLocationWithinExprHard.java @@ -0,0 +1,47 @@ + +import org.aspectj.testing.Tester; +import org.aspectj.lang.*; +import org.aspectj.lang.reflect.*; + +/** @testcase PR#885 call source locations within expression */ +public class SourceLocationWithinExprHard { + public static void main (String[] args) { + new // 9* + C() // 10 + . // 11 + getD() // 12* + . // 13 + getE() // 14* + . // 15 + getF() // 16* + ; + Tester.expectEvent("setup"); + Tester.checkAllEvents(); + } +} +class C { D getD() { return new D(); } } +class D { E getE() { return new E(); } } +class E { F getF() { return new F(); } } +class F { } + +aspect A { + private static final String SEP = " - "; + static { + // using qualifying expr? + Tester.expectEvent("C()" + SEP + "9"); + Tester.expectEvent("getD()" + SEP + "12"); + Tester.expectEvent("getE()" + SEP + "14"); + Tester.expectEvent("getF()" + SEP + "16"); + Tester.event("setup"); + } + pointcut filter() : withincode(static void SourceLocationWithinExpr.main(String[])); + before() : filter() && call(C.new()) { signal("C()", thisJoinPoint); } + before() : filter() && call(D C.getD()) { signal("getD()", thisJoinPoint); } + before() : filter() && call(E D.getE()) { signal("getE()", thisJoinPoint); } + before() : filter() && call(F E.getF()) { signal("getF()", thisJoinPoint); } + void signal(String prefix, JoinPoint jp) { + SourceLocation sl = jp.getSourceLocation(); + System.out.println(prefix + SEP + sl.getLine()); + Tester.event(prefix + SEP + sl.getLine()); + } +} |