Class ClonedMethod

  • All Implemented Interfaces:
    java.lang.Cloneable, ITestNGMethod

    public class ClonedMethod
    extends java.lang.Object
    implements ITestNGMethod
    • Constructor Detail

      • ClonedMethod

        public ClonedMethod​(ITestNGMethod method,
                            java.lang.reflect.Method javaMethod)
    • Method Detail

      • canRunFromClass

        public boolean canRunFromClass​(IClass testClass)
        Description copied from interface: ITestNGMethod
        Returns if this ITestNGMethod can be invoked from within IClass.
        Specified by:
        canRunFromClass in interface ITestNGMethod
      • setDescription

        public void setDescription​(java.lang.String description)
        Specified by:
        setDescription in interface ITestNGMethod
      • getGroups

        public java.lang.String[] getGroups()
        Specified by:
        getGroups in interface ITestNGMethod
        Returns:
        The groups this method belongs to, possibly added to the groups declared on the class.
      • getGroupsDependedUpon

        public java.lang.String[] getGroupsDependedUpon()
        Specified by:
        getGroupsDependedUpon in interface ITestNGMethod
        Returns:
        The groups this method depends on, possibly added to the groups declared on the class.
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface ITestNGMethod
        Returns:
        The id of the thread this method was run in.
      • getInstances

        public java.lang.Object[] getInstances()
        Specified by:
        getInstances in interface ITestNGMethod
        Returns:
        All the instances the methods will be invoked upon. This will typically be an array of one object in the absence of an @Factory annotation.
      • getInvocationCount

        public int getInvocationCount()
        Specified by:
        getInvocationCount in interface ITestNGMethod
        Returns:
        the number of times this method needs to be invoked.
      • getInvocationTimeOut

        public long getInvocationTimeOut()
        Description copied from interface: ITestNGMethod
        The time under which all invocationCount methods need to complete by.
        Specified by:
        getInvocationTimeOut in interface ITestNGMethod
      • getMethod

        public java.lang.reflect.Method getMethod()
        Specified by:
        getMethod in interface ITestNGMethod
        Returns:
        the corresponding Java test method.
      • getMethodName

        public java.lang.String getMethodName()
        Description copied from interface: ITestNGMethod
        Returns the method name. This is needed for serialization because methods are not Serializable.
        Specified by:
        getMethodName in interface ITestNGMethod
        Returns:
        the method name.
      • getMethodsDependedUpon

        public java.lang.String[] getMethodsDependedUpon()
        Specified by:
        getMethodsDependedUpon in interface ITestNGMethod
        Returns:
        The methods this method depends on, possibly added to the methods declared on the class.
      • setMoreInvocationChecker

        public void setMoreInvocationChecker​(java.util.concurrent.Callable<java.lang.Boolean> moreInvocationChecker)
        Specified by:
        setMoreInvocationChecker in interface ITestNGMethod
      • getRealClass

        public java.lang.Class getRealClass()
        Specified by:
        getRealClass in interface ITestNGMethod
        Returns:
        The real class on which this method was declared (can be different from getMethod().getDeclaringClass() if the test method was defined in a superclass).
      • getSuccessPercentage

        public int getSuccessPercentage()
        Specified by:
        getSuccessPercentage in interface ITestNGMethod
        Returns:
        the success percentage for this method (between 0 and 100).
      • getThreadPoolSize

        public int getThreadPoolSize()
        Specified by:
        getThreadPoolSize in interface ITestNGMethod
        Returns:
        the number of threads to be used when invoking the method on parallel
      • getTimeOut

        public long getTimeOut()
        Specified by:
        getTimeOut in interface ITestNGMethod
        Returns:
        The timeout in milliseconds.
      • isAfterClassConfiguration

        public boolean isAfterClassConfiguration()
        Specified by:
        isAfterClassConfiguration in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Configuration and beforeClassMethod = false
      • isAfterMethodConfiguration

        public boolean isAfterMethodConfiguration()
        Specified by:
        isAfterMethodConfiguration in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Configuration and beforeTestMethod = false
      • isAfterSuiteConfiguration

        public boolean isAfterSuiteConfiguration()
        Specified by:
        isAfterSuiteConfiguration in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Configuration and afterSuite = true
      • isAfterTestConfiguration

        public boolean isAfterTestConfiguration()
        Specified by:
        isAfterTestConfiguration in interface ITestNGMethod
        Returns:
        true if this method is an @AfterTest (@Configuration afterTest=true)
      • isAlwaysRun

        public boolean isAlwaysRun()
        Specified by:
        isAlwaysRun in interface ITestNGMethod
        Returns:
        true if this method is alwaysRun=true
      • isBeforeClassConfiguration

        public boolean isBeforeClassConfiguration()
        Specified by:
        isBeforeClassConfiguration in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Configuration and beforeClassMethod = true
      • isBeforeMethodConfiguration

        public boolean isBeforeMethodConfiguration()
        Specified by:
        isBeforeMethodConfiguration in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Configuration and beforeTestMethod = true
      • isBeforeSuiteConfiguration

        public boolean isBeforeSuiteConfiguration()
        Specified by:
        isBeforeSuiteConfiguration in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Configuration and beforeSuite = true
      • isBeforeTestConfiguration

        public boolean isBeforeTestConfiguration()
        Specified by:
        isBeforeTestConfiguration in interface ITestNGMethod
        Returns:
        true if this method is a @BeforeTest (@Configuration beforeTest=true)
      • isTest

        public boolean isTest()
        Specified by:
        isTest in interface ITestNGMethod
        Returns:
        true if this method was annotated with @Test
      • setId

        public void setId​(java.lang.String id)
        Specified by:
        setId in interface ITestNGMethod
      • setTestClass

        public void setTestClass​(ITestClass cls)
        Description copied from interface: ITestNGMethod
        Sets the test class having this method. This is not necessarily the declaring class.
        Specified by:
        setTestClass in interface ITestNGMethod
        Parameters:
        cls - The test class having this method.
      • toString

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

        public java.util.List<java.lang.Integer> getInvocationNumbers()
        Description copied from interface: ITestNGMethod
        Which invocation numbers of this method should be used (only applicable if it uses a data provider). If this value is an empty list, use all the values returned from the data provider. These values are read from the XML file in the tag.
        Specified by:
        getInvocationNumbers in interface ITestNGMethod
      • setInvocationNumbers

        public void setInvocationNumbers​(java.util.List<java.lang.Integer> count)
        Specified by:
        setInvocationNumbers in interface ITestNGMethod
      • addFailedInvocationNumber

        public void addFailedInvocationNumber​(int number)
        Description copied from interface: ITestNGMethod
        The list of invocation numbers that failed, which is only applicable for methods that have a data provider.
        Specified by:
        addFailedInvocationNumber in interface ITestNGMethod
      • getPriority

        public int getPriority()
        Description copied from interface: ITestNGMethod
        The scheduling priority. Lower priorities get scheduled first.
        Specified by:
        getPriority in interface ITestNGMethod
      • findMethodParameters

        public java.util.Map<java.lang.String,​java.lang.String> findMethodParameters​(XmlTest test)
        Specified by:
        findMethodParameters in interface ITestNGMethod
        Returns:
        the parameters found in the include tag, if any
      • getQualifiedName

        public java.lang.String getQualifiedName()
        Description copied from interface: ITestNGMethod
        getRealClass().getName() + "." + getMethodName()
        Specified by:
        getQualifiedName in interface ITestNGMethod
        Returns:
        qualified name for this method