public class CaseResult extends TestResult implements Comparable<CaseResult>
Modifier and Type | Class and Description |
---|---|
static class |
CaseResult.Status
Constants that represent the status of this test.
|
Constructor and Description |
---|
CaseResult(SuiteResult parent,
String testName,
String errorStackTrace)
Used to create a fake failure, when Hudson fails to load data from XML files.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CaseResult that) |
TestResult |
findCorrespondingResult(String id)
Case results have no children
|
void |
freeze(SuiteResult parent) |
int |
getAge()
Gets the number of consecutive builds (including this)
that this test case has been failing.
|
String |
getClassName()
Gets the class name of a test class.
|
String |
getDisplayName() |
float |
getDuration()
Gets the duration of the test, in seconds
|
String |
getErrorDetails()
If there was an error or a failure, this is the text from the message.
|
String |
getErrorStackTrace()
If there was an error or a failure, this is the stack trace, or otherwise null.
|
int |
getFailCount()
Gets the total number of failed tests.
|
int |
getFailedSince()
If this test failed, then return the build number
when this test started failing.
|
hudson.model.Run<?,?> |
getFailedSinceRun()
If this test failed, then return the run
when this test started failing.
|
Collection<? extends TestResult> |
getFailedTests()
Gets the "children" of this test result that failed
|
String |
getFullDisplayName() |
String |
getFullName()
Gets the full name of this object.
|
String |
getName()
Gets the name of the test, which is returned from
TestCase.getName() |
String |
getPackageName()
Gets the package name of a test case
|
ClassResult |
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
|
CaseResult |
getPreviousResult()
Gets the counter part of this
TestResult in the previous run. |
hudson.model.Run<?,?> |
getRun() |
String |
getSafeName()
Gets the version of
getName() that's URL-safe. |
String |
getSimpleName()
Gets the simple (not qualified) class name.
|
int |
getSkipCount()
Gets the total number of skipped tests.
|
String |
getSkippedMessage()
Provides the reason given for the test being being skipped.
|
Collection<? extends TestResult> |
getSkippedTests()
Gets the "children" of this test result that were skipped
|
CaseResult.Status |
getStatus() |
String |
getStderr()
The stderr of this test.
|
String |
getStdout()
The stdout of this test.
|
SuiteResult |
getSuiteResult() |
String |
getTitle()
Gets the human readable title of this result object.
|
boolean |
isFailed() |
boolean |
isPassed() |
boolean |
isSkipped()
Tests whether the test was skipped or not.
|
void |
setParentSuiteResult(SuiteResult parent) |
annotate, getBuildResult, getParentAction, getResultInRun, setParent, setParentAction, tally, toPrettyString
doSubmitDescription, getApi, getDescription, getDurationString, getDynamic, getHistory, getId, getRelativePathFrom, getResultInBuild, getSearchUrl, getTestAction, getTestActions, getTestResult, getTestResultAction, getTopLevelTestResult, getTotalCount, getUrl, safe, setDescription, uniquifyName
getOwner
public CaseResult(SuiteResult parent, String testName, String errorStackTrace)
public ClassResult getParent()
TestObject
TabulatedResult.getChildren()
.getParent
in class TestObject
public String getDisplayName()
getDisplayName
in interface hudson.model.ModelObject
@Exported(visibility=999) public String getName()
TestCase.getName()
Note that this may contain any URL-unfriendly character.
getName
in class TestObject
public String getTitle()
getTitle
in class TestResult
@Exported(visibility=9) public float getDuration()
getDuration
in class TestResult
public String getSafeName()
getName()
that's URL-safe.getSafeName
in class TestObject
@Exported(visibility=9) public String getClassName()
public String getSimpleName()
public String getPackageName()
public String getFullName()
TestObject
getFullName
in class TestObject
public String getFullDisplayName()
getFullDisplayName
in class TestObject
public int getFailCount()
TestResult
getFailCount
in class TestResult
public int getSkipCount()
TestResult
getSkipCount
in class TestResult
public int getPassCount()
TestResult
getPassCount
in class TestResult
@Exported(visibility=9) public int getFailedSince()
getFailedSince
in class TestResult
public hudson.model.Run<?,?> getFailedSinceRun()
TestResult
getFailedSinceRun
in class TestResult
@Exported(visibility=9) public int getAge()
@Exported public String getStdout()
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()
.
getStdout
in class TestResult
@Exported public String getStderr()
getStderr
in class TestResult
getStdout()
public CaseResult getPreviousResult()
TestResult
TestResult
in the previous run.getPreviousResult
in class TestResult
public TestResult findCorrespondingResult(String id)
findCorrespondingResult
in class TestObject
id
- The path to the original test resultpublic Collection<? extends TestResult> getFailedTests()
getFailedTests
in class TestResult
public Collection<? extends TestResult> getPassedTests()
getPassedTests
in class TestResult
public Collection<? extends TestResult> getSkippedTests()
getSkippedTests
in class TestResult
@Exported public String getErrorStackTrace()
getErrorStackTrace
in class TestResult
@Exported public String getErrorDetails()
getErrorDetails
in class TestResult
public boolean isPassed()
isPassed
in class TestResult
@Exported(visibility=9) public boolean isSkipped()
public boolean isFailed()
@Exported public String getSkippedMessage()
public SuiteResult getSuiteResult()
public hudson.model.Run<?,?> getRun()
getRun
in class TestObject
public void setParentSuiteResult(SuiteResult parent)
public void freeze(SuiteResult parent)
public int compareTo(CaseResult that)
compareTo
in interface Comparable<CaseResult>
@Exported(name="status", visibility=9) public CaseResult.Status getStatus()
Copyright © 2014. All rights reserved.