Package org.codehaus.aspectwerkz.metadata

Examples of org.codehaus.aspectwerkz.metadata.MethodMetaData$NullMethodMetaData


    public void testMatchHierachicalExpression_EXECUTION() {
        try {
            Expression root = space.createExpression("* *..TestCase+.set(..)", PointcutType.EXECUTION);
            ClassMetaData classMetaData1 = ReflectionMetaDataMaker.createClassMetaData(ExpressionTest.class);
            ClassMetaData classMetaData2 = ReflectionMetaDataMaker.createClassMetaData(ExpressionException.class);
            MethodMetaData methodMetaData1 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("set", new Class[]{})
            );
            MethodMetaData methodMetaData2 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("get", new Class[]{})
            );
            assertTrue(root.match(classMetaData1));
            assertTrue(root.match(classMetaData1, methodMetaData1));
            assertFalse(root.match(classMetaData2));
View Full Code Here


        try {
            Expression root = space.createExpression(
                    "java.lang.Object+->* *..ExpressionTest.suite(..)", PointcutType.CALL
            );
            ClassMetaData classMetaData1 = ReflectionMetaDataMaker.createClassMetaData(ExpressionTest.class);
            MethodMetaData methodMetaData1 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("set", new Class[]{})
            );
            MethodMetaData methodMetaData2 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("get", new Class[]{})
            );
            MethodMetaData methodMetaData3 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("suite", new Class[]{})
            );
            assertTrue(root.match(classMetaData1));
            assertFalse(root.match(classMetaData1, methodMetaData1));
            assertFalse(root.match(classMetaData1, methodMetaData2));
View Full Code Here

    public void testMatchCalleeHierachicalExpression_CALL() {
        try {
            Expression root = space.createExpression("*->* *..TestCase+.suite(..)", PointcutType.CALL);
            ClassMetaData classMetaData1 = ReflectionMetaDataMaker.createClassMetaData(ExpressionTest.class);
            MethodMetaData methodMetaData1 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("set", new Class[]{})
            );
            MethodMetaData methodMetaData2 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("get", new Class[]{})
            );
            MethodMetaData methodMetaData3 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("suite", new Class[]{})
            );
            assertTrue(root.match(classMetaData1));
            assertFalse(root.match(classMetaData1, methodMetaData1));
            assertFalse(root.match(classMetaData1, methodMetaData2));
View Full Code Here

    public void testMatchDoubleHierachicalExpression_CALL() {
        try {
            Expression root = space.createExpression("java.lang.Object+->* *..TestCase+.suite(..)", PointcutType.CALL);
            ClassMetaData classMetaData1 = ReflectionMetaDataMaker.createClassMetaData(ExpressionTest.class);
            MethodMetaData methodMetaData1 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("set", new Class[]{})
            );
            MethodMetaData methodMetaData2 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("get", new Class[]{})
            );
            MethodMetaData methodMetaData3 = ReflectionMetaDataMaker.createMethodMetaData(
                    ExpressionTest.class.getDeclaredMethod("suite", new Class[]{})
            );
            assertTrue(root.match(classMetaData1));
            assertFalse(root.match(classMetaData1, methodMetaData1));
            assertFalse(root.match(classMetaData1, methodMetaData2));
View Full Code Here

            final TObjectIntHashMap methodSequences = new TObjectIntHashMap();
            final List sorteMethodTuples = new ArrayList(sortedMethods.size());
            for (Iterator methodsIt = sortedMethods.iterator(); methodsIt.hasNext();) {
                CtMethod method = (CtMethod)methodsIt.next();
                MethodMetaData methodMetaData = JavassistMetaDataMaker.createMethodMetaData(method);

                int sequence = 1;
                if (methodSequences.containsKey(method.getName())) {
                    sequence = methodSequences.get(method.getName());
                    methodSequences.remove(method.getName());
View Full Code Here

                                catch (RuntimeException e) {
                                    // <clinit> access leads to a bug in Javassist
                                    where = ctClass.getClassInitializer();
                                }

                                MethodMetaData methodMetaData = null; //JavassistMetaDataMaker.createMethodMetaData(...);

                                ClassMetaData exceptionClassMetaData = JavassistMetaDataMaker.createClassMetaData(
                                        exceptionClass
                                );
View Full Code Here

                                catch (NotFoundException e) {
                                    throw new WrappedRuntimeException(e);
                                }

                                // create the method meta-data
                                MethodMetaData calleeSideMethodMetaData = JavassistMetaDataMaker.createMethodMetaData(
                                        methodCall.getMethod()
                                );

                                // is this a caller side method pointcut?
                                if (definition.isPickedOutByCallPointcut(
View Full Code Here

                if (methodName.equals(mg.getMethod().getName()) &&
                        className.equals(superClassName)) {
                    JavaClass superClass = context.getSuperClass(cg);
                    Method[] methods = superClass.getMethods();
                    MethodMetaData methodMetaData = null;
                    for (int i = 0; i < methods.length; i++) {
                        Method method = methods[i];
                        if (method.getSignature().equals(signature) && method.getName().equals(methodName)) {
                            methodMetaData = BcelMetaDataMaker.createMethodMetaData(method);
                            break;
View Full Code Here

                method.getName().equals(TransformationUtil.CLASS_LOOKUP_METHOD) ||
                method.getName().equals(TransformationUtil.GET_UUID_METHOD)) {
            uuid = null;
        }
        else {
            MethodMetaData methodMetaData = BcelMetaDataMaker.createMethodMetaData(method);
            if (m_definition.hasMethodPointcut(classMetaData, methodMetaData)) {
                uuid = m_definition.getUuid();
            }
            if (m_definition.hasThrowsPointcut(classMetaData, methodMetaData)) {
                uuid = m_definition.getUuid();
View Full Code Here

                    catch (ClassNotFoundException e) {
                        throw new WrappedRuntimeException(e);
                    }

                    // create the method meta-data
                    MethodMetaData calleeSideMethodMetaData =
                            BcelMetaDataMaker.createMethodMetaData(invokeInstruction, cpg);

                    // is this a caller side method pointcut?
                    if (m_definition.isCallerSideMethod(
                            calleeSideClassMetaData,
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.metadata.MethodMetaData$NullMethodMetaData

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.