public class c1 {
@Test(groups ={"first","third"})
public void p1_c1_1()
{
System.out.println("p1_c1_1");
}
@Test(groups ="second")
public void p1_c1_2(){
System.out.println("p1_c1_2");
}
@Test(groups ="third")
public void p1_c1_3(){
System.out.println("p1_c1_3");
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite One" allow-return-values="true" verbose="1">
<test name="Test One">
<groups>
<define name="all">
<include name="first" />
<exclude name="second"/>
<exclude name="third"/>
</define>
<run>
<include name="all" />
</run>
</groups>
<classes>
<class name="c1" />
</classes>
</test>
</suite>
如果我運行這個testNg文件我得到p1_c1_1打印,我不能因爲它在兩個組「第一」和「第二」。所以儘管p1_c1_1被包含在名爲「first」的組中,但它仍處於被排除的組中,名爲「third」,因此從技術上講該方法不應執行。我想知道如何排除這是一種方法下,兩組的羣體之一包含的排除多個組TestNG