hudson.plugins.testng.results
Class MethodResult

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.plugins.testng.results.BaseResult
                          extended by hudson.plugins.testng.results.MethodResult
All Implemented Interfaces:
hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, Serializable

public class MethodResult
extends BaseResult

Handles result pertaining to a single test method

See Also:
Serialized Form

Field Summary
 
Fields inherited from class hudson.plugins.testng.results.BaseResult
name, owner, parent
 
Constructor Summary
MethodResult(String name, String status, String description, String duration, Date startedAt, String isConfig, String testRunId, String parentTestName, String parentSuiteName, String testInstanceName)
           
 
Method Summary
 void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Creates test method execution history graph
 void doGraphMap(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Creates map to make the graph click-able
 hudson.tasks.test.TestResult findCorrespondingResult(String id)
           
 Collection<? extends hudson.tasks.test.TestResult> getChildren()
           
 String getClassName()
          Added only to expose class name as part of method result via .../api/xxx
 Object getCssClass()
          Used to give different color based on test status
 String getDescription()
           
 float getDuration()
          Can't change this to return seconds as expected by TestObject because it has already been exported
 String getErrorDetails()
          If there was an error or a failure, this is the text from the message.
 String getErrorStackTrace()
          Added only to expose possible exception via .../api/xxx
 MethodResultException getException()
           
 List<String> getGroups()
           
 List<String> getParameters()
           
 String getParentSuiteName()
           
 String getParentTestName()
           
 String getReporterOutput()
           
 String getSafeName()
           
 Date getStartedAt()
           
 String getStatus()
           
 String getTestRunId()
           
 boolean hasChildren()
           
 boolean isConfig()
           
 void setException(MethodResultException exception)
           
 void setGroups(List<String> groups)
           
 void setParameters(List<String> parameters)
           
 void setReporterOutput(String reporterOutput)
           
 void setTestUuid(String testUuid)
           
 
Methods inherited from class hudson.plugins.testng.results.BaseResult
getAge, getDisplayName, getDynamic, getName, getOwner, getParent, getParentAction, getTestResultAction, getTitle, getUpUrl, setOwner, setParent
 
Methods inherited from class hudson.tasks.test.TabulatedResult
getChildTitle
 
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getFailCount, getFailedSince, getFailedSinceRun, getFailedTests, getPassCount, getPassedTests, getPreviousResult, getResultInBuild, getSkipCount, getSkippedTests, getStderr, getStdout, isPassed, setParent, setParentAction, tally, toPrettyString
 
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDurationString, getHistory, getId, getRelativePathFrom, getSearchUrl, getTestAction, getTestActions, 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

MethodResult

public MethodResult(String name,
                    String status,
                    String description,
                    String duration,
                    Date startedAt,
                    String isConfig,
                    String testRunId,
                    String parentTestName,
                    String parentSuiteName,
                    String testInstanceName)
Method Detail

setTestUuid

public void setTestUuid(String testUuid)

getParentTestName

public String getParentTestName()
Returns:
name of the tag that this method is part of

getParentSuiteName

public String getParentSuiteName()
Returns:
name of the suite this method is part of

getTestRunId

public String getTestRunId()

getStartedAt

@Exported
public Date getStartedAt()

getException

public MethodResultException getException()

setException

public void setException(MethodResultException exception)

getSafeName

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

findCorrespondingResult

public hudson.tasks.test.TestResult findCorrespondingResult(String id)
Overrides:
findCorrespondingResult in class BaseResult

getDuration

@Exported
public float getDuration()
Can't change this to return seconds as expected by TestObject because it has already been exported

Overrides:
getDuration in class hudson.tasks.test.TestResult
Returns:
duration in milliseconds

getStatus

@Exported(visibility=9)
public String getStatus()

getDescription

@Exported
public String getDescription()
Overrides:
getDescription in class hudson.tasks.test.TestObject

getGroups

@Exported
public List<String> getGroups()

getParameters

@Exported
public List<String> getParameters()

getErrorStackTrace

@Exported(name="exception")
public String getErrorStackTrace()
Added only to expose possible exception via .../api/xxx

Overrides:
getErrorStackTrace in class hudson.tasks.test.TestResult
Returns:
String representation of the exception

getErrorDetails

public 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

getClassName

@Exported(name="className")
public String getClassName()
Added only to expose class name as part of method result via .../api/xxx

Returns:
String representation of the exception

setGroups

public void setGroups(List<String> groups)

setParameters

public void setParameters(List<String> parameters)

isConfig

public boolean isConfig()

doGraph

public void doGraph(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws IOException
Creates test method execution history graph

Parameters:
req - request
rsp - response
Throws:
IOException

doGraphMap

public void doGraphMap(org.kohsuke.stapler.StaplerRequest req,
                       org.kohsuke.stapler.StaplerResponse rsp)
                throws IOException
Creates map to make the graph click-able

Parameters:
req - request
rsp - response
Throws:
IOException

getCssClass

public Object getCssClass()
Used to give different color based on test status

Returns:

setReporterOutput

public void setReporterOutput(String reporterOutput)

getReporterOutput

public String getReporterOutput()
Returns:
reporter output

getChildren

public Collection<? extends hudson.tasks.test.TestResult> getChildren()
Specified by:
getChildren in class hudson.tasks.test.TabulatedResult

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in class hudson.tasks.test.TabulatedResult


Copyright © 2004-2013. All Rights Reserved.