org.testng.TestNG.setExcludedGroups()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.testng.TestNG.setExcludedGroups()方法的一些代码示例,展示了TestNG.setExcludedGroups()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestNG.setExcludedGroups()方法的具体详情如下:
包路径:org.testng.TestNG
类名称:TestNG
方法名:setExcludedGroups

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);
    }
  }
}

相关文章

TestNG类方法