hudson.plugins.testlink.result.testng
Class TestNGSuitesTestResultSeeker<T extends Suite>

java.lang.Object
  extended by hudson.plugins.testlink.result.TestResultSeeker<T>
      extended by hudson.plugins.testlink.result.testng.AbstractTestNGTestResultSeeker<Suite>
          extended by hudson.plugins.testlink.result.testng.TestNGSuitesTestResultSeeker<T>
All Implemented Interfaces:
java.io.Serializable

public class TestNGSuitesTestResultSeeker<T extends Suite>
extends AbstractTestNGTestResultSeeker<Suite>

Seeks for test results of TestNG suites.

Since:
2.5
Author:
Bruno P. Kinoshita - http://www.kinoshita.eti.br
See Also:
Serialized Form

Field Summary
protected  TestNGParser parser
           
protected  java.util.Map<java.lang.Integer,TestCaseWrapper<Suite>> results
           
 
Fields inherited from class hudson.plugins.testlink.result.TestResultSeeker
automatedTestCases, includePattern, keyCustomFieldName, listener
 
Constructor Summary
TestNGSuitesTestResultSeeker(java.lang.String includePattern, br.eti.kinoshita.testlinkjavaapi.model.TestCase[] automatedTestCases, java.lang.String keyCustomFieldName, hudson.model.BuildListener listener)
           
 
Method Summary
protected  void addOrUpdate(TestCaseWrapper<Suite> testResult)
          Adds a test result to the map of test results.
protected  void findTestResults(Suite testNGSuite, br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase, java.io.File testNGFile)
          Looks for test results in a TestNG suite.
protected  br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getTestNGExecutionStatus(Suite suite)
          Retrieves the Execution Status for a TestNG test class.
protected  java.lang.String getTestNGNotes(Suite suite)
          Retrieves notes for TestNG suite.
protected  void processTestNGReports(java.io.File directory, java.lang.String[] testNGReports)
          Processes TestNG reports.
protected  void processTestNGSuite(Suite testNGSuite, java.io.File testNGFile)
          Processes TestNG Suite.
 java.util.Map<java.lang.Integer,TestCaseWrapper<Suite>> seek(java.io.File directory)
          Seeks for Test Results in a directory.
 
Methods inherited from class hudson.plugins.testlink.result.testng.AbstractTestNGTestResultSeeker
getTestNGAttachment
 
Methods inherited from class hudson.plugins.testlink.result.TestResultSeeker
getBase64FileContent, getKeyCustomField, scan, split
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected final TestNGParser parser

results

protected final java.util.Map<java.lang.Integer,TestCaseWrapper<Suite>> results
Constructor Detail

TestNGSuitesTestResultSeeker

public TestNGSuitesTestResultSeeker(java.lang.String includePattern,
                                    br.eti.kinoshita.testlinkjavaapi.model.TestCase[] automatedTestCases,
                                    java.lang.String keyCustomFieldName,
                                    hudson.model.BuildListener listener)
Method Detail

seek

public java.util.Map<java.lang.Integer,TestCaseWrapper<Suite>> seek(java.io.File directory)
                                                             throws TestResultSeekerException
Description copied from class: TestResultSeeker
Seeks for Test Results in a directory. It tries to match the includePattern with files in this directory.

Specified by:
seek in class TestResultSeeker<Suite>
Parameters:
directory - Directory to look for test results
Throws:
TestResultSeekerException

processTestNGReports

protected void processTestNGReports(java.io.File directory,
                                    java.lang.String[] testNGReports)
Processes TestNG reports.


processTestNGSuite

protected void processTestNGSuite(Suite testNGSuite,
                                  java.io.File testNGFile)
Processes TestNG Suite.


findTestResults

protected void findTestResults(Suite testNGSuite,
                               br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase,
                               java.io.File testNGFile)
Looks for test results in a TestNG suite.


addOrUpdate

protected void addOrUpdate(TestCaseWrapper<Suite> testResult)
Adds a test result to the map of test results. If the entry already exists, then it is updated (notes, attachments and statuses).


getTestNGNotes

protected java.lang.String getTestNGNotes(Suite suite)
Retrieves notes for TestNG suite.

Parameters:
suite - TestNG suite.
Returns:
notes for TestNG suite and test class.

getTestNGExecutionStatus

protected br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getTestNGExecutionStatus(Suite suite)
Retrieves the Execution Status for a TestNG test class. It is done iterating over all the class methods. If a method has the status FAIL, then we return the Execution Status failed, otherwise passed.

Parameters:
suite - The TestNG Test suite.
Returns:
passed if the TestNG Test suite contains no test classes with status equals FAIL, otherwise failed.


Copyright © 2010-2011 the Jenkins TestLink plug-in team-2011 Jenkins. All Rights Reserved.