Package org.codehaus.aspectwerkz.expression

Examples of org.codehaus.aspectwerkz.expression.ExpressionContext


            new ExpressionContext(PointcutType.CALL, returnType1, null)));
    }

    public void testMethodReturnType2() throws Exception {
        assertFalse(new ExpressionInfo("call(void test.expression.Target.returnType2())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType2, null)));
        assertFalse(new ExpressionInfo("call(String test.expression.Target.returnType2())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType2, null)));
        assertTrue(new ExpressionInfo("call(* test.expression.Target.returnType2())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, returnType2, null)));
        assertTrue(new ExpressionInfo("call(int test.expression.Target.returnType2())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType2, null)));
        assertFalse(new ExpressionInfo("call(int[] test.expression.Target.returnType2())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType2, null)));
    }
View Full Code Here


                .match(new ExpressionContext(PointcutType.CALL, returnType2, null)));
    }

    public void testMethodReturnType3() throws Exception {
        assertFalse(new ExpressionInfo("call(void test.expression.Target.returnType3())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType3, null)));
        assertTrue(new ExpressionInfo("call(String test.expression.Target.returnType3())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType3, null)));
        assertTrue(new ExpressionInfo("call(* test.expression.Target.returnType3())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, returnType3, null)));
        assertTrue(new ExpressionInfo("call(java.lang.String* test.expression.Target.returnType3())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType3, null)));
        assertFalse(new ExpressionInfo("call(java.lang.StringBuffer test.expression.Target.returnType3())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType3, null)));
    }
View Full Code Here

                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType3, null)));
    }

    public void testMethodReturnType4() throws Exception {
        assertFalse(new ExpressionInfo("call(void test.expression.Target.returnType4())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
        assertTrue(new ExpressionInfo("call(Process test.expression.Target.returnType4())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
        assertTrue(new ExpressionInfo("call(* test.expression.Target.returnType4())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, returnType4, null)));
        assertTrue(new ExpressionInfo("call(java.lang.Process test.expression.Target.returnType4())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
        assertTrue(new ExpressionInfo("call(java.lang.* test.expression.Target.returnType4())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
        assertTrue(new ExpressionInfo("call(java..* test.expression.Target.returnType4())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
        assertTrue(new ExpressionInfo("call(java.*.Process test.expression.Target.returnType4())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
    }
View Full Code Here

                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType4, null)));
    }

    public void testMethodReturnType5() throws Exception {
        assertFalse(new ExpressionInfo("call(void test.expression.Target.returnType5())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType5, null)));
        assertFalse(new ExpressionInfo("call(float test.expression.Target.returnType5())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType5, null)));
        assertFalse(new ExpressionInfo("call(float[] test.expression.Target.returnType5())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType5, null)));
        assertTrue(new ExpressionInfo("call(float[][] test.expression.Target.returnType5())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, returnType5, null)));
        assertTrue(new ExpressionInfo("call(* test.expression.Target.returnType5())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, returnType5, null)));
    }
View Full Code Here

    }

    // ============ method name test =============
    public void testMethodName() throws Exception {
        assertTrue(new ExpressionInfo("call(void test.expression.Target.__method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("call(void test.expression.Target.__method$*())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("call(void test.expression.Target.*Name1())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("call(void test.expression.Target.*$*())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("call(void test.expression.*.__method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("call(void test..*.__method$Name1())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("call(void test..*.*())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertFalse(new ExpressionInfo("call(void test.expression.Target.__Method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertFalse(new ExpressionInfo("call(void test.expression.Target.__method$Name())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertFalse(new ExpressionInfo("call(void test.expression.Target._methodName1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, _method$Name1, null)));
        assertTrue(new ExpressionInfo("execution(* __method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, null)));
        assertTrue(new ExpressionInfo("within(test.expression.Target) && execution(* __method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        //AW-112 below
        assertTrue(new ExpressionInfo("within(test.expression.Target) && execution(* __method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        assertTrue(new ExpressionInfo("execution(* test.expression..*(..)) && execution(* *..Target.__method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        assertTrue(new ExpressionInfo("execution(* test.expression..*.*(..)) && execution(* *..Target.__method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        assertTrue(new ExpressionInfo("execution(* test..*(..)) && execution(* *.expression.Target.__method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        assertTrue(new ExpressionInfo("execution(* test..*.*(..)) && execution(* *.expression.Target.__method$Name1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));

        assertTrue(new ExpressionInfo("execution(* test.expression.Target+.*(..)) && NOT execution(* returnType*(..))", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        assertTrue(new ExpressionInfo("execution(* test.expression.Target+.*(..)) && NOT execution(* returnType*(..))", NAMESPACE).getAdvisedClassFilterExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, _method$Name1, _method$Name1.getDeclaringType())));
        assertFalse(new ExpressionInfo("execution(* test.expression.Target+.*(..)) && NOT execution(* returnType*(..))", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.EXECUTION, returnType1, returnType1.getDeclaringType())));
    }
View Full Code Here

    }

    // ============ method attribute test =============
    public void testMethodAttributes1() throws Exception {
        assertTrue(new ExpressionInfo("call(void test.expression.Target.attributes1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, attributes1, null)));
        assertTrue(new ExpressionInfo("call(@Requires void test.expression.Target.attributes1())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, attributes1, null)));
        assertFalse(new ExpressionInfo("call(@RequiresNew void test.expression.Target.attributes1())", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, attributes1, null)));
        assertFalse(new ExpressionInfo(
            "call(@Requires @RequiresNew void test.expression.Target.attributes1())",
            NAMESPACE).getExpression().match(new ExpressionContext(PointcutType.CALL, attributes1, null)));
    }
View Full Code Here

    }

    // ============ field modifier test =============
    public void testFieldModifiers1() throws Exception {
        assertTrue(new ExpressionInfo("set(int test.expression.Target.modifier1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, modifier1, null)));
        assertFalse(new ExpressionInfo("set(public int test.expression.Target.modifier1)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier1, null)));
        assertFalse(new ExpressionInfo("set(public int test.expression.Target.modifier1)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier1, null)));
    }
View Full Code Here

                .match(new ExpressionContext(PointcutType.SET, modifier1, null)));
    }

    public void testFieldModifiers2() throws Exception {
        assertTrue(new ExpressionInfo("set(int test.expression.Target.modifier2)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, modifier2, null)));
        assertTrue(new ExpressionInfo("set(public int test.expression.Target.modifier2)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier2, null)));
        assertTrue(new ExpressionInfo("set(static public int test.expression.Target.modifier2)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, modifier2, null)));
        assertTrue(new ExpressionInfo("set(static int test.expression.Target.modifier2)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier2, null)));
        assertFalse(new ExpressionInfo("set(protected int test.expression.Target.modifier2)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, modifier2, null)));
    }
View Full Code Here

                .getExpression().match(new ExpressionContext(PointcutType.SET, modifier2, null)));
    }

    public void testFieldModifiers3() throws Exception {
        assertTrue(new ExpressionInfo("set(int test.expression.Target.modifier3)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, modifier3, null)));
        assertTrue(new ExpressionInfo("set(protected int test.expression.Target.modifier3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier3, null)));
        assertTrue(new ExpressionInfo("set(static protected int test.expression.Target.modifier3)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, modifier3, null)));
        assertTrue(new ExpressionInfo("set(static int test.expression.Target.modifier3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier3, null)));
        assertTrue(new ExpressionInfo("set(transient int test.expression.Target.modifier3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier3, null)));
        assertTrue(new ExpressionInfo(
            "set(static transient protected final int test.expression.Target.modifier3)",
            NAMESPACE).getExpression().match(new ExpressionContext(PointcutType.SET, modifier3, null)));
        assertFalse(new ExpressionInfo("set(public int test.expression.Target.modifier3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, modifier3, null)));
    }
View Full Code Here

    //                                                                                                                                  null)));
    //    }
    // ============ field type test =============
    public void testFieldType1() throws Exception {
        assertTrue(new ExpressionInfo("set(int test.expression.Target.type1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type1, null)));
        assertTrue(new ExpressionInfo("set(* test.expression.Target.type1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type1, null)));
        assertFalse(new ExpressionInfo("set(Integer test.expression.Target.type1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type1, null)));
        assertFalse(new ExpressionInfo("set(int[] test.expression.Target.type1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type1, null)));
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.expression.ExpressionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.