hudson.plugins.robot
Class RobotPublisher

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.tasks.Recorder
              extended by hudson.plugins.robot.RobotPublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.matrix.MatrixAggregatable, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep, java.io.Serializable

public class RobotPublisher
extends hudson.tasks.Recorder
implements java.io.Serializable, hudson.matrix.MatrixAggregatable

See Also:
Serialized Form

Nested Class Summary
static class RobotPublisher.DescriptorImpl
          Descriptor for the publisher
 
Nested classes/interfaces inherited from class hudson.tasks.Publisher
hudson.tasks.Publisher.DescriptorExtensionListImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
protected static java.lang.String DEFAULT_REPORT_FILE
           
protected static java.lang.String FILE_ARCHIVE_DIR
           
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
RobotPublisher(java.lang.String outputPath, java.lang.String outputFileName, java.lang.String reportFileName, java.lang.String logFileName, double passThreshold, double unstableThreshold, boolean onlyCritical, java.lang.String logFileLink, java.lang.String otherFiles)
          Create new publisher for Robot Framework results
 
Method Summary
static void copyFilesToBuildDir(hudson.model.AbstractBuild<?,?> build, java.lang.String inputPath, java.lang.String... filemaskToCopy)
          Copy files with given filemasks from input path relative to build into specific build file archive dir
 hudson.matrix.MatrixAggregator createAggregator(hudson.matrix.MatrixBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener)
           
static void flattenDirsCopy(java.lang.String filemask, hudson.FilePath srcDir, hudson.FilePath destDir)
          Copy files matching given filemask from all subdirectories to destination directory
protected  hudson.model.Result getBuildResult(hudson.model.AbstractBuild<?,?> build, RobotResult result)
          Determines the build result based on set thresholds.
 java.lang.String getLogFileLink()
          Return the filename to be rendered in the job front page
 java.lang.String getLogFileName()
          Gets the name of log html file.
 boolean getOnlyCritical()
          Gets if only critical tests should be accounted for the thresholds.
 java.lang.String getOtherFiles()
          Gets the comma separated list of other filemasks to copy into build dir
 java.lang.String getOutputFileName()
          Gets the name of output xml file.
 java.lang.String getOutputPath()
          Gets the output path of Robot files
 double getPassThreshold()
          Gets the test pass percentage threshold for successful builds.
 java.util.Collection<hudson.model.Action> getProjectActions(hudson.model.AbstractProject<?,?> project)
          
 java.lang.String getReportFileName()
          Gets the name of report html file.
 hudson.tasks.BuildStepMonitor getRequiredMonitorService()
           
static java.lang.String getSuffix(java.lang.String filename)
          Return file suffix from string.
 double getUnstableThreshold()
          Gets the test pass percentage threshold for unstable builds.
