Package hudson.tasks.junit
Class ClassResult
-
- All Implemented Interfaces:
ModelObject
,SearchableModelObject
,SearchItem
,Serializable
,Comparable<ClassResult>
public final class ClassResult extends TabulatedResult implements Comparable<ClassResult>
Cumulative test result of a test class.- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class hudson.tasks.test.TabulatedResult
testsByBlock
-
-
Constructor Summary
Constructors Constructor Description ClassResult(PackageResult parent, String className)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(CaseResult r)
int
compareTo(ClassResult that)
boolean
equals(Object obj)
TestResult
findCorrespondingResult(String id)
Find the test result corresponding to the one identified byid
within this test result.CaseResult
getCaseResult(String name)
List<CaseResult>
getChildren()
Gets the child test result objects.String
getChildTitle()
String
getChildType()
Get a simple name for the type of children theTabulatedResult.getChildren()
method returns, for example "case", "class" or "package".String
getClassName()
String
getDisplayName()
float
getDuration()
Time it took to run this test.Object
getDynamic(String name, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
int
getFailCount()
Gets the total number of failed tests.String
getFullDisplayName()
String
getFullName()
Gets the full name of this object.String
getName()
Gets the name of this object.PackageResult
getParent()
Reverse pointer ofTabulatedResult.getChildren()
.int
getPassCount()
Gets the total number of passed tests.ClassResult
getPreviousResult()
Gets the counter part of thisTestResult
in the previous run.String
getRelativePathFrom(TestObject it)
Gets the relative path to this test case from the given object.Run<?,?>
getRun()
String
getSafeName()
Gets the version ofTestObject.getName()
that's URL-safe.int
getSkipCount()
Gets the total number of skipped tests.long
getStartTime()
String
getTitle()
Gets the human readable title of this result object.boolean
hasChildren()
int
hashCode()
void
setStartTime(long start)
void
tally()
Recount my children.-
Methods inherited from class hudson.tasks.test.TabulatedResult
blockToTestResult, getPipelineBlockWithTests, hasMultipleBlocks, populateBlocks
-
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getErrorDetails, getErrorStackTrace, getFailedSince, getFailedSinceRun, getFailedTests, getParentAction, getPassedTests, getProperties, getResultInRun, getSkippedTests, getStderr, getStdout, isPassed, setParent, setParentAction, toPrettyString
-
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getHistory, getId, getResultInBuild, getSearchUrl, getTestAction, getTestActions, getTestResult, getTestResultAction, getTopLevelTestResult, getTotalCount, getUrl, safe, setDescription, uniquifyName
-
Methods inherited from class hudson.tasks.junit.TestObject
getOwner
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Constructor Detail
-
ClassResult
public ClassResult(PackageResult parent, String className)
-
-
Method Detail
-
getRun
public Run<?,?> getRun()
- Overrides:
getRun
in classTestObject
- Returns:
- the run in which this test was executed.
-
getParent
public PackageResult getParent()
Description copied from class:TestObject
Reverse pointer ofTabulatedResult.getChildren()
.- Specified by:
getParent
in classTestObject
- Returns:
- the parent
TestObject
.
-
getPreviousResult
public ClassResult getPreviousResult()
Description copied from class:TestResult
Gets the counter part of thisTestResult
in the previous run.- Overrides:
getPreviousResult
in classTestResult
- Returns:
- null if no such counter part exists.
-
findCorrespondingResult
public TestResult findCorrespondingResult(String id)
Description copied from class:TestObject
Find the test result corresponding to the one identified byid
within this test result.- Specified by:
findCorrespondingResult
in classTestObject
- Parameters:
id
- The path to the original test result- Returns:
- A corresponding test result, or null if there is no corresponding result.
-
getTitle
public String getTitle()
Description copied from class:TestResult
Gets the human readable title of this result object.- Overrides:
getTitle
in classTestResult
- Returns:
- the human readable title of this result object.
-
getChildTitle
public String getChildTitle()
- Overrides:
getChildTitle
in classTabulatedResult
-
getChildType
public String getChildType()
Description copied from class:TabulatedResult
Get a simple name for the type of children theTabulatedResult.getChildren()
method returns, for example "case", "class" or "package".- Overrides:
getChildType
in classTabulatedResult
- Returns:
- the type of children this result has, all lowercase.
-
getName
@Exported(visibility=999) public String getName()
Description copied from class:TestObject
Gets the name of this object.- Overrides:
getName
in classTestObject
- Returns:
- the name of this object.
-
getSafeName
public String getSafeName()
Description copied from class:TestObject
Gets the version ofTestObject.getName()
that's URL-safe.- Overrides:
getSafeName
in classTestObject
- Returns:
- the URL-safe name of this object.
-
getCaseResult
public CaseResult getCaseResult(String name)
-
getDynamic
public Object getDynamic(String name, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
- Overrides:
getDynamic
in classTestObject
-
getChildren
@Exported(name="child") public List<CaseResult> getChildren()
Description copied from class:TabulatedResult
Gets the child test result objects.- Specified by:
getChildren
in classTabulatedResult
- Returns:
- the child test result objects.
- See Also:
TestObject.getParent()
-
hasChildren
public boolean hasChildren()
- Specified by:
hasChildren
in classTabulatedResult
-
getDuration
public float getDuration()
Description copied from class:TestResult
Time it took to run this test. In seconds.- Overrides:
getDuration
in classTestResult
- Returns:
- the time in seconds the test ran.
-
getStartTime
public long getStartTime()
-
getPassCount
@Exported public int getPassCount()
Description copied from class:TestResult
Gets the total number of passed tests.- Overrides:
getPassCount
in classTestResult
- Returns:
- the total number of passed tests.
-
getFailCount
@Exported public int getFailCount()
Description copied from class:TestResult
Gets the total number of failed tests.- Overrides:
getFailCount
in classTestResult
- Returns:
- the total number of failed tests.
-
getSkipCount
@Exported public int getSkipCount()
Description copied from class:TestResult
Gets the total number of skipped tests.- Overrides:
getSkipCount
in classTestResult
- Returns:
- the total number of skipped tests.
-
add
public void add(CaseResult r)
-
tally
public void tally()
Recount my children.- Overrides:
tally
in classTestResult
-
getClassName
public String getClassName()
-
compareTo
public int compareTo(ClassResult that)
- Specified by:
compareTo
in interfaceComparable<ClassResult>
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
-
getFullName
public String getFullName()
Description copied from class:TestObject
Gets the full name of this object.- Overrides:
getFullName
in classTestObject
- Returns:
- the full name of this object.
- Since:
- 1.515
-
getFullDisplayName
public String getFullDisplayName()
- Overrides:
getFullDisplayName
in classTestObject
-
getRelativePathFrom
public String getRelativePathFrom(TestObject it)
Gets the relative path to this test case from the given object.- Overrides:
getRelativePathFrom
in classTestObject
- Parameters:
it
- Target test object.- Returns:
- A relative path to this object, potentially from the top of the Hudson object model
-
setStartTime
public void setStartTime(long start)
-
-