Package hudson.tasks.junit
Class PackageResult
-
- All Implemented Interfaces:
ModelObject
,SearchableModelObject
,SearchItem
,Serializable
,Comparable<PackageResult>
public final class PackageResult extends MetaTabulatedResult implements Comparable<PackageResult>
Cumulative test result for a package.- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class hudson.tasks.test.TabulatedResult
testsByBlock
-
-
Constructor Summary
Constructors Constructor Description PackageResult(TestResult parent, String packageName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(CaseResult r)
int
compareTo(PackageResult that)
boolean
equals(Object obj)
TestResult
findCorrespondingResult(String id)
Find the test result corresponding to the one identified byid
within this test result.Collection<ClassResult>
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".ClassResult
getClassResult(String name)
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.List<CaseResult>
getFailedTests()
Returns a list of the failed cases, in no particular sort orderList<CaseResult>
getFailedTestsSortedByAge()
Returns a list of the failed cases, sorted by age.String
getName()
Gets the name of this object.TestResult
getParent()
Reverse pointer ofTabulatedResult.getChildren()
.int
getPassCount()
Gets the total number of passed tests.List<CaseResult>
getPassedTests()
Gets the "children" of this test result that passedRun<?,?>
getRun()
String
getSafeName()
Gets the version ofTestObject.getName()
that's URL-safe.int
getSkipCount()
Gets the total number of skipped tests.List<CaseResult>
getSkippedTests()
Gets the "children" of this test result that were skippedlong
getStartTime()
String
getTitle()
Gets the human readable title of this result object.boolean
hasChildren()
Whether this test result has children.int
hashCode()
boolean
isPassed()
void
setStartTime(long time)
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, getParentAction, getPreviousResult, getProperties, getResultInRun, getStderr, getStdout, setParent, setParentAction, toPrettyString
-
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getFullDisplayName, getFullName, getHistory, getId, getRelativePathFrom, 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
-
PackageResult
public PackageResult(TestResult parent, String packageName)
-
-
Method Detail
-
getRun
public Run<?,?> getRun()
- Overrides:
getRun
in classTestObject
- Returns:
- the run in which this test was executed.
-
getParent
public TestResult getParent()
Description copied from class:TestObject
Reverse pointer ofTabulatedResult.getChildren()
.- Specified by:
getParent
in classTestObject
- Returns:
- the parent
TestObject
.
-
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.
-
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.
-
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.
-
getDynamic
public Object getDynamic(String name, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
- Overrides:
getDynamic
in classTestObject
-
getClassResult
public ClassResult getClassResult(String name)
-
getChildren
@Exported(name="child") public Collection<ClassResult> 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()
Whether this test result has children.- Specified by:
hasChildren
in classTabulatedResult
-
getFailedTests
public List<CaseResult> getFailedTests()
Returns a list of the failed cases, in no particular sort order- Specified by:
getFailedTests
in classMetaTabulatedResult
- Returns:
- the children of this test result, if any, or an empty collection
-
getFailedTestsSortedByAge
public List<CaseResult> getFailedTestsSortedByAge()
Returns a list of the failed cases, sorted by age.- Returns:
- a list of the failed cases, sorted by age.
-
getPassedTests
public List<CaseResult> getPassedTests()
Gets the "children" of this test result that passed- Overrides:
getPassedTests
in classTestResult
- Returns:
- the children of this test result, if any, or an empty collection
-
getSkippedTests
public List<CaseResult> getSkippedTests()
Gets the "children" of this test result that were skipped- Overrides:
getSkippedTests
in classTestResult
- Returns:
- the children of this test result, if any, or an empty list
-
isPassed
public boolean isPassed()
- Overrides:
isPassed
in classTestResult
- Returns:
- true if every test was not skipped and every test did not fail, false otherwise.
-
add
public void add(CaseResult r)
-
tally
public void tally()
Recount my children- Overrides:
tally
in classTestResult
-
compareTo
public int compareTo(PackageResult that)
- Specified by:
compareTo
in interfaceComparable<PackageResult>
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
-
setStartTime
public void setStartTime(long time)
-
-