本文整理了Java中org.testng.TestNG.setExcludedGroups()
方法的一些代码示例,展示了TestNG.setExcludedGroups()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestNG.setExcludedGroups()
方法的具体详情如下:
包路径:org.testng.TestNG
类名称:TestNG
方法名:setExcludedGroups
[英]Define which groups will be excluded from this run.
[中]定义将从此运行中排除的组。
代码示例来源:origin: cbeust/testng
private void runTest(String group, String excludedGroups, List<String> methods) {
XmlSuite s = createXmlSuite(getClass().getName());
createXmlTest(s, "Test", OverrideSampleTest.class.getName());
TestNG tng = create();
if (group != null) tng.setGroups(group);
if (excludedGroups != null) tng.setExcludedGroups(excludedGroups);
tng.setXmlSuites(Collections.singletonList(s));
TestListenerAdapter tla = new TestListenerAdapter();
tng.addListener(tla);
tng.run();
assertTestResultsEqual(tla.getPassedTests(), methods);
}
代码示例来源:origin: cbeust/testng
private void runTest(String include, String exclude) {
File f = Utils.createTempFile(
"<suite name=\"S\">"
+ " <test name=\"T\">"
+ " <classes>"
+ " <class name=\"test.override.OverrideSampleTest\" />"
+ " </classes>"
+ " </test>"
+ "</suite>"
);
TestNG tng = create();
TestListenerAdapter tla = new TestListenerAdapter();
tng.addListener((ITestNGListener) tla);
if (include != null) tng.setGroups(include);
if (exclude != null) tng.setExcludedGroups(exclude);
tng.setTestSuites(Collections.singletonList(f.getAbsolutePath()));
tng.run();
Assert.assertEquals(tla.getPassedTests().size(), 1);
}
代码示例来源:origin: org.testng/testng
setExcludedGroups(cla.excludedGroups);
setTestJar(cla.testJar);
setXmlPathInJar(cla.xmlPathInJar);
代码示例来源:origin: cbeust/testng
} else {
tng.setGroups(Joiner.on(',').join(suiteGroups));
tng.setExcludedGroups(Joiner.on(',').join(excludedSuiteGroups));
代码示例来源:origin: cbeust/testng
setExcludedGroups(cla.excludedGroups);
setTestJar(cla.testJar);
setXmlPathInJar(cla.xmlPathInJar);
代码示例来源:origin: infinitest/infinitest
private void applyConfig(TestNG core, TestNGConfiguration config) {
core.setExcludedGroups(config.getExcludedGroups());
core.setGroups(config.getGroups());
if (config.getListeners() != null) {
for (Object listener : config.getListeners()) {
core.addListener(listener);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!