Package org.codehaus.aspectwerkz.expression

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo


            "call(void test.expression.Target.parameters3(String, StringBuffer, String, *))",
            NAMESPACE).getExpression().match(new ExpressionContext(PointcutType.CALL, parameters3, null)));
    }

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


        assertFalse(new ExpressionInfo("call(void test.expression.Target.parameters4(Object[][]))", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.CALL, parameters4, null)));
    }

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

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

    // ============ method return type test =============
    public void testMethodReturnType1() throws Exception {
        assertTrue(new ExpressionInfo("call(void test.expression.Target.returnType1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType1, null)));
        assertFalse(new ExpressionInfo("call(String test.expression.Target.returnType1())", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.CALL, returnType1, null)));
        assertTrue(new ExpressionInfo("call(* test.expression.Target.returnType1())", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.CALL, returnType1, null)));
    }
View Full Code Here

        assertTrue(new ExpressionInfo("call(* test.expression.Target.returnType1())", NAMESPACE).getExpression().match(
            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

        assertFalse(new ExpressionInfo("call(int[] test.expression.Target.returnType2())", NAMESPACE).getExpression()
                .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

        assertFalse(new ExpressionInfo("call(java.lang.StringBuffer test.expression.Target.returnType3())", NAMESPACE)
                .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

        assertTrue(new ExpressionInfo("call(java.*.Process test.expression.Target.returnType4())", NAMESPACE)
                .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

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

    // ============ 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

                .match(new ExpressionContext(PointcutType.EXECUTION, returnType1, returnType1.getDeclaringType())));
    }

    // ============ 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

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

    // ============ 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

TOP

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

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.