想问下,运行mvn test后,提示虽然有BUILD SUCCESS但是也有Tests run :0,failures:0,Errors:0这样到底有测试吗?
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ tryAgain ---
[INFO] Packaging webapp
[INFO] Assembling webapp [tryAgain] in [C:UsersMISDesktoptwicetargettryAgain]
[INFO] Processing war project
[INFO] Copying webapp resources [C:UsersMISDesktoptwicesrcmainwebapp]
[INFO] Webapp assembled in [569 msecs]
[INFO] Building war: C:UsersMISDesktoptwicetargettryAgain.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.290s
[INFO] Finished at: Mon Aug 24 12:37:39 CST 2015
[INFO] Final Memory: 9M/113M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
郁闷之际查了一下maven参考资料,发现原来是surefire插件的默认行为所致。maven是使用surefire插件执行测试的,它按照指定格式的类名来查找匹配的测试类,
因此默认情况下,诸如“add_exist_department.java”或者“add_exist_departmentTests.java”这种JUnit类是不会被Maven发现并执行的,可按如下修改surefire插件的配置以达到包含"**/*Tests.java"测试类的目的:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
<excludes>
<exclude>**/Abstract*.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
注解过了,还是谢谢~~
方法上是否有test注解,或者配置有错误,检查一下
这个注解我有写的,不是这个的问题。还是谢谢喔
@Test ??
可是我的test文件夹是有测试方法的,为甚么会出现测试0个方法?
测试了,不过共测试了0个方法。
如果配置了skip test,输出结果类似这样
这就是没有测试。