summaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/annotationGen/PrivilegedAspect.aj
blob: 50c850430da1465674b482f771f4b7f85770e235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.internal.lang.annotation.ajcPrivileged;
import java.lang.annotation.*;

public privileged aspect PrivilegedAspect {
	
	public static void main(String[] args) {
		Annotation[] annotations = PrivilegedAspect.class.getAnnotations();
		if (annotations.length != 2) throw new RuntimeException("Should have two annotations");
		Aspect aspectAnnotation = PrivilegedAspect.class.getAnnotation(Aspect.class);
		if (!aspectAnnotation.value().equals("")) throw new RuntimeException("value should be empty");
		ajcPrivileged pAnnotation = PrivilegedAspect.class.getAnnotation(ajcPrivileged.class);
		if (pAnnotation == null) throw new RuntimeException("Should be @ajcPrivileged");
	}
	
}