再一个关于testng的问题......
java -jar myTest.jar
如果我在testng.xml中使用具体的测试类,但是如果我使用包,那么这种方法很好:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="all functional tests" parallel="classes" thread-count="10" verbose="1">
<!-- DOES NOT WORK -->
<test name="exception path">
<packages>
<package name="com.MYFULLPACKAGEPATH.functional.exceptionPath.*" />
</packages>
</test>
<!-- WORKS -->
<test name="failed tests">
<classes>
<class name="com.MYFULLPACKAGEPATH.functional.exceptionPath.FunctionalTest_TaskCreation_WithBadDueDateFormat" />
</classes>
</test>
</suite>
执行使用ant解包的测试工作正常......
有什么建议吗? : - )
THX!
更新
TestNG-XML-Suite-Execution在这样的入门级中完成:
...
final InputStream is = Starter.class.getClassLoader().getResourceAsStream(xmlFileName);
final List<XmlSuite> suite = (List <XmlSuite>)(new Parser(is).parse());
testng.addListener(new EnhancedJunitReporter());
testng.setXmlSuites(suite);
testng.run();
...