Class MethodResult

java.lang.Object
hudson.model.AbstractModelObject
hudson.tasks.junit.TestObject
hudson.tasks.test.TestObject
hudson.tasks.test.TestResult
hudson.tasks.test.TabulatedResult
hudson.plugins.testng.results.BaseResult
hudson.plugins.testng.results.MethodResult
All Implemented Interfaces:
ModelObject, SearchableModelObject, SearchItem, Serializable

public class MethodResult extends BaseResult
Handles result pertaining to a single test method
See Also:
  • Constructor Details

  • Method Details

    • setTestUuid

      public void setTestUuid(String testUuid)
    • getParentTestName

      public String getParentTestName()
      Returns:
      name of the <test> 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()
    • getStartTime

      public long getStartTime()
    • getEndTime

      public long getEndTime()
    • 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

      @POST public void doGraph(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException
      Creates test method execution history graph.
      Parameters:
      req - request
      rsp - response
      Throws:
      IOException - on IO error
    • doGraphMap

      @POST public void doGraphMap(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException
      Creates map to make the graph click-able
      Parameters:
      req - request
      rsp - response
      Throws:
      IOException - on IO error
    • getCssClass

      public Object getCssClass()
      Used to give different color based on test status
      Returns:
      css class based on result status
    • 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