hudson.plugins.testlink.result
Class ResultSeeker

java.lang.Object
  extended by hudson.plugins.testlink.result.ResultSeeker
All Implemented Interfaces:
hudson.model.Describable<ResultSeeker>, java.io.Serializable, java.lang.Comparable<ResultSeeker>
Direct Known Subclasses:
AbstractJUnitResultSeeker, AbstractTestNGResultSeeker, TAPFileNameResultSeeker

public abstract class ResultSeeker
extends java.lang.Object
implements java.io.Serializable, hudson.model.Describable<ResultSeeker>, java.lang.Comparable<ResultSeeker>

Seeks for Results.

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

Field Summary
protected  boolean includeNotes
          Whether the plug-in must include notes when updating test cases.
protected  java.lang.String includePattern
          Include pattern used when looking for results.
protected  java.lang.String keyCustomField
          Key custom field.
 
Constructor Summary
ResultSeeker(java.lang.String includePattern, java.lang.String keyCustomField, boolean includeNotes)
          Creates a result seeker passing a ant-like pattern to look for results.
 
Method Summary
static hudson.DescriptorExtensionList<ResultSeeker,hudson.model.Descriptor<ResultSeeker>> all()
           
static hudson.DescriptorExtensionList<ResultSeeker,hudson.model.Descriptor<ResultSeeker>> allExcept(hudson.model.Node current)
           
 int compareTo(ResultSeeker o)
           
protected  java.lang.String getBase64FileContent(java.io.File file)
          Retrieves the file content encoded in Base64.
 ResultSeekerDescriptor getDescriptor()
           
 java.lang.String getIncludePattern()
           
 java.lang.String getKeyCustomField()
           
protected  br.eti.kinoshita.testlinkjavaapi.model.CustomField getKeyCustomField(java.util.List<br.eti.kinoshita.testlinkjavaapi.model.CustomField> customFields, java.lang.String keyCustomFieldName)
          Gets the key custom field out of a list using the key custom field name.
 boolean isIncludeNotes()
           
protected  java.lang.String[] scan(java.io.File directory, java.lang.String includes, hudson.model.BuildListener listener)
          Scans a directory for files matching the includes pattern.
abstract  void seek(TestCaseWrapper[] automatedTestCases, hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener, TestLinkSite testlink)
          Seeks for Test Results in a directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includePattern

protected final java.lang.String includePattern
Include pattern used when looking for results.


keyCustomField

protected final java.lang.String keyCustomField
Key custom field.


includeNotes

protected final boolean includeNotes
Whether the plug-in must include notes when updating test cases.

Constructor Detail

ResultSeeker

public ResultSeeker(java.lang.String includePattern,
                    java.lang.String keyCustomField,
                    boolean includeNotes)
Creates a result seeker passing a ant-like pattern to look for results.

Parameters:
includePattern - Include pattern when looking for results.
Method Detail

getIncludePattern

public java.lang.String getIncludePattern()
Returns:
the includePattern

getKeyCustomField

public java.lang.String getKeyCustomField()
Returns:
the keyCustomField

isIncludeNotes

public boolean isIncludeNotes()
Returns:
the enableNotes

getDescriptor

public ResultSeekerDescriptor getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<ResultSeeker>

all

public static hudson.DescriptorExtensionList<ResultSeeker,hudson.model.Descriptor<ResultSeeker>> all()

allExcept

public static hudson.DescriptorExtensionList<ResultSeeker,hudson.model.Descriptor<ResultSeeker>> allExcept(hudson.model.Node current)

seek

public abstract void seek(TestCaseWrapper[] automatedTestCases,
                          hudson.model.AbstractBuild<?,?> build,
                          hudson.Launcher launcher,
                          hudson.model.BuildListener listener,
                          TestLinkSite testlink)
                   throws ResultSeekerException

Seeks for Test Results in a directory. It tries to match the includePattern with files in this directory.

It looks for results using the include pattern, but this value is matched within the workspace. It means that your result files have to be relative to your workspace.

For each result found, it is automatically updated in TestLink, and the Report is updated.

Parameters:
automatedTestcases - Automated test cases
workspace - Build workspace, used when looking for results using the include pattern
listener - Build listener for logging
testlink - TestLink site for updating test status
Throws:
ResultSeekerException

getBase64FileContent

protected java.lang.String getBase64FileContent(java.io.File file)
                                         throws java.io.IOException
Retrieves the file content encoded in Base64.

Parameters:
file - file to read the content.
Returns:
file content encoded in Base64.
Throws:
java.io.IOException

scan

protected java.lang.String[] scan(java.io.File directory,
                                  java.lang.String includes,
                                  hudson.model.BuildListener listener)
                           throws java.io.IOException
Scans a directory for files matching the includes pattern.

Parameters:
directory - the directory to scan.
includes - the includes pattern.
listener - Hudson Build listener.
Returns:
array of strings of paths for files that match the includes pattern in the directory.
Throws:
java.io.IOException

getKeyCustomField

protected br.eti.kinoshita.testlinkjavaapi.model.CustomField getKeyCustomField(java.util.List<br.eti.kinoshita.testlinkjavaapi.model.CustomField> customFields,
                                                                               java.lang.String keyCustomFieldName)
Gets the key custom field out of a list using the key custom field name.


compareTo

public int compareTo(ResultSeeker o)
Specified by:
compareTo in interface java.lang.Comparable<ResultSeeker>


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