本文整理了Java中org.testng.TestNG.setJUnit()
方法的一些代码示例,展示了TestNG.setJUnit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestNG.setJUnit()
方法的具体详情如下:
包路径:org.testng.TestNG
类名称:TestNG
方法名:setJUnit
[英]Specify if this run should be made in JUnit mode
[中]指定此运行是否应在JUnit模式下进行
代码示例来源:origin: cbeust/testng
@Test
public void testMethod() {
TestNG testng = create(Issue323TestSample.class);
Issue323JUnitInvocationListener listener = new Issue323JUnitInvocationListener();
testng.addListener((ITestNGListener) listener);
testng.setJUnit(true);
testng.run();
assertThat(Issue323JUnitInvocationListener.messages).containsExactly("beforeInvocation", "afterInvocation");
}
}
代码示例来源:origin: cbeust/testng
private Listener runJunitTest(String src, String name) throws Exception {
TestNG tng = new TestNG(false);
Class<?> testClass = compile(src, name);
Listener listener = new Listener();
tng.setJUnit(true);
tng.addClassLoader(testClass.getClassLoader());
assertNotEquals(testClass.getClassLoader(), this.getClass().getClassLoader(),
"JUnit test must be loaded by a different classloader");
try {
this.getClass().getClassLoader().loadClass(testClass.getName());
fail("it must be imposiible to load JUnit test by current classloader");
} catch (ClassNotFoundException c) {
}
tng.setTestClasses(new Class<?>[]{testClass});
tng.addListener(listener);
tng.run();
return listener;
}
代码示例来源:origin: org.testng/testng
setTestJar(cla.testJar);
setXmlPathInJar(cla.xmlPathInJar);
setJUnit(cla.junit);
setMixed(cla.mixed);
setSkipFailedInvocationCounts(cla.skipFailedInvocationCounts);
代码示例来源:origin: cbeust/testng
setTestJar(cla.testJar);
setXmlPathInJar(cla.xmlPathInJar);
setJUnit(cla.junit);
setMixed(cla.mixed);
setSkipFailedInvocationCounts(cla.skipFailedInvocationCounts);
内容来源于网络,如有侵权,请联系作者删除!