com.cwctravel.hudson.plugins.suitegroupedtests.junit
Class TestResult

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 com.cwctravel.hudson.plugins.suitegroupedtests.junit.TestResult
All Implemented Interfaces:
hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, java.io.Serializable

public final class TestResult
extends hudson.tasks.test.MetaTabulatedResult

Root of all the test results for one build.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Constructor Summary
TestResult(hudson.tasks.test.TestObject parent, JUnitSummaryInfo junitSummaryInfo)
          Creates an empty result.
 
Method Summary
 PackageResult byPackage(java.lang.String packageName)
           
 hudson.tasks.test.TestResult findCorrespondingResult(java.lang.String id)
           
 java.util.Collection<PackageResult> getChildren()
           
 java.lang.String getChildTitle()
           
 java.lang.String getDisplayName()
           
 float getDuration()
           
 java.lang.Object getDynamic(java.lang.String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 java.lang.String getErrorDetails()
          If there was an error or a failure, this is the text from the message.
 java.lang.String getErrorStackTrace()
          If there was an error or a failure, this is the stack trace, or otherwise null.
 int getFailCount()
           
 int getFailDiff()
           
 int getFailedSince()
           
 hudson.model.Run<?,?> getFailedSinceRun()
           
 java.util.List<CaseResult> getFailedTests()
           
 hudson.tasks.junit.History getHistory()
           
 JUnitMetricsInfo getMetrics()
           
 java.lang.String getName()
           
 hudson.model.AbstractBuild<?,?> getOwner()
           
 hudson.tasks.test.TestObject getParent()
           
 int getPassCount()
           
 int getPassDiff()
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getPassedTests()
          Gets the "children" of this test result that passed
 TestResult getPreviousResult()
           
 java.lang.String getRootUrl(java.lang.String urlName)
           
 java.lang.String getRootUrl(hudson.tasks.junit.TestAction testAction)
           
 int getSkipCount()
           
 int getSkipDiff()
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getSkippedTests()
          Gets the "children" of this test result that were skipped
 java.lang.String getStderr()
          The stderr of this test.
 java.lang.String getStdout()
          The stdout of this test.
 java.util.List<hudson.tasks.junit.TestAction> getTestActions()
           
 SuiteGroupResultAction getTestResultAction()
           
 java.lang.String getTitle()
           
 int getTotalDiff()
           
 boolean hasChildren()
          Whether this test result has children.
 boolean isPassed()
           
 void setParent(hudson.tasks.test.TestObject parent)
           
 
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getParentAction, getResultInBuild, setParentAction, tally, toPrettyString
 
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getId, getRelativePathFrom, getSafeName, getSearchUrl, getTestAction, getTestResult, 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
 

Constructor Detail

TestResult

public TestResult(hudson.tasks.test.TestObject parent,
                  JUnitSummaryInfo junitSummaryInfo)
Creates an empty result.

Method Detail

getParent

public hudson.tasks.test.TestObject getParent()
Overrides:
getParent in class hudson.tasks.test.TestObject

setParent

public void setParent(hudson.tasks.test.TestObject parent)
Overrides:
setParent in class hudson.tasks.test.TestResult

getDisplayName

public java.lang.String getDisplayName()

getOwner

public hudson.model.AbstractBuild<?,?> getOwner()
Specified by:
getOwner in class hudson.tasks.test.TestObject

getTestResultAction

public SuiteGroupResultAction getTestResultAction()
Overrides:
getTestResultAction in class hudson.tasks.test.TestObject

findCorrespondingResult

public hudson.tasks.test.TestResult findCorrespondingResult(java.lang.String id)
Specified by:
findCorrespondingResult in class hudson.tasks.test.TestObject

getTitle

public java.lang.String getTitle()
Overrides:
getTitle in class hudson.tasks.test.TestResult

getChildTitle

public java.lang.String getChildTitle()
Overrides:
getChildTitle in class hudson.tasks.test.TabulatedResult

getDuration

@Exported(visibility=999)
public float getDuration()
Overrides:
getDuration in class hudson.tasks.test.TestResult

getPassCount

@Exported(visibility=999)
public int getPassCount()
Overrides:
getPassCount in class hudson.tasks.test.TestResult

getFailCount

@Exported(visibility=999)
public int getFailCount()
Overrides:
getFailCount in class hudson.tasks.test.TestResult

getSkipCount

@Exported(visibility=999)
public int getSkipCount()
Overrides:
getSkipCount in class hudson.tasks.test.TestResult

getPassDiff

public int getPassDiff()

getSkipDiff

public int getSkipDiff()

getFailDiff

public int getFailDiff()

getTotalDiff

public int getTotalDiff()

getMetrics

public JUnitMetricsInfo getMetrics()

getPreviousResult

public TestResult getPreviousResult()
Overrides:
getPreviousResult in class hudson.tasks.test.TestResult

getFailedTests

public java.util.List<CaseResult> getFailedTests()
Specified by:
getFailedTests in class hudson.tasks.test.MetaTabulatedResult

getPassedTests

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

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

getSkippedTests

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

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

getFailedSince

public int getFailedSince()
Overrides:
getFailedSince in class hudson.tasks.test.TestResult

getFailedSinceRun

public hudson.model.Run<?,?> getFailedSinceRun()
Overrides:
getFailedSinceRun in class hudson.tasks.test.TestResult

getStdout

public java.lang.String getStdout()
The stdout of this test.

Depending on the tool that produced the XML report, this method works somewhat inconsistently. With some tools (such as Maven surefire plugin), you get the accurate information, that is the stdout from this test case. With some other tools (such as the JUnit task in Ant), this method returns the stdout produced by the entire test suite.

If you need to know which is the case, compare this output from SuiteResult.getStdout().

Overrides:
getStdout in class hudson.tasks.test.TestResult
Since:
1.294

getStderr

public java.lang.String getStderr()
The stderr of this test.

Overrides:
getStderr in class hudson.tasks.test.TestResult
Since:
1.294
See Also:
getStdout()

getErrorStackTrace

public java.lang.String getErrorStackTrace()
If there was an error or a failure, this is the stack trace, or otherwise null.

Overrides:
getErrorStackTrace in class hudson.tasks.test.TestResult

getErrorDetails

public java.lang.String getErrorDetails()
If there was an error or a failure, this is the text from the message.

Overrides:
getErrorDetails in class hudson.tasks.test.TestResult

isPassed

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

getChildren

public java.util.Collection<PackageResult> getChildren()
Specified by:
getChildren in class hudson.tasks.test.TabulatedResult

hasChildren

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

Specified by:
hasChildren in class hudson.tasks.test.TabulatedResult

getName

public java.lang.String getName()
Overrides:
getName in class hudson.tasks.test.TestObject

getDynamic

public java.lang.Object getDynamic(java.lang.String token,
                                   org.kohsuke.stapler.StaplerRequest req,
                                   org.kohsuke.stapler.StaplerResponse rsp)
Overrides:
getDynamic in class hudson.tasks.test.TestObject

byPackage

public PackageResult byPackage(java.lang.String packageName)

getRootUrl

public java.lang.String getRootUrl(java.lang.String urlName)

getRootUrl

public java.lang.String getRootUrl(hudson.tasks.junit.TestAction testAction)

getTestActions

public java.util.List<hudson.tasks.junit.TestAction> getTestActions()
Overrides:
getTestActions in class hudson.tasks.test.TestObject

getHistory

public hudson.tasks.junit.History getHistory()
Overrides:
getHistory in class hudson.tasks.test.TestObject


Copyright © 2004-2012. All Rights Reserved.