protected  RobotResult parse(java.lang.String expandedTestResults, java.lang.String outputPath, hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
           
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          
static java.lang.String trimSuffix(java.lang.String filename)
          Return filename without file suffix.
 
Methods inherited from class hudson.tasks.Recorder
getDescriptor
 
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, prebuild
 

Field Detail

DEFAULT_REPORT_FILE

protected static final java.lang.String DEFAULT_REPORT_FILE
See Also:
Constant Field Values

FILE_ARCHIVE_DIR

protected static final java.lang.String FILE_ARCHIVE_DIR
See Also:
Constant Field Values
Constructor Detail

RobotPublisher

@DataBoundConstructor
public RobotPublisher(java.lang.String outputPath,
                                           java.lang.String outputFileName,
                                           java.lang.String reportFileName,
                                           java.lang.String logFileName,
                                           double passThreshold,
                                           double unstableThreshold,
                                           boolean onlyCritical,
                                           java.lang.String logFileLink,
                                           java.lang.String otherFiles)
Create new publisher for Robot Framework results

Parameters:
outputPath - Path to Robot Framework's output files
outputFileName - Name of Robot output xml
reportFileName - Name of Robot report html
logFileName - Name of Robot log html
passThreshold - Threshold of test pass percentage for successful builds
unstableThreshold - Threhold of test pass percentage for unstable builds
onlyCritical - True if only critical tests are included in pass percentage
Method Detail

getOutputPath

public java.lang.String getOutputPath()
Gets the output path of Robot files

Returns:

getOutputFileName

public java.lang.String getOutputFileName()
Gets the name of output xml file. Reverts to default if empty or whitespace.

Returns:

getReportFileName

public java.lang.String getReportFileName()
Gets the name of report html file. Reverts to default if empty or whitespace.

Returns:

getLogFileName

public java.lang.String getLogFileName()
Gets the name of log html file. Reverts to default if empty or whitespace.

Returns:

getPassThreshold

public double getPassThreshold()
Gets the test pass percentage threshold for successful builds.

Returns:

getUnstableThreshold

public double getUnstableThreshold()
Gets the test pass percentage threshold for unstable builds.

Returns:

getOnlyCritical

public boolean getOnlyCritical()
Gets if only critical tests should be accounted for the thresholds.

Returns:

getLogFileLink

public java.lang.String getLogFileLink()
Return the filename to be rendered in the job front page

Returns:
null if empty file configured

getOtherFiles

public java.lang.String getOtherFiles()
Gets the comma separated list of other filemasks to copy into build dir

Returns:
List of files as string

getProjectActions

public java.util.Collection<hudson.model.Action> getProjectActions(hudson.model.AbstractProject<?,?> project)

Specified by:
getProjectActions in interface hudson.tasks.BuildStep
Overrides:
getProjectActions in class hudson.tasks.BuildStepCompatibilityLayer

parse

protected RobotResult parse(java.lang.String expandedTestResults,
                            java.lang.String outputPath,
                            hudson.model.AbstractBuild<?,?> build,
                            hudson.Launcher launcher,
                            hudson.model.BuildListener listener)
                     throws java.io.IOException,
                            java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

perform

public boolean perform(hudson.model.AbstractBuild<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws java.lang.InterruptedException,
                       java.io.IOException

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Throws:
java.lang.InterruptedException
java.io.IOException

copyFilesToBuildDir

public static void copyFilesToBuildDir(hudson.model.AbstractBuild<?,?> build,
                                       java.lang.String inputPath,
                                       java.lang.String... filemaskToCopy)
                                throws java.io.IOException,
                                       java.lang.InterruptedException
Copy files with given filemasks from input path relative to build into specific build file archive dir

Parameters:
build -
inputPath - Base path for copy. Relative to build workspace.
filemaskToCopy - List of Ant GLOB style filemasks to copy from dirs specified at inputPathMask
Throws:
java.io.IOException
java.lang.InterruptedException

flattenDirsCopy

public static void flattenDirsCopy(java.lang.String filemask,
                                   hudson.FilePath srcDir,
                                   hudson.FilePath destDir)
                            throws java.io.IOException,
                                   java.lang.InterruptedException
Copy files matching given filemask from all subdirectories to destination directory

Parameters:
filemask - Ant GLOB style filemask
srcDir - source dir as string
destDir - destination dir as string
Throws:
java.io.IOException - on copy failure
java.lang.InterruptedException

trimSuffix

public static java.lang.String trimSuffix(java.lang.String filename)
Return filename without file suffix.

Parameters:
filename -
Returns:
filename as string

getSuffix

public static java.lang.String getSuffix(java.lang.String filename)
Return file suffix from string.

Parameters:
filename -
Returns:
file suffix as string

getBuildResult

protected hudson.model.Result getBuildResult(hudson.model.AbstractBuild<?,?> build,
                                             RobotResult result)
Determines the build result based on set thresholds. If build is already failed before the tests it won't be changed to successful.

Parameters:
build - Build to be evaluated
result - Results associated to build
Returns:
Result of build

getRequiredMonitorService

public hudson.tasks.BuildStepMonitor getRequiredMonitorService()
Specified by:
getRequiredMonitorService in interface hudson.tasks.BuildStep

createAggregator

public hudson.matrix.MatrixAggregator createAggregator(hudson.matrix.MatrixBuild build,
                                                       hudson.Launcher launcher,
                                                       hudson.model.BuildListener listener)
Specified by:
createAggregator in interface hudson.matrix.MatrixAggregatable


Copyright © 2004-2012. All Rights Reserved.