Test class should have exactly one public constructor解决办法

Test class should have exactly one public constructor解决办法

今天配置重新配置hudson,跑单测统计覆盖率的时候,一堆用jmockit的单测方法都失败了,并且都报错:

Error Message
Test class should have exactly one public constructor

Stacktrace
java.lang.Exception: Test class should have exactly one public constructor
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)


后面这个$很奇怪,像是内部类的样子,后来在网上查了一下,果然是。因为我在ant脚本里面配置需要跑的单测包含:

 
      
              
      

**/*Test*.java,就包含了子类,所以应该再添加一句:

 
 
其实最好还是使用

就是以Test结尾,是标准的。




你可能感兴趣的:(小疑难小杂症)