热门搜索 :
考研考公
您的当前位置:首页正文

Eclipse配置软件测试环境

来源:伴沃教育
Eclipse配置软件测试环境

1. 先下载这个包

解压文件到eclipse安装路径下面的pluginss文件夹下面

F:\\javaeclispe\\eclipse\\plugins 然后重启eclipse软件

创建一个工程

Test.java packagecom.by.test; publicclass Test { //随便写一个方法 publicint test(inta,intb) { returna+b; } }

TestClass.java packagecom.by.test; importjunit.framework.TestCase; publicclassTestClassextendsTestCase { private Test t = null; protectedvoidsetUp() throws Exception { // 初始化信息的方法 t = new Test(); } protectedvoidtearDown() throws Exception { super.tearDown(); } // 一个测试的方法 publicvoid testMethod1() { // 这个就是来测试Test类里面的方法的方法 // 断言的那个关键字assert assertEquals(t.test(1, 1), 2); // 1+1=2这是正确的 } }

因篇幅问题不能全部显示,请点此查看更多更全内容

Top