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

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

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

TestNG.addMethodSelector介绍

暂无

代码示例

代码示例来源:origin: cbeust/testng

private void runTest(int priority, String[] passedTests) {
 TestNG tng = new TestNG();
 tng.setVerbose(0);
 tng.setTestClasses(new Class[] { PrioritySampleTest.class });
 tng.addMethodSelector("test.methodselectors.NoTestSelector", priority);
 TestListenerAdapter tla = new TestListenerAdapter();
 tng.addListener((ITestNGListener) tla);
 tng.run();
 List<ITestResult> passed = tla.getPassedTests();
 Assert.assertEquals(passedTests.length, passed.size());
 if (passedTests.length == 1) {
  String passed0 = passed.get(0).getName();
  Assert.assertEquals(passed0, passedTests[0]);
 }
 if (passedTests.length == 2) {
  String passed0 = passed.get(0).getName();
  String passed1 = passed.get(1).getName();
  Assert.assertTrue(passed0.equals(passedTests[0]) || passed0.equals(passedTests[1]));
  Assert.assertTrue(passed1.equals(passedTests[0]) || passed1.equals(passedTests[1]));
 }
}

代码示例来源:origin: org.testng/testng

addMethodSelector(methodSelector.getClassName(), methodSelector.getPriority());
addMethodSelector(methodSelector);

代码示例来源:origin: org.testng/testng

try {
 if (sel.length == 2) {
  addMethodSelector(sel[0], Integer.parseInt(sel[1]));
 } else {
  error("Method selector value was not in the format org.example.Selector:4");

代码示例来源:origin: cbeust/testng

addMethodSelector(methodSelector.getClassName(), methodSelector.getPriority());
addMethodSelector(methodSelector);

代码示例来源:origin: cbeust/testng

try {
 if (sel.length == 2) {
  addMethodSelector(sel[0], Integer.parseInt(sel[1]));
 } else {
  error("Method selector value was not in the format org.example.Selector:4");

代码示例来源:origin: prestodb/tempto

private void setupTestsFiltering(TestNG testNG)
{
  if (!options.getTestGroups().isEmpty()) {
    System.setProperty(TEST_GROUPS_TO_RUN_PROPERTY, Joiner.on(',').join(options.getTestGroups()));
  }
  if (!options.getExcludeGroups().isEmpty()) {
    System.setProperty(TEST_GROUPS_TO_EXCLUDE_PROPERTY, Joiner.on(',').join(options.getExcludeGroups()));
  }
  if (!options.getTests().isEmpty()) {
    System.setProperty(TEST_NAMES_TO_RUN_PROPERTY, Joiner.on(',').join(options.getTests()));
  }
  testNG.addMethodSelector(METHOD_SELECTOR_CLASS_NAME, METHOD_SELECTOR_PRIORITY);
}

相关文章

TestNG类方法