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

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

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

TestNG.getStatus介绍

暂无

代码示例

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

/**
 * The TestNG entry point for command line execution.
 *
 * @param argv the TestNG command line parameters.
 * @throws FileNotFoundException
 */
public static void main(String[] argv) {
 TestNG testng = privateMain(argv, null);
 System.exit(testng.getStatus());
}

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

/**
 * The TestNG entry point for command line execution.
 *
 * @param argv the TestNG command line parameters.
 */
public static void main(String[] argv) {
 TestNG testng = privateMain(argv, null);
 System.exit(testng.getStatus());
}

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

@Test(description = "GITHUB-1810")
public void ensureNoNullPointerExceptionIsThrown() throws IOException {
 TestNG testng = TestNG.privateMain(new String[] {createTemporarySuiteAndGetItsPath()}, null);
 assertThat(testng.getStatus()).isEqualTo(8);
}

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

@Test(dataProvider = "getData")
public void testMethod(Class<?> clazz, int expectedStatus) {
 TestNG testNG = create(clazz);
 testNG.run();
 Assert.assertEquals(testNG.getStatus(), expectedStatus);
}

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

@Test
public void exitsWithZeroOnSuccess() {
 TestNG tng = create(ImmediateSuccess.class);
 tng.run();
 assertEquals(tng.getStatus(), 0);
}

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

@Test
public void exitsWithNonzeroOnFailure() {
 TestNG tng = create(PersistentFailure.class);
 tng.run();
 assertTrue(tng.getStatus() != 0);
}

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

@Test(description = "GITHUB-217")
public void exitWithNonzeroOnSkips1() {
 TestNG tng = create(Issue217TestClassSampleWithOneDataProvider.class);
 tng.run();
 assertEquals(tng.getStatus(), 2);
}

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

@Test
public void testMainMethodExclusion() {
 TestNG tng = create(TestClassSample.class);
 tng.run();
 Assert.assertEquals(tng.getStatus(), 0);
}

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

@Test(description = "GITHUB-217")
public void exitWithNonzeroOnSkips() {
 TestNG tng = create(Issue217TestClassSample.class);
 tng.run();
 assertEquals(tng.getStatus(), 2);
}

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

@Test(dataProvider = "dp")
public void testMethod(Class<?> clazz) {
 TestNG testNG = create(clazz);
 testNG.setParallel(XmlSuite.ParallelMode.METHODS);
 testNG.run();
 assertThat(testNG.getStatus()).isEqualTo(0);
}

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

@Test(priority = 1)
public void verifyWithoutListener() {
  TestNG testNG = create();
  testNG.setTestSuites(Collections.singletonList(getPathToResource("test/listeners/github1284/github1284_nolistener.xml")));
  testNG.run();
  Assert.assertEquals(testNG.getStatus(), 0);
}

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

@Test(priority = 3)
public void verifyWithChildSuite() {
  TestNG testNG = create();
  testNG.setTestSuites(Collections.singletonList(getPathToResource("test/listeners/github1284/github1284.xml")));
  testNG.run();
  Assert.assertEquals(testNG.getStatus(), 0);
}

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

@Test(priority = 2)
public void verifyWithListener() {
  TestNG testNG = create();
  testNG.setTestSuites(Collections.singletonList(getPathToResource("test/listeners/github1284/github1284_withlistener.xml")));
  testNG.run();
  Assert.assertEquals(testNG.getStatus(), 0);
}

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

@Test
public void exitsWithZeroAfterSuccessfulRetry() {
 TestNG tng = create(EventualSuccess.class);
 tng.addListener((ITestNGListener) new TestResultPruner());
 tng.run();
 assertEquals(tng.getStatus(), 0);
}

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

@Test
 public void testMainMethodExclusionForJunit() {
  XmlSuite xmlSuite = createXmlSuite("suite");
  xmlSuite.setJunit(true);
  createXmlTest(xmlSuite, "test", JUnitTestClassSample.class);
  TestNG tng = create(xmlSuite);
  tng.run();
  Assert.assertEquals(tng.getStatus(), 0);
 }
}

代码示例来源:origin: org.w3/ldp-testsuite

public int getStatus() {
  return testng.getStatus();
}

相关文章

TestNG类方法