简体   繁体   English

蚂蚁junit批测试

[英]Ant junit batchtest

我有我的junit测试类。我正在用ant运行这些类。我正在使用批处理属性,其参数包括include =“ * / Test * .class”,但是我有一些名称类似* test *的类,其中不包含任何测试方法,当我运行它会给出错误“未找到测试”。是否有一个选项,例如是否在类中没有测试然后跳过?

To answer the question you need to supply a better pattern. 要回答这个问题,您需要提供更好的模式。

Potential solution: 潜在的解决方案:

Refactor all legitimate test classes to BEGIN with the prefix Test and than change the ant script to this: 将所有合法的测试类重构为带有前缀Test BEGIN ,然后将ant脚本更改为:

includes="*/Test*.class"

Why do you have classes with the name "Test" in them that aren't tests? 为什么在其中有不是测试的名称为“ Test”的类? I highly recommend following a naming convention that puts Test at the beginning and removing test from your file names that are in fact not tests. 我强烈建议下我们可以从这个命名约定Test在开始和移除test从实际上不是测试你的文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM