aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs153/pr162657/TestAspect.aj
blob: 3b58ec895485272b3b7d68f7c80727235a6229b2 (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
import java.util.List;

public aspect TestAspect {
	private pointcut inTest(): within(TestComp);
	
	private pointcut inAdd(BaseModel m): inTest() &&
		execution(public BaseModel+ BaseComp+.add*(BaseModel+)) &&
		args(m);
	
	private pointcut inGetSearchByObj(BaseModel m): inTest() &&
		(execution(public * BaseComp+.get*(BaseModel+)) ||
		execution(public * BaseComp+.search*(BaseModel+))) &&
		args(m);

	private pointcut inGrate():
	(execution(public * BaseComp+.get*(BaseModel+)) ||
	execution(public * BaseComp+.search*(BaseModel+)));
	
	private pointcut inUpdate(BaseModel m): inTest() &&
		execution(public * BaseComp+.*(BaseModel+)) &&
		args(m) && !inAdd(BaseModel) && !inGrate();
	
	before(BaseModel m): inUpdate(m) {	}
}


abstract class BaseComp { }
abstract class BaseModel {}
class TestComp {}