summaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/annotationGen/PerCflowAspect.aj
blob: e0190caf73833d3a772e081746d7f2d0cded9c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import org.aspectj.lang.annotation.Aspect;
import java.lang.annotation.*;

public aspect PerCflowAspect percflow(execution(* Foo.foo(..))) {
	
	public static void main(String[] args) {
		Annotation[] annotations = PerCflowAspect.class.getAnnotations();
		if (annotations.length != 1) throw new RuntimeException("Should have one annotation");
		Aspect aspectAnnotation = (Aspect) annotations[0];
		if (!aspectAnnotation.value().equals("percflow(execution(* Foo.foo(..)))")) 
			throw new RuntimeException("value should be equal to perclause but was: " + aspectAnnotation.value());
	}
	
}

class Foo {
	
	void foo() {}
	
}