0
任何想法为什么TestNG未运行我的测试? 这是类代码(JAVA):TestNG未在eclipse上运行测试
public class main {
@Test
public static void main(String[] args) throws AWTException, InterruptedException
这是基于Eclipse的路径: enter image description here
,这是XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test">
<classes>
<class name="test.main"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
你不应该为你的测试代码需要'main()'方法,而且我的猜测是试图使用一个方法完全绕过了TestNG。 – jsheeran
我不确定'@ Test'方法是否可以有参数。无论如何,当你的测试方法运行时,它会从哪里得到'args'的值?补充说:他们可以,但也许你没有遵循这个规则,http://testng.org/doc/documentation-main.html#test-methods(见5.6)。 – SantiBailors
从main方法中移除String数组参数并尝试。它可能有效 – Murthi