从零写一个具有IOCAOPMVC功能的框架学习笔记08框架的AOP功能测试

1. 本章内容

  1. 在这一章咱们会对框架的IOC以及AOP的性能进行测试

2. 编写相干的测试类

2.1 编写咱们须要被加强的类:AspectTarget

2.1.1 须要实现的代码如下
package com.wuyiccc.demo.aop;

import com.wuyiccc.helloframework.core.annotation.Component;
import lombok.extern.slf4j.Slf4j;

/**
 * @author wuyiccc
 * @date 2020/7/14 15:39
 * 岂曰无衣,与子同袍~
 */
@Component
@Slf4j
public class AspectTarget {

    public void testRight() {
        log.info("AspectTarget#Right()办法执行!");
    }


    public void testThrowing() {
        log.info("AspectTarget#testThrowing()办法执行");
        throw new RuntimeException();
    }

}
2.1.2 AspectTarget图示:

2.2 编写切面类:

2.2.1 代码图示如下:

2.3 编写须要被依赖注入的类: IocTest

3. 开始测试


github地址:https://github.com/wuyiccc/he…

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理