NAMESPACE).getExpression().match(new ExpressionContext(PointcutType.CALL, method, method)));
}
// ============ pointcut ref tests =============
public void testPointcutReference() throws Exception {
s_namespace.addExpressionInfo("pc1", new ExpressionInfo(
"execution(void test.expression.Target.modifiers2())",
NAMESPACE));
s_namespace.addExpressionInfo("pc2", new ExpressionInfo(
"execution(void test.expression.Target.modifiers3())",
NAMESPACE));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc1", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc1", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers2, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc2", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers3, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc1 || pc2", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc1 || pc2", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers2, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc1 || pc2 ", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers3, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc2 || pc1", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc2 || pc1", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers2, null)));
assertTrue(new ExpressionInfo("execution(void test.expression.Target.modifiers1()) || pc2 || pc1 ", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers3, null)));
assertTrue(new ExpressionInfo("pc1 || pc2 || execution(void test.expression.Target.modifiers1())", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, null)));
assertTrue(new ExpressionInfo("pc1 || pc2 || execution(void test.expression.Target.modifiers1())", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers2, null)));
assertTrue(new ExpressionInfo("pc1 || pc2 || execution(void test.expression.Target.modifiers1())", NAMESPACE)
.getExpression().match(new ExpressionContext(PointcutType.EXECUTION, modifiers3, null)));
assertTrue(new ExpressionInfo(
"(execution(void test.expression.Target.modifiers1()) || pc1 || pc2) AND within(test.expression.Target)",
NAMESPACE).getExpression()
.match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType)));
assertTrue(new ExpressionInfo(
"(execution(void test.expression.Target.modifiers1()) || pc1 || pc2) AND within(test.expression.Target)",
NAMESPACE).getExpression()
.match(new ExpressionContext(PointcutType.EXECUTION, modifiers2, s_declaringType)));
assertTrue(new ExpressionInfo(
"(execution(void test.expression.Target.modifiers1()) || pc1 || pc2) AND within(test.expression.Target)",
NAMESPACE).getExpression()
.match(new ExpressionContext(PointcutType.EXECUTION, modifiers3, s_declaringType)));
assertTrue(new ExpressionInfo(
"within(test.expression.Target) && (pc1 || pc2 || execution(void test.expression.Target.modifiers1()))",
NAMESPACE).getExpression()
.match(new ExpressionContext(PointcutType.EXECUTION, modifiers1, s_declaringType)));
assertTrue(new ExpressionInfo(
"within(test.expression.Target) && (pc2 || pc1 || execution(void test.expression.Target.modifiers1()))",
NAMESPACE).getExpression()
.match(new ExpressionContext(PointcutType.EXECUTION, modifiers2, s_declaringType)));
assertTrue(new ExpressionInfo(
"within(test.expression.Target) && (pc1 || execution(void test.expression.Target.modifiers1()) || pc2)",
NAMESPACE).getExpression()
.match(new ExpressionContext(PointcutType.EXECUTION, modifiers3, s_declaringType)));
}