本文整理了Java中org.testng.TestNG.setSuiteThreadPoolSize()
方法的一些代码示例,展示了TestNG.setSuiteThreadPoolSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestNG.setSuiteThreadPoolSize()
方法的具体详情如下:
包路径:org.testng.TestNG
类名称:TestNG
方法名:setSuiteThreadPoolSize
暂无
代码示例来源:origin: cbeust/testng
@Test(description = "Number of threads (2) is less than number of suites (3)")
public void suitesShouldRunInParallel3() {
final int SUITE_THREAD_POOL_SIZE = 2;
TestListenerAdapter tla = new TestListenerAdapter();
TestNG tng = create();
tng.setSuiteThreadPoolSize(SUITE_THREAD_POOL_SIZE);
tng.setTestSuites(Collections.singletonList(getPathToResource("suite-parallel-0.xml")));
tng.addListener((ITestNGListener) tla);
BaseThreadTest.initThreadLog();
tng.run(); //Shouldn't not deadlock
Assert.assertEquals(BaseThreadTest.getThreadCount(), SUITE_THREAD_POOL_SIZE);
}
代码示例来源:origin: cbeust/testng
private void runTest(int suiteThreadPoolSize, int expectedThreadCount,
int expectedSuiteCount, Boolean randomizeSuites, List<String> paths) {
TestListenerAdapter tla = new TestListenerAdapter();
TestNG tng = create();
tng.setSuiteThreadPoolSize(suiteThreadPoolSize);
tng.setTestSuites(paths);
tng.addListener((ITestNGListener) tla);
if (null != randomizeSuites) {
tng.setRandomizeSuites(randomizeSuites);
}
BaseThreadTest.initThreadLog();
tng.run();
Assert.assertEquals(BaseThreadTest.getThreadCount(), expectedThreadCount,
"Thread count expected:" + expectedThreadCount
+ " actual:" + BaseThreadTest.getThreadCount());
Assert.assertEquals(BaseThreadTest.getSuitesMap().keySet().size(), expectedSuiteCount);
}
代码示例来源:origin: org.testng/testng
setSuiteThreadPoolSize(cla.suiteThreadPoolSize);
setRandomizeSuites(cla.randomizeSuites);
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(2);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(2);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: cbeust/testng
setSuiteThreadPoolSize(cla.suiteThreadPoolSize);
setRandomizeSuites(cla.randomizeSuites);
alwaysRunListeners(cla.alwaysRunListeners);
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(THREAD_POOL_SIZE);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(THREAD_POOL_SIZE);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(2);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(2);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: cbeust/testng
tng.setSuiteThreadPoolSize(2);
tng.addListener((ITestNGListener) new TestNgRunStateListener());
代码示例来源:origin: stackoverflow.com
TestNG testng = new TestNG();
testng.setXmlSuites((List <XmlSuite>)(new Parser("src"+File.separator+"test"+File.separator+"resources"+File.separator+"xml_Suites"+File.separator+"TestNG.xml").parse()));
testng.setSuiteThreadPoolSize(1);
testng.run();
代码示例来源:origin: stackoverflow.com
public class TestRunner
{
public static void main(String[] args)
{
TestNG testng = new TestNG();
TestListenerAdapter adapter = new TestListenerAdapter();
List<String> suites = new ArrayList<String>();
testng.addListener(adapter);
suites.add(args[0]);
testng.setTestSuites(suites);
testng.setParallel("parallel");
testng.setSuiteThreadPoolSize(5);
testng.setOutputDirectory("path to output");
testng.run();
}
}
内容来源于网络,如有侵权,请联系作者删除!