当前位置: 首页>>代码示例>>Java>>正文


Java ISuite类代码示例

本文整理汇总了Java中org.testng.ISuite的典型用法代码示例。如果您正苦于以下问题:Java ISuite类的具体用法?Java ISuite怎么用?Java ISuite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ISuite类属于org.testng包,在下文中一共展示了ISuite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculate

import org.testng.ISuite; //导入依赖的package包/类
private void calculate() {
    if (!this.counts.isEmpty()) return;
    int passed = 0;
    int failed = 0;
    int skipped = 0;

    for (ISuite suite : this.reports) {
        for (ISuiteResult result : suite.getResults().values()) {
            final ITestContext testContext = result.getTestContext();
            passed += testContext.getPassedTests().size();
            failed += testContext.getFailedTests().size();
            skipped += testContext.getSkippedTests().size();
        }
    }
    this.counts.add(0, passed + failed + skipped);
    this.counts.add(1, failed);
    this.counts.add(2, skipped);
}
 
开发者ID:tatools,项目名称:sunshine,代码行数:19,代码来源:TestNGStatus.java

示例2: generateMethodDetailReport

import org.testng.ISuite; //导入依赖的package包/类
/**
 * Creates a section showing known results for each method
 */
protected void generateMethodDetailReport(List<ISuite> suites)
{
    m_methodIndex = 0;
    for (ISuite suite : suites)
    {
        Map<String, ISuiteResult> r = suite.getResults();
        for (ISuiteResult r2 : r.values())
        {
            ITestContext testContext = r2.getTestContext();
            if (r.values().size() > 0)
            {
                m_out.println("<h1>" + testContext.getName() + "</h1>");
            }
            resultDetail(testContext.getFailedConfigurations(), "failed");
            resultDetail(testContext.getFailedTests(), "failed");
            resultDetail(testContext.getSkippedConfigurations(), "skipped");
            resultDetail(testContext.getSkippedTests(), "skipped");
            resultDetail(testContext.getPassedTests(), "passed");
        }
    }
}
 
开发者ID:basavaraj1985,项目名称:DolphinNG,代码行数:25,代码来源:EmailableReporter.java

示例3: getTotalSkippedMethodsForTest

import org.testng.ISuite; //导入依赖的package包/类
public int getTotalSkippedMethodsForTest(final String testName)
{
    int totalNumberOfSkippedMethodsForTest = 0;
    ITestContext overview = null;

    for (ISuite suite : suites)
    {
        suiteName = suite.getName();

        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();
            if (testName.equalsIgnoreCase(overview.getName()))
            {
                totalNumberOfSkippedMethodsForTest = overview.getSkippedTests().getAllMethods().size();
                break;
            }
        }
    }

    return totalNumberOfSkippedMethodsForTest;
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:25,代码来源:ReporterAPI.java

示例4: getAllParametersForTest

import org.testng.ISuite; //导入依赖的package包/类
public Map<String, String> getAllParametersForTest(String testName)
{
    ITestContext overview = null;

    for (ISuite suite : suites)
    {
        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();

            if (testName.equalsIgnoreCase(overview.getName()))
            {
                return overview.getCurrentXmlTest().getAllParameters();
            }
        }
    }

    return null;
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:22,代码来源:ReporterAPI.java

示例5: getParameterValueForTest

import org.testng.ISuite; //导入依赖的package包/类
public String getParameterValueForTest(String testName, String parameter)
{
    ITestContext overview = null;

    for (ISuite suite : suites)
    {
        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();

            if (testName.equalsIgnoreCase(overview.getName()))
            {
                return overview.getCurrentXmlTest().getParameter(parameter);
            }
        }
    }

    return null;
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:22,代码来源:ReporterAPI.java

示例6: getAllMethodsForTest

