Package hudson.plugins.testng.results
Class MethodResult
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.tasks.junit.TestObject
-
- hudson.tasks.test.TestObject
-
- hudson.tasks.test.TestResult
-
- hudson.tasks.test.TabulatedResult
-
- hudson.plugins.testng.results.BaseResult
-
- hudson.plugins.testng.results.MethodResult
-
- All Implemented Interfaces:
ModelObject
,SearchableModelObject
,SearchItem
,Serializable
public class MethodResult extends BaseResult
Handles result pertaining to a single test method- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class hudson.plugins.testng.results.BaseResult
name, parent, run
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Creates test method execution history graph.void
doGraphMap(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Creates map to make the graph click-ablehudson.tasks.test.TestResult
findCorrespondingResult(String id)
Collection<? extends hudson.tasks.test.TestResult>
getChildren()
String
getClassName()
Added only to expose class name as part of method result via .../api/xxxObject
getCssClass()
Used to give different color based on test statusString
getDescription()
float
getDuration()
Can't change this to return seconds as expected byTestObject
because it has already been exportedlong
getEndTime()
String
getErrorDetails()
If there was an error or a failure, this is the text from the message.String
getErrorStackTrace()
Added only to expose possible exception via .../api/xxxMethodResultException
getException()
List<String>
getGroups()
List<String>
getParameters()
String
getParentSuiteName()
String
getParentTestName()
String
getReporterOutput()
String
getSafeName()
Date
getStartedAt()
long
getStartTime()
String
getStatus()
String
getTestRunId()
boolean
hasChildren()
boolean
isConfig()
void
setException(MethodResultException exception)
void
setGroups(List<String> groups)
void
setParameters(List<String> parameters)
void
setReporterOutput(String reporterOutput)
void
setTestUuid(String testUuid)
-
Methods inherited from class hudson.plugins.testng.results.BaseResult
getAge, getDisplayName, getDynamic, getName, getParent, getParentAction, getRun, getTestResultAction, getTitle, getUpUrl, setParent, setRun
-
Methods inherited from class hudson.tasks.test.TabulatedResult
blockToTestResult, getChildTitle, getChildType, getPipelineBlockWithTests, hasMultipleBlocks, populateBlocks
-
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getFailCount, getFailedSince, getFailedSinceRun, getFailedTests, getPassCount, getPassedTests, getPreviousResult, getProperties, getResultInRun, getSkipCount, getSkippedTests, getStderr, getStdout, isPassed, setParent, setParentAction, tally, toPrettyString
-
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDurationString, getFullDisplayName, getFullName, getHistory, getId, getRelativePathFrom, getResultInBuild, getSearchUrl, getTestAction, getTestActions, getTestResult, getTopLevelTestResult, getTotalCount, getUrl, safe, setDescription, uniquifyName
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Method Detail
-
setTestUuid
public void setTestUuid(String testUuid)
-
getParentTestName
public String getParentTestName()
- Returns:
- name of the
<test>
tag that this method is part of
-
getParentSuiteName
public String getParentSuiteName()
- Returns:
- name of the suite this method is part of
-
getTestRunId
public String getTestRunId()
-
getStartedAt
@Exported public Date getStartedAt()
-
getStartTime
public long getStartTime()
-
getEndTime
public long getEndTime()
-
getException
public MethodResultException getException()
-
setException
public void setException(MethodResultException exception)
-
getSafeName
public String getSafeName()
- Overrides:
getSafeName
in classhudson.tasks.test.TestObject
-
findCorrespondingResult
public hudson.tasks.test.TestResult findCorrespondingResult(String id)
- Overrides:
findCorrespondingResult
in classBaseResult
-
getDuration
@Exported public float getDuration()
Can't change this to return seconds as expected byTestObject
because it has already been exported- Overrides:
getDuration
in classhudson.tasks.test.TestResult
- Returns:
- duration in milliseconds
-
getStatus
@Exported(visibility=9) public String getStatus()
-
getDescription
@Exported public String getDescription()
- Overrides:
getDescription
in classhudson.tasks.test.TestObject
-
getErrorStackTrace
@Exported(name="exception") public String getErrorStackTrace()
Added only to expose possible exception via .../api/xxx- Overrides:
getErrorStackTrace
in classhudson.tasks.test.TestResult
- Returns:
- String representation of the exception
-
getErrorDetails
public String getErrorDetails()
If there was an error or a failure, this is the text from the message.- Overrides:
getErrorDetails
in classhudson.tasks.test.TestResult
-
getClassName
@Exported(name="className") public String getClassName()
Added only to expose class name as part of method result via .../api/xxx- Returns:
- String representation of the exception
-
isConfig
public boolean isConfig()
-
doGraph
@POST public void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Creates test method execution history graph.- Parameters:
req
- requestrsp
- response- Throws:
IOException
- on IO error
-
doGraphMap
@POST public void doGraphMap(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Creates map to make the graph click-able- Parameters:
req
- requestrsp
- response- Throws:
IOException
- on IO error
-
getCssClass
public Object getCssClass()
Used to give different color based on test status- Returns:
- css class based on result status
-
setReporterOutput
public void setReporterOutput(String reporterOutput)
-
getReporterOutput
public String getReporterOutput()
- Returns:
- reporter output
-
getChildren
public Collection<? extends hudson.tasks.test.TestResult> getChildren()
- Specified by:
getChildren
in classhudson.tasks.test.TabulatedResult
-
hasChildren
public boolean hasChildren()
- Specified by:
hasChildren
in classhudson.tasks.test.TabulatedResult
-
-