本文整理匯總了Java中org.testng.xml.XmlSuite.setThreadCount方法的典型用法代碼示例。如果您正苦於以下問題:Java XmlSuite.setThreadCount方法的具體用法?Java XmlSuite.setThreadCount怎麽用?Java XmlSuite.setThreadCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.testng.xml.XmlSuite
的用法示例。
在下文中一共展示了XmlSuite.setThreadCount方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import org.testng.xml.XmlSuite; //導入方法依賴的package包/類
private void run()
{
LOG.debug("running tempto with options: {}", options);
if (options.isHelpRequested()) {
parser.printHelpMessage();
return;
}
XmlSuite testSuite = getXmlSuite();
testSuite.setThreadCount(options.getThreadCount());
setupTestsConfiguration();
System.setProperty(CONVENTION_TESTS_DIR_KEY, options.getConventionTestsDirectory());
TestNG testNG = new TestNG();
testNG.setXmlSuites(singletonList(testSuite));
testNG.setOutputDirectory(options.getReportDir());
setupTestsFiltering(testNG);
options.getConventionResultsDumpPath()
.ifPresent(path -> System.setProperty(CONVENTION_TESTS_RESULTS_DUMP_PATH_KEY, path));
testNG.run();
if (testNG.hasFailure()) {
System.exit(1);
}
}
示例2: constructXmlSuiteForParallel
import org.testng.xml.XmlSuite; //導入方法依賴的package包/類
public XmlSuite constructXmlSuiteForParallel(String pack, List<String> testcases,
Map<String, List<Method>> methods,
int deviceCount, ArrayList<String> deviceSerail) {
ArrayList<String> listeners = new ArrayList<>();
listeners.add("com.appium.manager.AppiumParallelTestListener");
listeners.add("com.appium.utils.RetryListener");
include(listeners, "LISTENERS");
include(groupsInclude, "INCLUDE_GROUPS");
include(groupsExclude, "EXCLUDE_GROUPS");
XmlSuite suite = new XmlSuite();
suite.setName("TestNG Forum");
suite.setThreadCount(deviceCount);
suite.setDataProviderThreadCount(deviceCount);
suite.setParallel(ParallelMode.TESTS);
suite.setVerbose(2);
suite.setListeners(listeners);
for (int i = 0; i < deviceCount; i++) {
XmlTest test = new XmlTest(suite);
test.setName("TestNG Test" + i);
test.setPreserveOrder("false");
test.addParameter("device", deviceSerail.get(i));
test.setIncludedGroups(groupsInclude);
test.setExcludedGroups(groupsExclude);
List<XmlClass> xmlClasses = new ArrayList<>();
writeXmlClass(testcases, methods, xmlClasses);
test.setXmlClasses(xmlClasses);
}
System.out.println(suite.toXml());
writeTestNGFile(suite);
return suite;
}
示例3: constructXmlSuiteForDistribution
import org.testng.xml.XmlSuite; //導入方法依賴的package包/類
public XmlSuite constructXmlSuiteForDistribution(String pack, List<String> tests,
Map<String, List<Method>> methods,
int deviceCount) {
include(listeners, "LISTENERS");
include(groupsInclude, "INCLUDE_GROUPS");
XmlSuite suite = new XmlSuite();
suite.setName("TestNG Forum");
suite.setThreadCount(deviceCount);
suite.setParallel(ParallelMode.CLASSES);
suite.setVerbose(2);
listeners.add("com.appium.manager.AppiumParallelMethodTestListener");
listeners.add("com.appium.utils.RetryListener");
suite.setListeners(listeners);
if (prop.getProperty("LISTENERS") != null) {
suite.setListeners(listeners);
}
XmlTest test = new XmlTest(suite);
test.setName("TestNG Test");
test.addParameter("device", "");
include(groupsExclude, "EXCLUDE_GROUPS");
test.setIncludedGroups(groupsInclude);
test.setExcludedGroups(groupsExclude);
List<XmlClass> xmlClasses = new ArrayList<>();
writeXmlClass(tests, methods, xmlClasses);
test.setXmlClasses(xmlClasses);
System.out.println(suite.toXml());
writeTestNGFile(suite);
return suite;
}
示例4: constructXmlSuiteForDistributionMethods
import org.testng.xml.XmlSuite; //導入方法依賴的package包/類
public XmlSuite constructXmlSuiteForDistributionMethods(String pack, List<String> tests,
Map<String, List<Method>> methods,
int deviceCount) {
include(listeners, "LISTENERS");
include(groupsInclude, "INCLUDE_GROUPS");
XmlSuite suite = new XmlSuite();
suite.setName("TestNG Forum");
suite.setThreadCount(deviceCount);
suite.setDataProviderThreadCount(deviceCount);
suite.setVerbose(2);
suite.setParallel(ParallelMode.METHODS);
listeners.add("com.appium.manager.AppiumParallelMethodTestListener");
listeners.add("com.appium.utils.RetryListener");
suite.setListeners(listeners);
if (prop.getProperty("LISTENERS") != null) {
suite.setListeners(listeners);
}
List<XmlClass> xmlClasses = new ArrayList<>();
xmlClasses = writeXmlClass(tests, methods, xmlClasses);
XmlTest test = new XmlTest(suite);
test.setName("TestNG Test");
test.addParameter("device", "");
include(groupsExclude, "EXCLUDE_GROUPS");
test.setIncludedGroups(groupsInclude);
test.setExcludedGroups(groupsExclude);
List<XmlClass> writeXml = new ArrayList<>();
for (int i = 0; i < xmlClasses.size(); i++) {
writeXml.add(new XmlClass(xmlClasses.get(i).getName()));
test.setClasses(writeXml);
}
System.out.println(suite.toXml());
writeTestNGFile(suite);
return suite;
}