hudson.plugins.robot.model
Class RobotResult

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.plugins.robot.model.RobotTestObject
          extended by hudson.plugins.robot.model.RobotResult
All Implemented Interfaces:
hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, Serializable

public class RobotResult
extends RobotTestObject

Class representing Robot Framework test results.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class hudson.plugins.robot.model.RobotTestObject
duration
 
Constructor Summary
RobotResult()
           
 
Method Summary
 void addSuite(RobotSuiteResult suite)
          Add a suite to this result.
 void doDurationGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Return robot trend graph in the request.
 void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Return robot trend graph in the request.
 hudson.model.DirectoryBrowserSupport doReport(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Serves Robot html report via robot url.
 RobotTestObject findObjectById(String id)
          Find a testobject in the result tree with id-path
 List<RobotCaseResult> getAllFailedCases()
          Get all failed test cases related to result.
 List<RobotSuiteResult> getAllSuites()
          Get all testsuites related to result.
 long getCriticalFailed()
          Get number of failed critical tests.
 long getCriticalPassed()
          Get number of passed critical tests.
 long getCriticalTotal()
          Get total number of critical tests.
 String getDisplayName()
          }
 long getDuration()
          Get the total duration of the test run
 Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Return the object represented by url-string
 int getFailed()
           
 String getName()
           
 long getOverallFailed()
          Get number of all failed tests.
 long getOverallPassed()
          Get number of all passed tests.
 long getOverallTotal()
          Get number of all tests.
 RobotTestObject getParent()
          
 int getPassed()
           
 double getPassPercentage(boolean onlyCritical)
          Returns pass percentage of passed tests per total tests.
 RobotResult getPreviousResult()
          
 String getSearchUrl()
          
 List<RobotResultStatistics> getStatsByCategory()
          Get pass/fail stats by category.
 RobotSuiteResult getSuite(String name)
          Get top level suite by name
 Collection<RobotSuiteResult> getSuites()
          Get all top level suites
 String getTimeStamp()
          Get the timestamp of the original test run
 void setStatsByCategory(List<RobotResultStatistics> statsByCategory)
           
 void setTimeStamp(String timeStamp)
          Set the timestamp of test run
 void tally(RobotBuildAction robotBuildAction)
          Count the totals in result tree and assign parent action.
 
Methods inherited from class hudson.plugins.robot.model.RobotTestObject
getDuplicateSafeName, getDurationDiff, getHumanReadableDuration, getOldFormatName, getOwner, getParentAction, getRelativeId, getRelativePackageName, getResultInBuild, isNeedToGenerate, setDuplicateSafeName, setParentAction, urlDecode, urlEncode
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotResult

public RobotResult()
Method Detail

findObjectById

public RobotTestObject findObjectById(String id)
Find a testobject in the result tree with id-path

Parameters:
id - path e.g. "suite/subsuite/testcase"
Returns:
null if not found

getName

public String getName()
Specified by:
getName in class RobotTestObject

getCriticalPassed

public long getCriticalPassed()
Get number of passed critical tests.

Returns:

getCriticalFailed

public long getCriticalFailed()
Get number of failed critical tests.

Returns:

getCriticalTotal

public long getCriticalTotal()
Get total number of critical tests.

Returns:

getOverallPassed

public long getOverallPassed()
Get number of all passed tests.

Returns:

getOverallFailed

public long getOverallFailed()
Get number of all failed tests.

Returns:

getOverallTotal

public long getOverallTotal()
Get number of all tests.

Returns:

getStatsByCategory

public List<RobotResultStatistics> getStatsByCategory()
Get pass/fail stats by category.

Returns:
List containing 'critical tests' and 'all tests'

setStatsByCategory

public void setStatsByCategory(List<RobotResultStatistics> statsByCategory)

getTimeStamp

public String getTimeStamp()
Get the timestamp of the original test run

Returns:

setTimeStamp

public void setTimeStamp(String timeStamp)
Set the timestamp of test run

Parameters:
timeStamp -

getPassPercentage

public double getPassPercentage(boolean onlyCritical)
Returns pass percentage of passed tests per total tests.

Parameters:
onlyCritical - true if only critical tests are to be calculated
Returns:
Percentage value rounded to 1 decimal

getDisplayName

public String getDisplayName()
}


getSearchUrl

public String getSearchUrl()


getSuite

public RobotSuiteResult getSuite(String name)
Get top level suite by name

Parameters:
name -
Returns:
suite result, null when not found

addSuite

public void addSuite(RobotSuiteResult suite)
Add a suite to this result. If suite with same name exists, store this with sequential numbering

Parameters:
suite -

getSuites

public Collection<RobotSuiteResult> getSuites()
Get all top level suites

Returns:
Collection of suiteresults

getAllSuites

public List<RobotSuiteResult> getAllSuites()
Get all testsuites related to result.

Returns:
List of suiteresults

getAllFailedCases

public List<RobotCaseResult> getAllFailedCases()
Get all failed test cases related to result.

Returns:
list of test case results

tally

public void tally(RobotBuildAction robotBuildAction)
Count the totals in result tree and assign parent action.

Parameters:
robotBuildAction -

getDynamic

public Object getDynamic(String token,
                         org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
Return the object represented by url-string

Parameters:
token -
req -
rsp -
Returns:

doReport

public hudson.model.DirectoryBrowserSupport doReport(org.kohsuke.stapler.StaplerRequest req,
                                                     org.kohsuke.stapler.StaplerResponse rsp)
                                              throws IOException,
                                                     javax.servlet.ServletException,
                                                     InterruptedException
Serves Robot html report via robot url. Shows not found page if file is missing. If reportfilename is specified, the report is served (To be compatible with v1.0 builds)

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

doGraph

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

Parameters:
req -
rsp -
Throws:
IOException

doDurationGraph

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

Parameters:
req -
rsp -
Throws:
IOException

getParent

public RobotTestObject getParent()

Specified by:
getParent in class RobotTestObject

getDuration

public long getDuration()
Get the total duration of the test run

Overrides:
getDuration in class RobotTestObject
Returns:
duration

getPreviousResult

public RobotResult getPreviousResult()

Specified by:
getPreviousResult in class RobotTestObject

getFailed

public int getFailed()
Specified by:
getFailed in class RobotTestObject

getPassed

public int getPassed()
Specified by:
getPassed in class RobotTestObject


Copyright © 2004-2013. All Rights Reserved.