我正在尝试从Ant运行TestNG测试.阅读the manual, I came up with后:
verbose="5"
failureProperty="tests.failed" outputdir="/tmp/report">
当我运行它失败时:
[testng] 'org.testng.TestNG'
[testng] '@/tmp/testng8260935716887369607'
[testng]
[testng] The ' characters around the executable and arguments are
[testng] not part of the command.
[testng] Exception in thread "main" org.testng.TestNGException:
[testng] Cannot load class from file: /home/adamatan/SOME_PATH_THAT_EXISTS/functional/EnforceBasicFilteringTest.class
[testng] at org.testng.internal.ClassHelper.fileToClass(ClassHelper.java:600)
[testng] at org.testng.TestNG.configure(TestNG.java:1393)
[testng] at org.testng.TestNG.privateMain(TestNG.java:1354)
[testng] at org.testng.TestNG.main(TestNG.java:1333)
[testng] The tests failed.
我已经尝试过的:
文件和权限:
/home/adamatan/SOME_PATH_THAT_EXISTS/functional/EnforceBasicFilteringTest.class:
>出现在类路径打印输出中(它很长,所以我不把它放在这里).
>由编译目标创建,因此它是非空的,并且ant可以读取其内容.
> ls -l-ing文件给出-rw-r – r– 1 adamatan用户4548 11月21日12:19
模式类型:
试过testng mode =“testng”和testng mode =“mixed”.两者都失败了同样的错误.
为什么testng不能读取刚刚创建的有效类文件?