4.XML指定組中組
@Test(groups={"g2"})
public void test4() {
System.out.println("this is test4");
}
@Test(groups={"g1"})
public void test5() {
System.out.println("this is test5");
}
@Test(groups={"g1","g3"})
public void test10() {
System.out.println("this is test10");
}
XML:
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Suite" parallel="true">
<test name="Test">
<groups>
<define name="fun">
<include name="g3"/>
</define>
<define name="all">
<include name="g.*" />
</define>
<run>
<include name="all" />
</run>
</groups>
<classes>
<class name="test.testng.TestOrder"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->