当前位置: 代码迷 >> Eclipse >> MyEclipse junit测试窗口有关问题!
  详细解决方案

MyEclipse junit测试窗口有关问题!

热度:531   发布时间:2016-04-23 18:56:07.0
MyEclipse junit测试窗口问题!!!!
普通类
package cn.zt.a1;
public class T {
public int add(int x, int y) {
return x + y;
}

public static void main(String[] args) {
int z = new T().add(3, 5);
System.out.println(z);
}
}
测试类

package c.zt.test;

import static org.junit.Assert.*;
import org.junit.Test;
import cn.zt.a1.T;

public class TTest {
@Test
public void testAdd() {
int z = new T().add(5, 3);
assertEquals(8,z);
}

}

测试的时候,junit没测试窗口有反映!



------解决方案--------------------
用junit测试 其测试类应继承TestCase 并应该有public static void Test() {}类方法
------解决方案--------------------
探讨

用junit测试 其测试类应继承TestCase 并应该有public static void Test() {}类方法
  相关解决方案