import org.testng.ISuite; //导入依赖的package包/类
public ITestNGMethod[] getAllMethodsForTest(String testName)
{
    ITestContext overview = null;

    for (ISuite suite : suites)
    {
        suiteName = suite.getName();

        Map<String, ISuiteResult> tests = suite.getResults();

        for (ISuiteResult r : tests.values())
        {
            overview = r.getTestContext();

            if (overview.getName().equalsIgnoreCase(testName))
            {
                return overview.getAllTestMethods();
            }
        }
    }

    return null;
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:24,代码来源:ReporterAPI.java

示例7: generateReport

import org.testng.ISuite; //导入依赖的package包/类
/**
 * Creates summary of the run
 */
public void generateReport(List<XmlSuite> xml, List<ISuite> suites, String outdir)
{
    try
    {
        m_out = createWriter(outdir);
    } catch (IOException e)
    {
        L.error("output file", e);
        return;
    }
    startHtml(m_out);
    generateSuiteSummaryReport(suites);
    generateMethodSummaryReport(suites);
    generateMethodDetailReport(suites);
    endHtml(m_out);
    m_out.flush();
    m_out.close();
}
 
开发者ID:basavaraj1985,项目名称:DolphinNG,代码行数:22,代码来源:EmailableReporter.java

示例8: generateMethodSummaryReport

import org.testng.ISuite; //导入依赖的package包/类
/**
 * Creates a table showing the highlights of each test method with links to the method details
 */
protected void generateMethodSummaryReport(List<ISuite> suites)
{
    m_methodIndex = 0;
    m_out.println("<a id=\"summary\"></a>");
    startResultSummaryTable("passed");
    for (ISuite suite : suites)
    {
        if (suites.size() > 1)
        {
            titleRow(suite.getName(), 4);
        }
        Map<String, ISuiteResult> r = suite.getResults();
        for (ISuiteResult r2 : r.values())
        {
            ITestContext testContext = r2.getTestContext();
            String testName = testContext.getName();
            resultSummary(testContext.getFailedConfigurations(), testName, "failed", " (configuration methods)");
            resultSummary(testContext.getFailedTests(), testName, "failed", "");
            resultSummary(testContext.getSkippedConfigurations(), testName, "skipped", " (configuration methods)");
            resultSummary(testContext.getSkippedTests(), testName, "skipped", "");
            resultSummary(testContext.getPassedTests(), testName, "passed", "");
        }
    }
    m_out.println("</table>");
}
 
开发者ID:basavaraj1985,项目名称:DolphinNG,代码行数:29,代码来源:EmailableReporter.java

示例9: generateReport

import org.testng.ISuite; //导入依赖的package包/类
@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
	StringBuilder sb = new StringBuilder();
	for (ISuite suite : suites) {
		Map<String, ISuiteResult> results = suite.getResults();
		for (Map.Entry<String, ISuiteResult> result : results.entrySet()) {
			String report = buildReport(result.getValue().getTestContext());
			sb.append(report);
		}
	}
	try {
		FileUtils.writeToFile(new File(FAILED_REPORT_FILE), sb.toString());
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:21ca,项目名称:selenium-testng-template,代码行数:17,代码来源:HtmlReporter.java

示例10: generateReport

import org.testng.ISuite; //导入依赖的package包/类
@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
    List<ITestResult> list = new ArrayList<ITestResult>();
    for (ISuite suite : suites) {          
        Map<String, ISuiteResult> suiteResults = suite.getResults();
        for (ISuiteResult suiteResult : suiteResults.values()) {
            ITestContext testContext = suiteResult.getTestContext();           
            IResultMap passedTests = testContext.getPassedTests();
            IResultMap failedTests = testContext.getFailedTests();
            IResultMap skippedTests = testContext.getSkippedTests();
            IResultMap failedConfig = testContext.getFailedConfigurations();   
            list.addAll(this.listTestResult(passedTests));
            list.addAll(this.listTestResult(failedTests));
            list.addAll(this.listTestResult(skippedTests));
            list.addAll(this.listTestResult(failedConfig));
        }          
    }
    this.sort(list);
    this.outputResult(list, outputDirectory+"/test.txt");
}
 
开发者ID:pcsh,项目名称:cashion,代码行数:21,代码来源:IReporterNewReport.java

示例11: testSkipTestMethod

import org.testng.ISuite; //导入依赖的package包/类
@Test
public void testSkipTestMethod() throws Exception {

  final StringBuffer buf = new StringBuffer();
  final IDEATestNGRemoteListener listener = createListener(buf);
  listener.onStart((ISuite)null);
  listener.onTestSkipped(new MockTestNGResult("ATest", "testName"));
  listener.onFinish((ISuite)null);

  Assert.assertEquals("output: " + buf, "##teamcity[enteredTheMatrix]\n" +
                                        "\n" +
                                        "##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://ATest']\n" +
                                        "\n" +
                                        "##teamcity[testStarted name='ATest.testName' locationHint='java:test://ATest.testName|[0|]']\n" +
                                        "\n" +
                                        "##teamcity[testIgnored name='ATest.testName']\n" +
                                        "\n" +
                                        "##teamcity[testFinished name='ATest.testName']\n" +
                                        "##teamcity[testSuiteFinished name='ATest']\n", StringUtil.convertLineSeparators(buf.toString()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:TestNGTreeHierarchyTest.java

示例12: testFailureWithoutStart

import org.testng.ISuite; //导入依赖的package包/类
@Test
public void testFailureWithoutStart() throws Exception {

  final StringBuffer buf = new StringBuffer();
  final IDEATestNGRemoteListener listener = createListener(buf);
  listener.onStart((ISuite)null);
  listener.onTestFailure(new MockTestNGResult("ATest", "testName", createExceptionWithoutTrace(), ArrayUtil.EMPTY_OBJECT_ARRAY));
  listener.onFinish((ISuite)null);

  Assert.assertEquals("output: " + buf, "##teamcity[enteredTheMatrix]\n" +
                                        "\n" +
                                        "##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://ATest']\n" +
                                        "\n" +
                                        "##teamcity[testStarted name='ATest.testName' locationHint='java:test://ATest.testName|[0|]']\n" +
                                        "##teamcity[testFailed name='ATest.testName' details='java.lang.Exception|n' error='true' message='']\n" +
                                        "\n" +
                                        "##teamcity[testFinished name='ATest.testName']\n" +
                                        "##teamcity[testSuiteFinished name='ATest']\n", StringUtil.convertLineSeparators(buf.toString()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TestNGTreeHierarchyTest.java

示例13: testSkipMethodAfterStartTest

import org.testng.ISuite; //导入依赖的package包/类
@Test
public void testSkipMethodAfterStartTest() throws Exception {
  final StringBuffer buf = new StringBuffer();
  final IDEATestNGRemoteListener listener = createListener(buf);
  listener.onStart((ISuite)null);
  final MockTestNGResult result = new MockTestNGResult("ATest", "testName");
  listener.onTestStart(result);
  listener.onTestSkipped(result);
  listener.onFinish((ISuite)null);

  Assert.assertEquals("output: " + buf, "##teamcity[enteredTheMatrix]\n" +
                                        "\n" +
                                        "##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://ATest']\n" +
                                        "\n" +
                                        "##teamcity[testStarted name='ATest.testName' locationHint='java:test://ATest.testName|[0|]']\n" +
                                        "\n" +
                                        "##teamcity[testIgnored name='ATest.testName']\n" +
                                        "\n" +
                                        "##teamcity[testFinished name='ATest.testName']\n" +
                                        "##teamcity[testSuiteFinished name='ATest']\n", StringUtil.convertLineSeparators(buf.toString()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:TestNGTreeHierarchyTest.java

示例14: buildTestRunnerFactory

import org.testng.ISuite; //导入依赖的package包/类
@Override
protected ITestRunnerFactory buildTestRunnerFactory() {
  if(null == m_customTestRunnerFactory) {
    m_customTestRunnerFactory= new ITestRunnerFactory() {
      @Override
      public TestRunner newTestRunner(ISuite suite, XmlTest xmlTest,
                                      List<IInvokedMethodListener> listeners) {
        TestRunner runner =
                new TestRunner(getConfiguration(), suite, xmlTest,
                        false /*skipFailedInvocationCounts */,
                        listeners);
        if (m_useDefaultListeners) {
          runner.addListener(new TestHTMLReporter());
          runner.addListener(new JUnitXMLReporter());
        }
        for (IConfigurationListener cl : getConfiguration().getConfigurationListeners()) {
          runner.addListener(cl);
        }

        return runner;
      }
    };
  }

  return m_customTestRunnerFactory;
}
 
开发者ID:testng-team,项目名称:testng-remote,代码行数:27,代码来源:RemoteTestNG6_5.java

示例15: buildTestRunnerFactory

import org.testng.ISuite; //导入依赖的package包/类
@Override
protected ITestRunnerFactory buildTestRunnerFactory() {
  if(null == m_customTestRunnerFactory) {
    m_customTestRunnerFactory= new ITestRunnerFactory() {
        @Override
        public TestRunner newTestRunner(ISuite suite, XmlTest xmlTest,
            Collection<IInvokedMethodListener> listeners, List<IClassListener> classListeners) {
          TestRunner runner =
            new TestRunner(getConfiguration(), suite, xmlTest,
                false /*skipFailedInvocationCounts */,
                listeners, classListeners);
          if (m_useDefaultListeners) {
            runner.addListener(new TestHTMLReporter());
            runner.addListener(new JUnitXMLReporter());
          }

          return runner;
        }
      };
  }

  return m_customTestRunnerFactory;
}
 
开发者ID:testng-team,项目名称:testng-remote,代码行数:24,代码来源:RemoteTestNG6_10.java


注:本文中的org.testng.ISuite类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。