Package org.codehaus.aspectwerkz.expression

Examples of org.codehaus.aspectwerkz.expression.ExpressionInfo


        assertFalse(new ExpressionInfo("set(public int test.expression.Target.modifier1)", NAMESPACE).getExpression()
                .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


        assertFalse(new ExpressionInfo("set(protected int test.expression.Target.modifier2)", NAMESPACE)
                .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

    //                                                                                                                                  modifier2,
    //                                                                                                                                  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

        assertFalse(new ExpressionInfo("set(int[] test.expression.Target.type1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type1, null)));
    }

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

        assertTrue(new ExpressionInfo("set(int[][] test.expression.Target.type2)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type2, null)));
    }

    public void testFieldType3() throws Exception {
        assertTrue(new ExpressionInfo("set(String test.expression.Target.type3)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type3, null)));
        assertTrue(new ExpressionInfo("set(java.lang.String test.expression.Target.type3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type3, null)));
        assertFalse(new ExpressionInfo("set(java.lang.string test.expression.Target.type3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type3, null)));
        assertTrue(new ExpressionInfo("set(java..* test.expression.Target.type3)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type3, null)));
        assertTrue(new ExpressionInfo("set(java.*.String test.expression.Target.type3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type3, null)));
        assertTrue(new ExpressionInfo("set(java.lang.String* test.expression.Target.type3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type3, null)));
        assertTrue(new ExpressionInfo("set(* test.expression.Target.type3)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type3, null)));
        assertFalse(new ExpressionInfo("set(StringBuffer test.expression.Target.type3)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type3, null)));
        assertFalse(new ExpressionInfo("set(java.lang.StringBuffer test.expression.Target.type3)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, type3, null)));
        assertFalse(new ExpressionInfo("set(String[] test.expression.Target.type3)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type3, null)));
        assertFalse(new ExpressionInfo("set(java.lang.String[] test.expression.Target.type3)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, type3, null)));
    }
View Full Code Here

        assertFalse(new ExpressionInfo("set(java.lang.String[] test.expression.Target.type3)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, type3, null)));
    }

    public void testFieldType4() throws Exception {
        assertFalse(new ExpressionInfo("set(String test.expression.Target.type4)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type4, null)));
        assertFalse(new ExpressionInfo("set(java.lang.String test.expression.Target.type4)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type4, null)));
        assertTrue(new ExpressionInfo("set(String[] test.expression.Target.type4)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type4, null)));
        assertTrue(new ExpressionInfo("set(java.lang.String[] test.expression.Target.type4)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, type4, null)));
        assertTrue(new ExpressionInfo("set(* test.expression.Target.type4)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type4, null)));
        assertFalse(new ExpressionInfo("set(String[][] test.expression.Target.type4)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, type4, null)));
        assertFalse(new ExpressionInfo("set(int[] test.expression.Target.type4)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, type4, null)));
    }
View Full Code Here

            new ExpressionContext(PointcutType.SET, type4, null)));
    }

    // ============ field name test =============
    public void testFieldName() throws Exception {
        assertTrue(new ExpressionInfo("set(int test.expression.Target.__field$Name1)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertFalse(new ExpressionInfo("set(int test.expression.Target.field$Name1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertTrue(new ExpressionInfo("set(int test.expression.Target.__*$Name*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertTrue(new ExpressionInfo("set(int test.expression.Target.__field*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertTrue(new ExpressionInfo("set(int test.expression.*.__field$Name1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertTrue(new ExpressionInfo("set(int test..Target.__field$Name1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertTrue(new ExpressionInfo("set(int test..*.__field$Name1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertFalse(new ExpressionInfo("set(int test..*.__fieldName1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        // AW-112 below
        assertTrue(new ExpressionInfo("within(test.expression.Target) && set(int __field$Name1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));
        assertTrue(new ExpressionInfo("within(*.expression.Target) && set(int test..__field$Name1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, _field$Name1, null)));

    }
View Full Code Here

    }

    // ============ field attribute test =============
    public void testFieldAttributes1() throws Exception {
        assertTrue(new ExpressionInfo("set(int test.expression.Target.attribute1)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.SET, attribute1, null)));
        assertTrue(new ExpressionInfo("set(@ReadOnly int test.expression.Target.attribute1)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, attribute1, null)));
        assertFalse(new ExpressionInfo("set(@Read int test.expression.Target.attribute1)", NAMESPACE).getExpression()
                .match(new ExpressionContext(PointcutType.SET, attribute1, null)));
        assertFalse(new ExpressionInfo("set(@ReadOnly @ReadWrite int test.expression.Target.attribute1)", NAMESPACE)
                .getExpression().match(new ExpressionContext(PointcutType.SET, attribute1, null)));
    }
View Full Code Here

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

    // ============ class modifier test =============
    public void testClassModifier() throws Exception {
        assertTrue(new ExpressionInfo("within(test.expression.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(public test.expression.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertFalse(new ExpressionInfo("within(protected test.expression.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(final public test.expression.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));

        //        assertFalse(
        //                new ExpressionInfo( "within(abstract test.expression.Target)", NAMESPACE).
        //                getExpression().parse(new ExpressionContext( PointcutType.HANDLER, klass, klass))
View Full Code Here

        //        );
    }

    // ============ class type test =============
    public void testClassType() throws Exception {
        assertTrue(new ExpressionInfo("within(test.expression.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.ANY, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(..)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(public *)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(test.*.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(test.expression.*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(test.expression.Tar*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(test.expression.T*et)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(test..*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertTrue(new ExpressionInfo("within(*.expression.*)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertFalse(new ExpressionInfo("within(test.expression.target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertFalse(new ExpressionInfo("within(test.expression.Targett)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
        assertFalse(new ExpressionInfo("within(test.*.*.Target)", NAMESPACE).getExpression().match(
            new ExpressionContext(PointcutType.HANDLER, s_declaringType, s_declaringType)));
    }
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.