hudson.plugins.testlink.result.tap
Class TAPTestResultSeeker<T extends org.tap4j.model.TestSet>

java.lang.Object
  extended by hudson.plugins.testlink.result.TestResultSeeker<org.tap4j.model.TestSet>
      extended by hudson.plugins.testlink.result.tap.TAPTestResultSeeker<T>
All Implemented Interfaces:
java.io.Serializable

public class TAPTestResultSeeker<T extends org.tap4j.model.TestSet>
extends TestResultSeeker<org.tap4j.model.TestSet>

Seeks for test results of TAP test sets.

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

Field Summary
protected  TAPParser parser
           
protected  java.util.Map<java.lang.Integer,TestCaseWrapper<org.tap4j.model.TestSet>> results
           
 
Fields inherited from class hudson.plugins.testlink.result.TestResultSeeker
automatedTestCases, includePattern, keyCustomFieldName, listener
 
Constructor Summary
TAPTestResultSeeker(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<org.tap4j.model.TestSet> testResult, java.lang.String tapFileNameWithoutExtension)
          Adds a test result to the map of test results.
protected  void doTAPReports(java.io.File directory, java.lang.String[] tapReports)
          Parses TAP report files to look for Test Results of TestLink Automated Test Cases.
protected  void doTAPTestSet(org.tap4j.model.TestSet tapTestSet, java.io.File tapFile)
          Inspects a TAP test set looking for test results for the automated test cases in TestLink.
protected  void extractAttachments(java.util.List<br.eti.kinoshita.testlinkjavaapi.model.Attachment> attachments, java.util.Map<java.lang.String,java.lang.Object> diagnostic)
          Extracts attachments from a TAP diagnostic and adds into a list of attachments.
protected  java.lang.String extractPlatform(java.util.Map<java.lang.String,java.lang.Object> diagnostic)
           
protected  void findTestResult(java.lang.String tapFileNameWithoutExtension, org.tap4j.model.TestSet tapTestSet, br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase, java.io.File tapFile)
          Looks for test results in a TAP Test Set test case.
protected  java.util.List<br.eti.kinoshita.testlinkjavaapi.model.Attachment> getTapAttachments(java.lang.Integer versionId, java.io.File tapReportFile, org.tap4j.model.TestSet testSet)
          Retrieves list of TAP Attachments.
protected  br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getTapExecutionStatus(org.tap4j.model.TestSet testSet)
          Retrieves the TestLink Execution Status from a TAP Test Set.
protected  java.lang.String getTapNotes(org.tap4j.model.TestSet testSet)
          Retrieves notes for a TAP test set.
protected  java.util.List<br.eti.kinoshita.testlinkjavaapi.model.Attachment> retrieveListOfTapAttachments(org.tap4j.model.TestSet testSet)
          Retrieves list of attachments from a TAP Test Set by using its YAMLish data.
protected  java.lang.String retrievePlatform(org.tap4j.model.TestSet tapTestSet)
          Retrieves the TestLink platform.
 java.util.Map<java.lang.Integer,TestCaseWrapper<org.tap4j.model.TestSet>> seek(java.io.File directory)
          Seeks for Test Results in a directory.
 
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 TAPParser parser

results

protected final java.util.Map<java.lang.Integer,TestCaseWrapper<org.tap4j.model.TestSet>> results
Constructor Detail

TAPTestResultSeeker

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

seek

public java.util.Map<java.lang.Integer,TestCaseWrapper<org.tap4j.model.TestSet>> 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<org.tap4j.model.TestSet>
Parameters:
directory - Directory to look for test results
Throws:
TestResultSeekerException

doTAPReports

protected void doTAPReports(java.io.File directory,
                            java.lang.String[] tapReports)
Parses TAP report files to look for Test Results of TestLink Automated Test Cases.

Parameters:
directory - Directory where to search for.
tapReports - Array of TAP report files.

doTAPTestSet

protected void doTAPTestSet(org.tap4j.model.TestSet tapTestSet,
                            java.io.File tapFile)
Inspects a TAP test set looking for test results for the automated test cases in TestLink. When it finds a test result, this test result is added to the List of Test Results.

Parameters:
tapTestSet - TAP test set.
tapFile - TAP file (added as an attachment for each test result found).

findTestResult

protected void findTestResult(java.lang.String tapFileNameWithoutExtension,
                              org.tap4j.model.TestSet tapTestSet,
                              br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase,
                              java.io.File tapFile)
Looks for test results in a TAP Test Set test case.


addOrUpdate

protected void addOrUpdate(TestCaseWrapper<org.tap4j.model.TestSet> testResult,
                           java.lang.String tapFileNameWithoutExtension)
Adds a test result to the map of test results. If the entry already exists, then it is updated (notes, attachments and statuses).


getTapNotes

protected java.lang.String getTapNotes(org.tap4j.model.TestSet testSet)
Retrieves notes for a TAP test set.

Parameters:
testSet - TAP test set.
Returns:
notes for a TAP test set.

retrievePlatform

protected java.lang.String retrievePlatform(org.tap4j.model.TestSet tapTestSet)
Retrieves the TestLink platform.

Parameters:
tapTestSet - TAP test set.
Returns:
TestLink platform.

extractPlatform

protected java.lang.String extractPlatform(java.util.Map<java.lang.String,java.lang.Object> diagnostic)
Parameters:
diagnostic -
Returns:
TestLink Platform if present, null otherwise

getTapExecutionStatus

protected br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getTapExecutionStatus(org.tap4j.model.TestSet testSet)
Retrieves the TestLink Execution Status from a TAP Test Set. Returns failed only when the test set contains at least one not ok statement.

Parameters:
testSet - the TAP TestSet.
Returns:
failed only when the test set contains at least one not ok statement, otherwise it will return passed.

getTapAttachments

protected java.util.List<br.eti.kinoshita.testlinkjavaapi.model.Attachment> getTapAttachments(java.lang.Integer versionId,
                                                                                              java.io.File tapReportFile,
                                                                                              org.tap4j.model.TestSet testSet)
                                                                                       throws java.io.IOException
Retrieves list of TAP Attachments. Besides the TAP stream file itself, this method also adds all extension / Files to this list.

Parameters:
versionId - TestLink TestCase version id.
tapReportFile - TAP Report file.
testSet - TAP Test Set.
Returns:
TAP Attachments.
Throws:
java.io.IOException

retrieveListOfTapAttachments

protected java.util.List<br.eti.kinoshita.testlinkjavaapi.model.Attachment> retrieveListOfTapAttachments(org.tap4j.model.TestSet testSet)
                                                                                                  throws java.io.IOException
Retrieves list of attachments from a TAP Test Set by using its YAMLish data.

Parameters:
testSet - TAP Test Set.
Returns:
List of attachments.
Throws:
java.io.IOException

extractAttachments

protected void extractAttachments(java.util.List<br.eti.kinoshita.testlinkjavaapi.model.Attachment> attachments,
                                  java.util.Map<java.lang.String,java.lang.Object> diagnostic)
                           throws java.io.IOException
Extracts attachments from a TAP diagnostic and adds into a list of attachments.

Parameters:
attachments - List of attachments
diagnostic - TAP diagnostic
Throws:
java.io.IOException


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