Package hudson.plugins.robot.model
Class RobotTestObject
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.plugins.robot.model.RobotTestObject
-
- All Implemented Interfaces:
ModelObject
,SearchableModelObject
,SearchItem
,Serializable
- Direct Known Subclasses:
RobotCaseResult
,RobotResult
,RobotSuiteResult
public abstract class RobotTestObject extends AbstractModelObject implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected long
duration
-
Constructor Summary
Constructors Constructor Description RobotTestObject()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doDurationGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Return duration graph of the case in the request.void
doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Return robot trend graph in the request.abstract long
getCriticalFailed()
abstract long
getCriticalPassed()
abstract String
getDescription()
String
getDuplicateSafeName()
long
getDuration()
Get duration of this testobject runString
getDurationDiff(RobotTestObject comparable)
Get difference in of duration to given test objectabstract int
getFailed()
boolean
getHasLog()
boolean
getHasReport()
String
getHumanReadableDuration()
Wrapper for calling formatting from jellyString
getId()
String
getLogFile()
abstract String
getName()
protected String
getOldFormatName()
The name format used in case hashmap was changed in commit 59c8eec3e16f28baf1288848fccbac228bbe4748, July 2013.Run<?,?>
getOwner()
Return the build that this result belongs to.abstract RobotTestObject
getParent()
RobotBuildAction
getParentAction()
abstract int
getPassed()
abstract RobotTestObject
getPreviousResult()
String
getRelativeId(RobotTestObject thisObject)
Get path in tree relative to given TestObjectString
getRelativePackageName(RobotTestObject thisObject)
Generates the full packagenameString
getRelativeParent(RobotTestObject thisObject)
String
getReportFile()
RobotTestObject
getResultInBuild(AbstractBuild<?,?> build)
Get the corresponding result object from a given buildabstract int
getSkipped()
protected boolean
isNeedToGenerate(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Figure out if there's been changes since last request.void
setDuplicateSafeName(String name)
void
setId(String id)
void
setLogFile(String logFileName)
void
setParentAction(RobotBuildAction parentAction)
void
setReportFile(String reportFileName)
String
urlEncode(String name)
-
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
-
Methods inherited from interface hudson.model.ModelObject
getDisplayName
-
Methods inherited from interface hudson.search.SearchItem
getSearchUrl
-
-
-
-
Method Detail
-
getParentAction
public RobotBuildAction getParentAction()
-
setParentAction
public void setParentAction(RobotBuildAction parentAction)
-
getName
public abstract String getName()
-
getDescription
public abstract String getDescription()
-
getParent
public abstract RobotTestObject getParent()
-
getId
public String getId()
-
setId
public void setId(String id)
-
getLogFile
public String getLogFile()
-
setLogFile
public void setLogFile(String logFileName)
-
getReportFile
public String getReportFile()
-
setReportFile
public void setReportFile(String reportFileName)
-
getHasLog
public boolean getHasLog()
-
getHasReport
public boolean getHasReport()
-
getRelativePackageName
public String getRelativePackageName(RobotTestObject thisObject)
Generates the full packagename- Parameters:
thisObject
- Robot test object- Returns:
- package name
-
getRelativeParent
public String getRelativeParent(RobotTestObject thisObject)
-
getRelativeId
public String getRelativeId(RobotTestObject thisObject)
Get path in tree relative to given TestObject- Parameters:
thisObject
- The wanted testobject- Returns:
- Path to TestObject
-
getOwner
public Run<?,?> getOwner()
Return the build that this result belongs to.- Returns:
- Build object. Null if no build.
-
getResultInBuild
public RobotTestObject getResultInBuild(AbstractBuild<?,?> build)
Get the corresponding result object from a given build- Parameters:
build
- The Jenkins build- Returns:
- TestObject for given build
-
getDuplicateSafeName
public String getDuplicateSafeName()
-
setDuplicateSafeName
public void setDuplicateSafeName(String name)
-
getOldFormatName
protected String getOldFormatName()
The name format used in case hashmap was changed in commit 59c8eec3e16f28baf1288848fccbac228bbe4748, July 2013. This method allows accessing the tests from old saved results. TODO: Remove this after a year or so?- Returns:
- Name in old format
-
isNeedToGenerate
protected boolean isNeedToGenerate(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Figure out if there's been changes since last request.- Parameters:
req
- StaplerRequestrsp
- StaplerResponse- Returns:
- true if modified, false otherwise
- Throws:
IOException
- thrown exception
-
getDuration
public long getDuration()
Get duration of this testobject run- Returns:
- Duration of this testobject run
-
getHumanReadableDuration
public String getHumanReadableDuration()
Wrapper for calling formatting from jelly- Returns:
- Duration in human readable form
-
getDurationDiff
public String getDurationDiff(RobotTestObject comparable)
Get difference in of duration to given test object- Parameters:
comparable
- another testobject which to compare to- Returns:
- time difference in human readable format
-
getPreviousResult
public abstract RobotTestObject getPreviousResult()
-
getFailed
public abstract int getFailed()
-
getPassed
public abstract int getPassed()
-
getSkipped
public abstract int getSkipped()
-
getCriticalPassed
public abstract long getCriticalPassed()
-
getCriticalFailed
public abstract long getCriticalFailed()
-
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
- StaplerRequestrsp
- StaplerResponse- Throws:
IOException
- thrown exception
-
doDurationGraph
public void doDurationGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Return duration graph of the case in the request.- Parameters:
req
- StaplerRequestrsp
- StaplerResponse- Throws:
IOException
- thrown exception
-
-