hudson.tasks.junit
Class PackageResult

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.tasks.junit.TestObject
          extended by hudson.tasks.test.TestObject
              extended by hudson.tasks.test.TestResult
                  extended by hudson.tasks.test.TabulatedResult
                      extended by hudson.tasks.test.MetaTabulatedResult
                          extended by hudson.tasks.junit.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

Method Summary
 int compareTo(PackageResult that)
           
 TestResult findCorrespondingResult(String id)
          Find the test result corresponding to the one identified by id> withint this test result.
 Collection<ClassResult> getChildren()
          Gets the child test result objects.
 String getChildTitle()
           
 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 order
 List<CaseResult> getFailedTestsSortedByAge()
          Returns a list of the failed cases, sorted by age.
 String getName()
          Gets the name of this object.
 AbstractBuild<?,?> getOwner()
           
 TestResult getParent()
          Reverse pointer of TabulatedResult.getChildren().
 int getPassCount()
          Gets the total number of passed tests.
 Collection<? extends TestResult> getPassedTests()
          Gets the "children" of this test result that passed
 String getSafeName()
          Gets the version of TestObject.getName() that's URL-safe.
 int getSkipCount()
          Gets the total number of skipped tests.
 Collection<? extends TestResult> getSkippedTests()
          Gets the "children" of this test result that were skipped
 String getTitle()
          Gets the human readable title of this result object.
 boolean hasChildren()
          Whether this test result has children.
 boolean isPassed()
           
 void tally()
          Recount my children
 
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getErrorDetails, getErrorStackTrace, getFailedSince, getFailedSinceRun, getParentAction, getPreviousResult, getResultInBuild, getStderr, getStdout, setParent, setParentAction, toPrettyString
 
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getHistory, getId, getRelativePathFrom, getSearchUrl, getTestAction, getTestActions, getTestResult, getTestResultAction, getTopLevelTestResult, getTotalCount, getUrl, safe, setDescription, uniquifyName
 
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
 

Method Detail

getOwner

public AbstractBuild<?,?> getOwner()
Specified by:
getOwner in class TestObject

getParent

public TestResult getParent()
Description copied from class: TestObject
Reverse pointer of TabulatedResult.getChildren().

Specified by:
getParent in class TestObject

getName

@Exported(visibility=999)
public String getName()
Description copied from class: TestObject
Gets the name of this object.

Overrides:
getName in class TestObject

getSafeName

public String getSafeName()
Description copied from class: TestObject
Gets the version of TestObject.getName() that's URL-safe.

Overrides:
getSafeName in class TestObject

findCorrespondingResult

public TestResult findCorrespondingResult(String id)
Description copied from class: TestObject
Find the test result corresponding to the one identified by id> withint this test result.

Specified by:
findCorrespondingResult in class TestObject
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 class TestResult

getChildTitle

public String getChildTitle()
Overrides:
getChildTitle in class TabulatedResult

getDuration

public float getDuration()
Description copied from class: TestResult
Time it took to run this test. In seconds.

Overrides:
getDuration in class TestResult

getPassCount

@Exported
public int getPassCount()
Description copied from class: TestResult
Gets the total number of passed tests.

Overrides:
getPassCount in class TestResult

getFailCount

@Exported
public int getFailCount()
Description copied from class: TestResult
Gets the total number of failed tests.

Overrides:
getFailCount in class TestResult

getSkipCount

@Exported
public int getSkipCount()
Description copied from class: TestResult
Gets the total number of skipped tests.

Overrides:
getSkipCount in class TestResult

getDynamic

public Object getDynamic(String name,
                         org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
Overrides:
getDynamic in class TestObject

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 class TabulatedResult
See Also:
TestObject.getParent()

hasChildren

public boolean hasChildren()
Whether this test result has children.

Specified by:
hasChildren in class TabulatedResult

getFailedTests

public List<CaseResult> getFailedTests()
Returns a list of the failed cases, in no particular sort order

Specified by:
getFailedTests in class MetaTabulatedResult
Returns:

getFailedTestsSortedByAge

public List<CaseResult> getFailedTestsSortedByAge()
Returns a list of the failed cases, sorted by age.

Returns:

getPassedTests

public Collection<? extends TestResult> getPassedTests()
Gets the "children" of this test result that passed

Overrides:
getPassedTests in class TestResult
Returns:
the children of this test result, if any, or an empty collection

getSkippedTests

public Collection<? extends TestResult> getSkippedTests()
Gets the "children" of this test result that were skipped

Overrides:
getSkippedTests in class TestResult
Returns:
the children of this test result, if any, or an empty list

isPassed

public boolean isPassed()
Overrides:
isPassed in class TestResult
Returns:
true if every test was not skipped and every test did not fail, false otherwise.

tally

public void tally()
Recount my children

Overrides:
tally in class TestResult

compareTo

public int compareTo(PackageResult that)
Specified by:
compareTo in interface Comparable<PackageResult>

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface ModelObject


Copyright © 2004-2013. All Rights Reserved.