码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-06-03 14:34:23      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:cti   redirect   test   port   div   direct   org   action   项目   

一、网上下载: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

技术分享图片

 

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

标签:cti   redirect   test   port   div   direct   org   action   项目   

原文地址:https://www.cnblogs.com/newwind/p/9128768.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!