Class TestResult

    • Constructor Detail

      • TestResult

        public TestResult()
      • TestResult

        public TestResult​(java.lang.Object instance,
                          ITestNGMethod method,
                          java.lang.Throwable throwable,
                          ITestContext context)
      • TestResult

        public TestResult​(IClass testClass,
                          java.lang.Object instance,
                          ITestNGMethod method,
                          java.lang.Throwable throwable,
                          long start,
                          long end,
                          ITestContext context)
    • Method Detail

      • init

        public void init​(IClass testClass,
                         java.lang.Object instance,
                         ITestNGMethod method,
                         java.lang.Throwable throwable,
                         long start,
                         long end,
                         ITestContext context)
      • getTestName

        public java.lang.String getTestName()
        If this result's related instance implements ITest or use @Test(testName=...), returns its test name, otherwise returns null.
        Specified by:
        getTestName in interface ITestResult
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface ITestResult
        Returns:
        The name of this TestResult, typically identical to the name of the method.
      • setMethod

        public void setMethod​(ITestNGMethod method)
        Parameters:
        method - The method to set.
      • getStatus

        public int getStatus()
        Specified by:
        getStatus in interface ITestResult
        Returns:
        Returns the status.
      • setStatus

        public void setStatus​(int status)
        Specified by:
        setStatus in interface ITestResult
        Parameters:
        status - The status to set.
      • isSuccess

        public boolean isSuccess()
        Specified by:
        isSuccess in interface ITestResult
        Returns:
        true if if this test run is a SUCCESS
      • setTestClass

        public void setTestClass​(IClass testClass)
        Parameters:
        testClass - The testClass to set.
      • getThrowable

        public java.lang.Throwable getThrowable()
        Specified by:
        getThrowable in interface ITestResult
        Returns:
        Returns the throwable.
      • setThrowable

        public void setThrowable​(java.lang.Throwable throwable)
        Specified by:
        setThrowable in interface ITestResult
        Parameters:
        throwable - The throwable to set.
      • getEndMillis

        public long getEndMillis()
        Specified by:
        getEndMillis in interface ITestResult
        Returns:
        Returns the endMillis.
      • getStartMillis

        public long getStartMillis()
        Specified by:
        getStartMillis in interface ITestResult
        Returns:
        Returns the startMillis.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getHost

        public java.lang.String getHost()
        Specified by:
        getHost in interface ITestResult
        Returns:
        The host where this suite was run, or null if it was run locally. The returned string has the form: host:port
      • setHost

        public void setHost​(java.lang.String host)
      • getParameters

        public java.lang.Object[] getParameters()
        Specified by:
        getParameters in interface ITestResult
        Returns:
        The parameters this method was invoked with.
      • setParameters

        public void setParameters​(java.lang.Object[] parameters)
        Specified by:
        setParameters in interface ITestResult
      • getInstance

        public java.lang.Object getInstance()
        Description copied from interface: ITestResult
        The instance on which this method was run.
        Specified by:
        getInstance in interface ITestResult
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Specified by:
        getAttribute in interface IAttributes
        Parameters:
        name - The name of the attribute to return
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Description copied from interface: IAttributes
        Set a custom attribute.
        Specified by:
        setAttribute in interface IAttributes
      • getAttributeNames

        public java.util.Set<java.lang.String> getAttributeNames()
        Specified by:
        getAttributeNames in interface IAttributes
        Returns:
        all the attributes names.
      • removeAttribute

        public java.lang.Object removeAttribute​(java.lang.String name)
        Description copied from interface: IAttributes
        Remove the attribute
        Specified by:
        removeAttribute in interface IAttributes
        Returns:
        the attribute value if found, null otherwise
      • setContext

        public void setContext​(ITestContext context)
      • compareTo

        public int compareTo​(ITestResult comparison)
        Specified by:
        compareTo in interface java.lang.Comparable<ITestResult>
      • setTestName

        public void setTestName​(java.lang.String name)
        Specified by:
        setTestName in interface IAlterTestName
        Parameters:
        name - - The new name to be used as a test name
      • getParameterIndex

        public int getParameterIndex()