返回顶部

工具篇:如何使用junit.jar进行测试

一、网上下载:junit.jar包

下载地址:https://sourceforge.net/projects/junit/?source=typ_redirect

二、导入指定项目中

 

三、在指定方法前使用@Test

 1 package com.xfwl.reflection;
 2 
 3 import org.junit.Test;
 4 /**
 5  * 测试类
 6  * @function  
 7  * @author 小风微凉
 8  * @time  2018-6-3 下午12:28:38
 9  */
10 public class TestAction {
11 
12     @Test
13     public void testGetClass() throws ClassNotFoundException {  
14         System.out.println("123");
15     }
16 }

四、运行方式使用:直接在带有@Test注解的方法上上点击右键 --> run as --> JUnit Test

 

posted @ 2018-06-03 12:39  小风微灵-彦  阅读(457)  评论(0编辑  收藏  举报
加载中……