hudson.plugins.robot
Class RobotBuildAction

java.lang.Object
  extended by hudson.tasks.test.AbstractTestResultAction
      extended by hudson.plugins.robot.RobotBuildAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.HealthReportingAction, hudson.model.ModelObject, org.kohsuke.stapler.StaplerProxy

public class RobotBuildAction
extends hudson.tasks.test.AbstractTestResultAction
implements org.kohsuke.stapler.StaplerProxy


Field Summary
 
Fields inherited from class hudson.tasks.test.AbstractTestResultAction
owner
 
Constructor Summary
RobotBuildAction(hudson.model.AbstractBuild<?,?> build, RobotResult result, java.lang.String outputPath, hudson.model.BuildListener listener, java.lang.String logFileLink)
          Create new Robot build action
 
Method Summary
 void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Return robot trend graph in the request.
 void doIndex(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Serves Robot html report via robot url.
 RobotTestObject findObjectById(java.lang.String id)
          Find test object from the results object tree
 double getCriticalPassPercentage()
          Get ratio of passed tests per total tests.
 java.lang.String getDisplayName()
          
 int getFailCount()
           
 java.lang.String getIconFileName()
          
 java.lang.String getLogFileLink()
          Get filename to link to
 double getOverallPassPercentage()
          Get ratio of passed tests per total tests.
 hudson.model.AbstractBuild<?,?> getOwner()
          Get build associated to action
 java.lang.String getReportFileName()
          Get file name for Robot html report.
 RobotResult getResult()
          Returns Robotresult.
 hudson.FilePath getRobotDir()
          Return path of robot files in build
 java.lang.Object getTarget()
          Get the result object which is responsible for UI.
 int getTotalCount()
           
 java.lang.String getUrlName()
          
 void setResult(RobotResult result, hudson.model.BuildListener listener)
          Loads new data to RobotResult.
 
Methods inherited from class hudson.tasks.test.AbstractTestResultAction
doGraphMap, findCorrespondingResult, findPreviousCorresponding, getApi, getBuildHealth, getDescription, getFailedTests, getFailureDiffString, getPreviousResult, getSkipCount, getTestResultPath, readResolve, setDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotBuildAction

public RobotBuildAction(hudson.model.AbstractBuild<?,?> build,
                        RobotResult result,
                        java.lang.String outputPath,
                        hudson.model.BuildListener listener,
                        java.lang.String logFileLink)
Create new Robot build action

Parameters:
build - Build which this action is associated to
result - Robot result
outputPath - Path where the Robot report is stored relative to build root
reportFileName - Name of Robot html report file stored
Method Detail

getOwner

public hudson.model.AbstractBuild<?,?> getOwner()
Get build associated to action

Returns:
build object

getLogFileLink

public java.lang.String getLogFileLink()
Get filename to link to

Returns:
null if no filename specified

setResult

public void setResult(RobotResult result,
                      hudson.model.BuildListener listener)
Loads new data to RobotResult.


getResult

public RobotResult getResult()
Returns Robotresult. If not in memory loads it from disk.

Specified by:
getResult in class hudson.tasks.test.AbstractTestResultAction

getReportFileName

public java.lang.String getReportFileName()
Get file name for Robot html report.

Returns:
file name as string

getOverallPassPercentage

public double getOverallPassPercentage()
Get ratio of passed tests per total tests. Accounts for all tests run.

Returns:
percent number

getCriticalPassPercentage

public double getCriticalPassPercentage()
Get ratio of passed tests per total tests. Accounts for only critical tests run.

Returns:
percent number

findObjectById

public RobotTestObject findObjectById(java.lang.String id)
Find test object from the results object tree

Parameters:
id - path e.g. "suite/nestedsuite/testcase"
Returns:
test object

getTarget

public java.lang.Object getTarget()
Get the result object which is responsible for UI. If an old project doesn't have it provides buildaction as this.

Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy

doIndex

public void doIndex(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException,
                    javax.servlet.ServletException,
                    java.lang.InterruptedException
Serves Robot html report via robot url. Shows not found page if file is missing.

Parameters:
req -
rsp -
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.InterruptedException

doGraph

public void doGraph(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException
Return robot trend graph in the request.

Overrides:
doGraph in class hudson.tasks.test.AbstractTestResultAction
Parameters:
req -
rsp -
Throws:
java.io.IOException

getRobotDir

public hudson.FilePath getRobotDir()
Return path of robot files in build

Returns:

getFailCount

public int getFailCount()
Specified by:
getFailCount in class hudson.tasks.test.AbstractTestResultAction

getTotalCount

public int getTotalCount()
Specified by:
getTotalCount in class hudson.tasks.test.AbstractTestResultAction

getIconFileName

public java.lang.String getIconFileName()

Specified by:
getIconFileName in interface hudson.model.Action
Overrides:
getIconFileName in class hudson.tasks.test.AbstractTestResultAction

getDisplayName

public java.lang.String getDisplayName()

Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject
Overrides:
getDisplayName in class hudson.tasks.test.AbstractTestResultAction

getUrlName

public java.lang.String getUrlName()

Specified by:
getUrlName in interface hudson.model.Action
Overrides:
getUrlName in class hudson.tasks.test.AbstractTestResultAction


Copyright © 2004-2012. All Rights Reserved.