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

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

public final class CaseResult
extends hudson.tasks.test.TestResult
implements java.lang.Comparable<CaseResult>

One test result.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Nested Class Summary
static class CaseResult.Status
          Constants that represent the status of this test.
 
Constructor Summary
CaseResult(hudson.tasks.test.TestObject parent, JUnitTestInfo testInfo)
           
 
Method Summary
 int compareTo(CaseResult that)
           
 hudson.tasks.test.TestResult findCorrespondingResult(java.lang.String id)
          Case results have no children
 int getAge()
          Gets the number of consecutive builds (including this) that this test case has been failing.
 java.lang.String getClassName()
          Gets the class name of a test class.
 java.lang.String getDisplayName()
           
 float getDuration()
          Gets the duration of the test, in seconds
 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 getFailedSince()
          If this test failed, then return the build number when this test started failing.
 hudson.model.Run<?,?> getFailedSinceRun()
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getFailedTests()
          Gets the "children" of this test result that failed
 java.lang.String getFullName()
           
 hudson.tasks.junit.History getHistory()
           
 JUnitMetricsInfo getMetrics()
           
 java.lang.String getName()
          Gets the name of the test, which is returned from TestCase.getName()
 hudson.model.AbstractBuild<?,?> getOwner()
           
 java.lang.String getPackageName()
          Gets the package name of a test case
 hudson.tasks.test.TestObject getParent()
           
 int getPassCount()
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getPassedTests()
          Gets the "children" of this test result that passed
 CaseResult getPreviousResult()
           
 java.lang.String getRootUrl(java.lang.String urlName)
           
 java.lang.String getRootUrl(hudson.tasks.junit.TestAction testAction)
           
 java.lang.String getSafeName()
          Gets the version of getName() that's URL-safe.
 java.lang.String getSimpleName()
          Gets the simple (not qualified) class name.
 int getSkipCount()
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getSkippedTests()
          Gets the "children" of this test result that were skipped
 CaseResult.Status getStatus()
           
 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()
          Gets the human readable title of this result object.
 boolean isPassed()
           
 boolean isSkipped()
          Tests whether the test was skipped or not.
 
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getParentAction, getResultInBuild, setParent, setParentAction, tally, toPrettyString
 
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getDynamic, getId, getRelativePathFrom, 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

CaseResult

public CaseResult(hudson.tasks.test.TestObject parent,
                  JUnitTestInfo testInfo)
Method Detail

getParent

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

getTestActions

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

getTestResultAction

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

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.ModelObject

getName

@Exported(visibility=999)
public java.lang.String getName()
Gets the name of the test, which is returned from TestCase.getName()

Note that this may contain any URL-unfriendly character.

Overrides:
getName in class hudson.tasks.test.TestObject

getTitle

public java.lang.String getTitle()
Gets the human readable title of this result object.

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

getDuration

@Exported(visibility=9)
public float getDuration()
Gets the duration of the test, in seconds

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

getSafeName

public java.lang.String getSafeName()
Gets the version of getName() that's URL-safe.

Overrides:
getSafeName in class hudson.tasks.test.TestObject

getClassName

@Exported(visibility=9)
public java.lang.String getClassName()
Gets the class name of a test class.


getSimpleName

public java.lang.String getSimpleName()
Gets the simple (not qualified) class name.


getPackageName

public java.lang.String getPackageName()
Gets the package name of a test case


getFullName

public java.lang.String getFullName()

getFailCount

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

getSkipCount

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

getPassCount

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

getFailedSince

@Exported(visibility=9)
public int getFailedSince()
If this test failed, then return the build number when this test started failing.

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

getFailedSinceRun

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

getAge

@Exported(visibility=9)
public int getAge()
Gets the number of consecutive builds (including this) that this test case has been failing.


getStdout

@Exported
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

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

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

getPreviousResult

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

getMetrics

public JUnitMetricsInfo getMetrics()

findCorrespondingResult

public hudson.tasks.test.TestResult findCorrespondingResult(java.lang.String id)
Case results have no children

Specified by:
findCorrespondingResult in class hudson.tasks.test.TestObject
Returns:
null

getFailedTests

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

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

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

getErrorStackTrace

@Exported
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

@Exported
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.

isSkipped

@Exported(visibility=9)
public boolean isSkipped()
Tests whether the test was skipped or not. TestNG allows tests to be skipped if their dependencies fail or they are part of a group that has been configured to be skipped.

Returns:
true if the test was not executed, false otherwise.

getOwner

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

compareTo

public int compareTo(CaseResult that)
Specified by:
compareTo in interface java.lang.Comparable<CaseResult>

getStatus

@Exported(name="status",
          visibility=9)
public CaseResult.Status getStatus()

getRootUrl

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

getRootUrl

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

getHistory

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


Copyright © 2004-2012. All Rights Reserved.