summaryrefslogtreecommitdiffstats
path: root/tests/symbols/CrosscutTest.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/symbols/CrosscutTest.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/symbols/CrosscutTest.java')
-rw-r--r--tests/symbols/CrosscutTest.java128
1 files changed, 128 insertions, 0 deletions
diff --git a/tests/symbols/CrosscutTest.java b/tests/symbols/CrosscutTest.java
new file mode 100644
index 000000000..9eecb0df9
--- /dev/null
+++ b/tests/symbols/CrosscutTest.java
@@ -0,0 +1,128 @@
+import symbols.Helper;
+import org.aspectj.testing.Tester;
+
+import org.aspectj.tools.ide.SymbolManager;
+import org.aspectj.tools.ide.SourceLine;
+import org.aspectj.tools.ide.Declaration;
+
+import java.io.File;
+
+public class CrosscutTest {
+ private static Helper h = new Helper();
+
+ public static void main(String[] args) {
+ Declaration classDec = h.getDecl("C.java", 3);
+ Declaration aspectDec = h.getDecl("A.java", 3);
+
+ Declaration methodDecV = h.getDecl("C.java", 8);
+ Declaration methodDecVI = h.getDecl("C.java", 9);
+ Declaration methodDecVLF = h.getDecl("C.java",10);
+ Declaration methodDecISO = h.getDecl("C.java",11);
+
+ Declaration fieldDecI = h.getDecl("C.java",13);
+ Declaration fieldDecF = h.getDecl("C.java",14);
+
+ Declaration pointcutDecInstOf = h.getDecl("A.java", 6);
+ Declaration pointcutDecHasAsp = h.getDecl("A.java", 7);
+ Declaration pointcutDecWithin = h.getDecl("A.java", 10);
+ Declaration pointcutDecWithinAll = h.getDecl("A.java", 11);
+ Declaration pointcutDecWithinCode = h.getDecl("A.java", 12);
+ Declaration pointcutDecCFlow = h.getDecl("A.java", 15);
+ Declaration pointcutDecCFlowTop = h.getDecl("A.java", 16);
+ Declaration pointcutDecCalls = h.getDecl("A.java", 19);
+ Declaration pointcutDecRec = h.getDecl("A.java", 20);
+ Declaration pointcutDecExec = h.getDecl("A.java", 21);
+ Declaration pointcutDecCallsTo = h.getDecl("A.java", 22);
+ Declaration pointcutDecHandThr = h.getDecl("A.java", 25);
+ Declaration pointcutDecHandErr = h.getDecl("A.java", 26);
+ Declaration pointcutDecHandExc = h.getDecl("A.java", 27);
+ Declaration pointcutDecHandRt = h.getDecl("A.java", 28);
+ Declaration pointcutDecGets = h.getDecl("A.java", 31);
+ Declaration pointcutDecSets = h.getDecl("A.java", 32);
+
+ Declaration adviceDecBefore = h.getDecl("A.java", 35);
+ Declaration adviceDecAfter = h.getDecl("A.java", 36);
+ Declaration adviceDecAfterRet = h.getDecl("A.java", 37);
+ Declaration adviceDecAfterThr = h.getDecl("A.java", 38);
+ Declaration adviceDecAround = h.getDecl("A.java", 41);
+
+ Declaration fieldDecIntrD = h.getDecl("A.java", 44);
+ Declaration methodDecIntrV = h.getDecl("A.java", 45);
+
+ Declaration adviceDecBeforeToString = h.getDecl("A.java", 47);
+ Declaration adviceDecBeforeNew = h.getDecl("A.java", 48);
+
+ if (!h.allDecsFound) return;
+
+ // Check "points to"
+ h.checkPointsNothing(methodDecV);
+ h.checkPointsNothing(methodDecVI);
+ h.checkPointsNothing(methodDecVLF);
+ h.checkPointsNothing(methodDecISO);
+
+ h.checkPointsNothing(pointcutDecInstOf);
+ h.checkPointsNothing(pointcutDecHasAsp);
+ h.checkPointsNothing(pointcutDecWithin);
+ h.checkPointsNothing(pointcutDecWithinAll);
+ h.checkPointsNothing(pointcutDecWithinCode);
+ h.checkPointsNothing(pointcutDecCFlow);
+ h.checkPointsNothing(pointcutDecCFlowTop);
+ h.checkPointsNothing(pointcutDecCalls);
+ h.checkPointsNothing(pointcutDecRec);
+ h.checkPointsNothing(pointcutDecExec);
+ h.checkPointsNothing(pointcutDecCallsTo);
+ h.checkPointsNothing(pointcutDecHandThr);
+ h.checkPointsNothing(pointcutDecHandErr);
+ h.checkPointsNothing(pointcutDecHandExc);
+ h.checkPointsNothing(pointcutDecHandRt);
+ h.checkPointsNothing(pointcutDecGets);
+ h.checkPointsNothing(pointcutDecSets);
+
+ //XXX Need to decide if advices on introductions have to point to
+ // the introduction declaration, or to the member that was introduced
+ h.checkPointsTo(adviceDecBefore, new Declaration[]{methodDecV,methodDecIntrV});
+ h.checkPointsTo(adviceDecAfter, new Declaration[]{methodDecV,methodDecIntrV});
+ h.checkPointsTo(adviceDecAfterRet, new Declaration[]{methodDecISO});
+ h.checkPointsTo(adviceDecAfterThr, new Declaration[]{methodDecV});
+ h.checkPointsTo(adviceDecAround, new Declaration[]{methodDecV});
+
+ h.checkPointsNothing(adviceDecBeforeToString);
+ h.checkPointsNothing(adviceDecBeforeNew);
+
+ // Check "pointed by"
+ h.checkPointedToBy(methodDecV, new Declaration[]{adviceDecBefore,adviceDecAfter,adviceDecAfterThr,adviceDecAround});
+ h.checkPointedToByNone(methodDecVI);
+ h.checkPointedToByNone(methodDecVLF);
+ h.checkPointedToBy(methodDecISO, new Declaration[]{adviceDecAfterRet});
+
+ h.checkPointedToByNone(pointcutDecInstOf);
+ h.checkPointedToByNone(pointcutDecHasAsp);
+ h.checkPointedToByNone(pointcutDecWithin);
+ h.checkPointedToByNone(pointcutDecWithinAll);
+ h.checkPointedToByNone(pointcutDecWithinCode);
+ h.checkPointedToByNone(pointcutDecCFlow);
+ h.checkPointedToByNone(pointcutDecCFlowTop);
+ h.checkPointedToByNone(pointcutDecCalls);
+ h.checkPointedToByNone(pointcutDecRec);
+ h.checkPointedToByNone(pointcutDecExec);
+ h.checkPointedToByNone(pointcutDecCallsTo);
+ h.checkPointedToByNone(pointcutDecHandThr);
+ h.checkPointedToByNone(pointcutDecHandErr);
+ h.checkPointedToByNone(pointcutDecHandExc);
+ h.checkPointedToByNone(pointcutDecHandRt);
+ h.checkPointedToByNone(pointcutDecGets);
+ h.checkPointedToByNone(pointcutDecSets);
+
+ h.checkPointedToByNone(adviceDecBefore);
+ h.checkPointedToByNone(adviceDecBefore);
+ h.checkPointedToByNone(adviceDecAfter);
+ h.checkPointedToByNone(adviceDecAfterRet);
+ h.checkPointedToByNone(adviceDecAfterThr);
+ h.checkPointedToByNone(adviceDecAround);
+
+ h.checkPointedToByNone(adviceDecBeforeToString);
+ h.checkPointedToByNone(adviceDecBeforeNew);
+ }
+
+}
+