]> git.uio.no Git - ifi-stolz-refaktor.git/blob - software/no.uio.ifi.refaktor.aSimpleExampleAspectJ/test/no/uio/ifi/refaktor/aSimpleExampleAspectJ/test/ExampleTestAspect.aj
Adding test using AspectJ for aliasing example
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor.aSimpleExampleAspectJ / test / no / uio / ifi / refaktor / aSimpleExampleAspectJ / test / ExampleTestAspect.aj
1 package no.uio.ifi.refaktor.aSimpleExampleAspectJ.test;
2
3 import no.uio.ifi.refaktor.aSimpleExampleAspectJ.example.C;
4 import no.uio.ifi.refaktor.aSimpleExampleAspectJ.example.X;
5
6
7 public aspect ExampleTestAspect {
8         private X xM;
9         private X xN;
10
11         pointcut f() : call(public void C.f());
12         pointcut m(C c) : cflow(f()) && call(public void X.m(C)) && args(c);
13         pointcut n(X x) : cflow(f()) && call(public void X.n()) && target(x);
14         
15         after(C c) returning() : m(c) {
16                 xM = c.x;
17         }
18         
19         before(X x) : n(x) {
20                 xN = x;
21         }
22         
23         public boolean isOK() {
24                 return xM == xN ;
25         }
26 }