當前位置: 首頁>>代碼示例>>Java>>正文


Java XmlSuite.setThreadCount方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:prestodb,項目名稱:tempto,代碼行數:24,代碼來源:TemptoRunner.java

示例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;
}
 
開發者ID:saikrishna321,項目名稱:AppiumTestDistribution,代碼行數:32,代碼來源:MyTestExecutor.java

示例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;
}
 
開發者ID:saikrishna321,項目名稱:AppiumTestDistribution,代碼行數:30,代碼來源:MyTestExecutor.java

示例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;
}
 
開發者ID:saikrishna321,項目名稱:AppiumTestDistribution,代碼行數:35,代碼來源:MyTestExecutor.java


注:本文中的org.testng.xml.XmlSuite.setThreadCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。