Package org.easetech.easytest.annotation

Examples of org.easetech.easytest.annotation.Intercept.interceptor()


        protected void instrumentClass(Class<?> testClass) throws IllegalArgumentException, IllegalAccessException, AopConfigException, InstantiationException{
            Field[] fields = testClass.getFields();
            for(Field field : fields){
                Intercept interceptor = field.getAnnotation(Intercept.class);
                if(interceptor != null){
                    Class<? extends MethodInterceptor> interceptorClass = interceptor.interceptor();
                    //This is the field we want to enhance
                    Object fieldInstance = field.get(testInstance);
                    ProxyFactory factory = new ProxyFactory();
                    factory.setTarget(fieldInstance);
                    factory.addAdvice(interceptorClass.newInstance());
View Full Code Here


        protected void instrumentClass(Class<?> testClass) throws IllegalArgumentException, IllegalAccessException, AopConfigException, InstantiationException{
            Field[] fields = testClass.getFields();
            for(Field field : fields){
                Intercept interceptor = field.getAnnotation(Intercept.class);
                if(interceptor != null){
                    Class<? extends MethodInterceptor> interceptorClass = interceptor.interceptor();
                    //This is the field we want to enhance
                    Object fieldInstance = field.get(testInstance);
                    ProxyFactory factory = new ProxyFactory();
                    factory.setTarget(fieldInstance);
                    factory.addAdvice(interceptorClass.newInstance());
View Full Code Here

        Field[] fields = testClass.getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true);
            Intercept interceptor = field.getAnnotation(Intercept.class);
            if (interceptor != null) {
                provideProxyWrapperFor(interceptor.interceptor(), null, field, testInstance);
            } else {
                Duration duration = field.getAnnotation(Duration.class);
                if (duration != null) {
                    provideProxyWrapperFor(duration.interceptor(), duration.timeInMillis(), field, testInstance);
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.