奇怪的JUnit4 不能认识@Test么?

来源:互联网 发布:mac怎么清理磁盘空间 编辑:程序博客网 时间:2024/06/06 03:57

代码如下 很简单的几行

可是JUnit总是报错 说  no tests found in XXX

郁闷啊  明明加了 @Test 啊

import org.junit.Test;
import junit.framework.TestCase;

public class HelloTest extends TestCase {
         private String strHello;
 

 @Test
 public void SayTest(){
          Hello h = new Hello();
          assertEquals(strHello, h.say());
 }
 
 public static void main(String[] args) {
          junit.textui.TestRunner.run(HelloTest.class);
 }
}


 

原创粉丝点击