Package hudson.plugins.robot.model
Class RobotResult
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.plugins.robot.model.RobotTestObject
-
- hudson.plugins.robot.model.RobotResult
-
- All Implemented Interfaces:
ModelObject
,SearchableModelObject
,SearchItem
,Serializable
- Direct Known Subclasses:
AggregatedRobotAction.AggregatedRobotResult
@ExportedBean 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
Constructors Constructor Description RobotResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSuite(RobotSuiteResult suite)
Add a suite to this result.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-pathList<RobotCaseResult>
getAllCases()
List<RobotCaseResult>
getAllFailedCases()
Get all failed test cases related to result.List<RobotCaseResult>
getAllPassedCases()
Get all passed test cases related to result.List<RobotCaseResult>
getAllSkippedCases()
Get all skipped test cases related to result.List<RobotSuiteResult>
getAllSuites()
Get all testsuites related to result.Api
getApi()
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
getDescription()
String
getDisplayName()
}long
getDuration()
Get the total duration of the test runObject
getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Return the object represented by url-stringList<String>
getExecutedSuites()
int
getFailed()
List<String>
getFailedCases()
Get all failed test case names related to result.String
getName()
long
getOverallFailed()
Get number of all failed tests.long
getOverallPassed()
Get number of all passed tests.long
getOverallSkipped()
Get number of all skipped tests.long
getOverallTotal()
Get number of all tests.RobotTestObject
getParent()
int
getPassed()
List<String>
getPassedCases()
Get all passed test case names related to result.double
getPassPercentage()
double
getPassPercentage(boolean onlyCritical)
Returns pass percentage of passed tests per total tests.RobotResult
getPreviousResult()
String
getSearchUrl()
int
getSkipped()
List<String>
getSkippedCases()
Get all skipped test case names related to result.double
getSkipPercentage()
List<RobotResultStatistics>
getStatsByCategory()
Get pass/fail stats by category.RobotSuiteResult
getSuite(String name)
Get top level suite by nameCollection<RobotSuiteResult>
getSuites()
Get all top level suitesString
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
doDurationGraph, doGraph, getDuplicateSafeName, getDurationDiff, getHasLog, getHasReport, getHumanReadableDuration, getId, getLogFile, getOldFormatName, getOwner, getParentAction, getRelativeId, getRelativePackageName, getRelativeParent, getReportFile, getResultInBuild, isNeedToGenerate, setDuplicateSafeName, setId, setLogFile, setParentAction, setReportFile, urlEncode
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
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 classRobotTestObject
-
getDescription
public String getDescription()
- Specified by:
getDescription
in classRobotTestObject
-
getCriticalPassed
@Exported public long getCriticalPassed()
Get number of passed critical tests.- Specified by:
getCriticalPassed
in classRobotTestObject
- Returns:
- number of passed critical tests
-
getCriticalFailed
@Exported public long getCriticalFailed()
Get number of failed critical tests.- Specified by:
getCriticalFailed
in classRobotTestObject
- Returns:
- number of failed critical tests
-
getCriticalTotal
@Exported public long getCriticalTotal()
Get total number of critical tests.- Returns:
- total number of critical tests
-
getOverallPassed
@Exported public long getOverallPassed()
Get number of all passed tests.- Returns:
- number of all passed tests
-
getOverallFailed
@Exported public long getOverallFailed()
Get number of all failed tests.- Returns:
- number of all failed tests
-
getOverallSkipped
@Exported public long getOverallSkipped()
Get number of all skipped tests.- Returns:
- number of all skipped tests
-
getOverallTotal
@Exported public long getOverallTotal()
Get number of all tests.- Returns:
- number of all tests
-
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
@Exported public String getTimeStamp()
Get the timestamp of the original test run.- Returns:
- timestamp of the original test run
-
setTimeStamp
public void setTimeStamp(String timeStamp)
Set the timestamp of test run.- Parameters:
timeStamp
- The wanted 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
-
getPassPercentage
@Exported public double getPassPercentage()
-
getSkipPercentage
@Exported public double getSkipPercentage()
-
getDisplayName
public String getDisplayName()
}
-
getSearchUrl
public String getSearchUrl()
-
getSuite
public RobotSuiteResult getSuite(String name)
Get top level suite by name- Parameters:
name
- suite 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
- RobotSuiteResult to add
-
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
-
getAllPassedCases
public List<RobotCaseResult> getAllPassedCases()
Get all passed test cases related to result.- Returns:
- list of test case results
-
getAllSkippedCases
public List<RobotCaseResult> getAllSkippedCases()
Get all skipped test cases related to result.- Returns:
- list of test case results
-
getFailedCases
@Exported public List<String> getFailedCases()
Get all failed test case names related to result.- Returns:
- list of test case names as strings
-
getPassedCases
@Exported public List<String> getPassedCases()
Get all passed test case names related to result.- Returns:
- list of test case names as strings
-
getSkippedCases
@Exported public List<String> getSkippedCases()
Get all skipped test case names related to result.- Returns:
- list of test case names as strings
-
tally
public void tally(RobotBuildAction robotBuildAction)
Count the totals in result tree and assign parent action.- Parameters:
robotBuildAction
- The action to be used as the base
-
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
- Tokenreq
- StaplerRequestrsp
- StaplerResponse- Returns:
- object represented by url-string
-
doReport
public 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
- StaplerRequestrsp
- StaplerResponse- Returns:
- DirectoryBrowserSupport for the report or null
- Throws:
IOException
- thrown exceptionjavax.servlet.ServletException
- thrown exceptionInterruptedException
- thrown exception
-
getParent
public RobotTestObject getParent()
- Specified by:
getParent
in classRobotTestObject
-
getDuration
public long getDuration()
Get the total duration of the test run- Overrides:
getDuration
in classRobotTestObject
- Returns:
- duration
-
getPreviousResult
public RobotResult getPreviousResult()
- Specified by:
getPreviousResult
in classRobotTestObject
-
getFailed
public int getFailed()
- Specified by:
getFailed
in classRobotTestObject
-
getPassed
public int getPassed()
- Specified by:
getPassed
in classRobotTestObject
-
getSkipped
public int getSkipped()
- Specified by:
getSkipped
in classRobotTestObject
-
getApi
public Api getApi()
-
getAllCases
public List<RobotCaseResult> getAllCases()
-
-