在testng.xml中引用测试组

时间:2016-12-01 09:55:15

标签: java testng

假设我在TestNG中使用测试组注释了我的测试类:

FATAL distributedshell.ApplicationMaster: Error running ApplicationMaster
org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --jar
    at org.apache.commons.cli.Parser.processOption(Parser.java:363)
    at org.apache.commons.cli.Parser.parse(Parser.java:199)
    at org.apache.commons.cli.Parser.parse(Parser.java:85)
    at org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster.init(ApplicationMaster.java:377)
    at org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster.main(ApplicationMaster.java:298)

有没有办法在testng.xml中引用这个组?这样的事情(如果实施的话):

@Test(group='smoke-tests')
public class CheckEnvironmentTest {
...
}

1 个答案:

答案 0 :(得分:2)

您可能想要做这样的事情

<test name="sample">
    <groups>
        <run>
            <include name="smoke-tests"/>
        </run>
    </groups>
    <classes>
        <class name="CheckEnvironmentTest"/>
    </classes>
</test>