hudson.plugins.testlink.result.testng
Class TestNGClassesTestResultSeeker<T extends Class>

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

public class TestNGClassesTestResultSeeker<T extends Class>
extends AbstractTestNGTestResultSeeker<Class>

Seeks for test results of TestNG tests.

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<Class>> results
          Map of Wrappers for TestLink Test Cases.
 
Fields inherited from class hudson.plugins.testlink.result.TestResultSeeker
automatedTestCases, includePattern, keyCustomFieldName, listener
 
Constructor Summary
TestNGClassesTestResultSeeker(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<Class> testResult)
          Adds or updates a test result.
protected  void findTestResults(Suite testNGSuite, Class clazz, br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase, java.io.File testNGFile)
          Looks for test results in a TestNG test case.
protected  br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getTestNGExecutionStatus(Class clazz)
          Retrieves the Execution Status for a TestNG test class.
protected  java.lang.String getTestNGNotes(Suite suite, Class clazz)
          Retrieves notes for TestNG suite and test class.
protected  void processTestClass(Class clazz, Suite testNGSuite, java.io.File testNGFile)
          Processes a TestNG test class.
protected  void processTestNGReports(java.io.File directory, java.lang.String[] testNGReports)
          Processes TestNG reports.
protected  void processTestNGSuite(Suite testNGSuite, java.io.File testNGFile)
          Processes a TestNG suite.
protected  void processTestNGTest(Test testNGTest, Suite testNGSuite, java.io.File testNGFile)
          Processes a TestNG test.
 java.util.Map<java.lang.Integer,TestCaseWrapper<Class>> 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<Class>> results
Map of Wrappers for TestLink Test Cases.

Constructor Detail

TestNGClassesTestResultSeeker

public TestNGClassesTestResultSeeker(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<Class>> 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<Class>
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 a TestNG suite.


processTestNGTest

protected void processTestNGTest(Test testNGTest,
                                 Suite testNGSuite,
                                 java.io.File testNGFile)
Processes a TestNG test.


processTestClass

protected void processTestClass(Class clazz,
                                Suite testNGSuite,
                                java.io.File testNGFile)
Processes a TestNG test class.


findTestResults

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


addOrUpdate

protected void addOrUpdate(TestCaseWrapper<Class> testResult)
Adds or updates a test result.


getTestNGExecutionStatus

protected br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getTestNGExecutionStatus(Class clazz)
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:
clazz - The TestNG Test class.
Returns:
passed if the TestNG Test class contains no test methods with status equals FAIL, otherwise failed.

getTestNGNotes

protected java.lang.String getTestNGNotes(Suite suite,
                                          Class clazz)
Retrieves notes for TestNG suite and test class.

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


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