Package org.testng

Examples of org.testng.ISuiteResult


  public void addResults(ISuite from) {
    Map<String, ISuiteResult> results = from.getResults();

    for (String key : results.keySet()) {
      ISuiteResult result = results.get(key);

      process(result.getTestContext().getPassedTests());
      process(result.getTestContext().getPassedConfigurations());

      process(result.getTestContext().getFailedTests());
      process(result.getTestContext().getFailedConfigurations());

      process(result.getTestContext().getSkippedTests());
      process(result.getTestContext().getSkippedConfigurations());
    }


  }
View Full Code Here


    }
   
    Map<String, ISuiteResult> results= suite.getResults();
   
    for(String name: results.keySet()) {
      ISuiteResult suiteResult= results.get(name);
      ITestContext testContext= suiteResult.getTestContext();

      generateXmlTest(suite,
                      xmlTests.get(testContext.getName()),
                      testContext,
                      testContext.getFailedTests().getAllResults(),
View Full Code Here

    m_runner.setHost(remoteSuiteRunner.getHost());
    Map<String, ISuiteResult> tmpResults = remoteSuiteRunner.getResults();
    Map<String, ISuiteResult> suiteResults = m_runner.getResults();
    for (String tests : tmpResults.keySet())
    {
      ISuiteResult suiteResult = tmpResults.get(tests);
      suiteResults.put(tests, suiteResult);
      ITestContext tc = suiteResult.getTestContext();
      TestHTMLReporter.generateLog(tc, remoteSuiteRunner.getHost(),
                                   m_runner.getOutputDirectory(),
                                   tc.getFailedConfigurations().getAllResults(),
                                   tc.getSkippedConfigurations().getAllResults(),
                                   tc.getPassedTests().getAllResults(),
View Full Code Here

      int passedTests= 0;
      int skippedTests= 0;
     
      Map<String, ISuiteResult> results = suite.getResults();
      for (String suiteName : results.keySet()) {
        ISuiteResult result = results.get(suiteName);
        ITestContext context = result.getTestContext();
        failedTests += context.getFailedTests().size();
        totalFailedTests += context.getFailedTests().size();
        passedTests += context.getPassedTests().size();
        totalPassedTests += context.getPassedTests().size();
        skippedTests += context.getSkippedTests().size();
View Full Code Here

      Map<String, ISuiteResult> redResults = new HashMap<String, ISuiteResult>();
      Map<String, ISuiteResult> yellowResults = new HashMap<String, ISuiteResult>();
      Map<String, ISuiteResult> greenResults = new HashMap<String, ISuiteResult>();
     
      for (String suiteName : suiteResults.keySet()) {
        ISuiteResult sr = suiteResults.get(suiteName);
        ITestContext tc = sr.getTestContext();
        int failed = tc.getFailedTests().size();
        int skipped = tc.getSkippedTests().size();
        int passed = tc.getPassedTests().size();
       
        if (failed > 0) {
          redResults.put(suiteName, sr);
        }
        else if (skipped > 0) {
          yellowResults.put(suiteName, sr);
        }
        else if (passed > 0) {
          greenResults.put(suiteName, sr);
        }
        else {
          redResults.put(suiteName, sr);
        }
      }
 
     
      ISuiteResult[][] results = new ISuiteResult[][] {
        sortResults(redResults.values()), sortResults(yellowResults.values()), sortResults(greenResults.values())
      };
     
      String[] colors = {"failed", "skipped", "passed"};
      for (int i = 0; i < colors.length; i++) {
        ISuiteResult[] r = results[i];
        for (ISuiteResult sr: r) {
          String suiteName = sr.getTestContext().getName();
          generateSuiteResult(suiteName, sr, colors[i], tableOfContents, m_outputDirectory);
        }
      }
   
    tableOfContents.append("</body></html>");
View Full Code Here

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

    // TODO CQ why not iterate over entry set if were going to use the key to get the value?
    for (String propertyFileName : suiteResults.keySet()) {
     
      ISuiteResult sr = suiteResults.get(propertyFileName);
      ITestContext testContext = sr.getTestContext();
     
      StringBuffer sb = new StringBuffer();
     
      // TODO CQ why not iterate over entry set if were going to use the key to get the value?
      for (String name : suiteResults.keySet()) {
        ISuiteResult suiteResult = suiteResults.get(name);
        sb.append(suiteResult.toString());
      }
      Utils.writeFile(getOutputDirectory(xmlSuite), testContext.getName() + ".properties", sb.toString());
    }   
  }
View Full Code Here

      int passedTests= 0;
      int skippedTests= 0;
     
      Map<String, ISuiteResult> results = suite.getResults();
      for (String suiteName : results.keySet()) {
        ISuiteResult result = results.get(suiteName);
        ITestContext context = result.getTestContext();
        failedTests += context.getFailedTests().size();
        totalFailedTests += context.getFailedTests().size();
        passedTests += context.getPassedTests().size();
        totalPassedTests += context.getPassedTests().size();
        skippedTests += context.getSkippedTests().size();
View Full Code Here

      Map<String, ISuiteResult> redResults = new HashMap<String, ISuiteResult>();
      Map<String, ISuiteResult> yellowResults = new HashMap<String, ISuiteResult>();
      Map<String, ISuiteResult> greenResults = new HashMap<String, ISuiteResult>();
     
      for (String suiteName : suiteResults.keySet()) {
        ISuiteResult sr = suiteResults.get(suiteName);
        ITestContext tc = sr.getTestContext();
        int failed = tc.getFailedTests().size();
        int skipped = tc.getSkippedTests().size();
        int passed = tc.getPassedTests().size();
       
        if (failed > 0) {
          redResults.put(suiteName, sr);
        }
        else if (skipped > 0) {
          yellowResults.put(suiteName, sr);
        }
        else if (passed > 0) {
          greenResults.put(suiteName, sr);
        }
        else {
          redResults.put(suiteName, sr);
        }
      }
 
     
      ISuiteResult[][] results = new ISuiteResult[][] {
        sortResults(redResults.values()), sortResults(yellowResults.values()), sortResults(greenResults.values())
      };
     
      String[] colors = {"failed", "skipped", "passed"};
      for (int i = 0; i < colors.length; i++) {
        ISuiteResult[] r = results[i];
        for (ISuiteResult sr: r) {
          String suiteName = sr.getTestContext().getName();
          generateSuiteResult(suiteName, sr, colors[i], tableOfContents, m_outputDirectory);
        }
      }
   
    tableOfContents.append("</body></html>");
View Full Code Here

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

    // TODO CQ why not iterate over entry set if were going to use the key to get the value?
    for (String propertyFileName : suiteResults.keySet()) {
     
      ISuiteResult sr = suiteResults.get(propertyFileName);
      ITestContext testContext = sr.getTestContext();
     
      StringBuffer sb = new StringBuffer();
     
      // TODO CQ why not iterate over entry set if were going to use the key to get the value?
      for (String name : suiteResults.keySet()) {
        ISuiteResult suiteResult = suiteResults.get(name);
        sb.append(suiteResult.toString());
      }
      Utils.writeFile(getOutputDirectory(xmlSuite), testContext.getName() + ".properties", sb);
    }   
  }
View Full Code Here

      SuiteRunner remoteSuiteRunner = sendSuite(slave, m_suite);
      m_suiteRunner.setHost(remoteSuiteRunner.getHost());
      Map<String, ISuiteResult> tmpResults = remoteSuiteRunner.getResults();
      Map<String, ISuiteResult> suiteResults = m_suiteRunner.getResults();
      for (String tests : tmpResults.keySet()) {
        ISuiteResult suiteResult = tmpResults.get(tests);
        suiteResults.put(tests, suiteResult);
        ITestContext tc = suiteResult.getTestContext();
        TestHTMLReporter.generateLog(tc,
            remoteSuiteRunner.getHost(),
            m_suiteRunner.getOutputDirectory(),
            tc.getFailedConfigurations().getAllResults(),
            tc.getSkippedConfigurations().getAllResults(),
View Full Code Here

TOP

Related Classes of org.testng.ISuiteResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.