summaryrefslogtreecommitdiffstats
path: root/tests/new/IfTrue.aj
blob: afbbdb48f821ef07b1e81dec5c9a1ed129fd76b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import org.aspectj.testing.Tester;

public aspect  IfTrue {
	
	private static boolean x = true;
	
	pointcut p1() : !if(true);
	
	pointcut p2() : !if(  true  );
	
	pointcut p3() : !if(x) && execution(* *(..));
	
	pointcut p4() : within(IfTrue) && !if(true);
	
	
	after() returning : p1() {
		// should never get here
		Tester.checkFailed("!if(true) matched!");
	}

	after() returning : p2() {
		// should never get here
		Tester.checkFailed("!if(   true   ) matched!");
	}

	after() returning : p3() {
		// should never get here
		Tester.checkFailed("!if(x) matched!");
	}

	after() returning : p4() {
		// should never get here
		Tester.checkFailed("!if(true) matched!");
	}
	
	public static void main(String[] args) {}
}