Class MethodHelper

java.lang.Object
org.testng.internal.MethodHelper

public class MethodHelper extends Object
Collection of helper methods to help sort and arrange methods.
  • Constructor Details

    • MethodHelper

      public MethodHelper()
  • Method Details

    • collectAndOrderMethods

      public static ITestNGMethod[] collectAndOrderMethods(List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, List<ITestNGMethod> outExcludedMethods, Comparator<ITestNGMethod> comparator)
      Collects and orders test or configuration methods
      Parameters:
      methods - methods to be worked on
      forTests - true for test methods, false for configuration methods
      runInfo - - RunInfo object.
      finder - annotation finder
      unique - true for unique methods, false otherwise
      outExcludedMethods - - A List of excluded ITestNGMethod methods.
      Returns:
      an array of ordered methods
    • findDependedUponMethods

      protected static ITestNGMethod[] findDependedUponMethods(ITestNGMethod m, List<ITestNGMethod> methods)
      Finds TestNG methods that the specified TestNG method depends upon
      Parameters:
      m - TestNG method
      methods - list of methods to search for depended upon methods
      Returns:
      an array of methods that match the criteria
    • findDependedUponMethods

      public static ITestNGMethod[] findDependedUponMethods(ITestNGMethod m, ITestNGMethod[] incoming)
      Finds TestNG methods that the specified TestNG method depends upon
      Parameters:
      m - TestNG method
      incoming - list of methods to search for depended upon methods
      Returns:
      an array of methods that match the criteria
    • isEnabled

      public static boolean isEnabled(Class<?> objectClass, IAnnotationFinder finder)
    • isEnabled

      public static boolean isEnabled(Method m, IAnnotationFinder finder)
    • isEnabled

      public static boolean isEnabled(ITestOrConfiguration test)
    • isAlwaysRun

      public static boolean isAlwaysRun(IConfigurationAnnotation configurationAnnotation)
    • uniqueMethodList

      public static List<ITestNGMethod> uniqueMethodList(Collection<List<ITestNGMethod>> methods)
      Extracts the unique list of ITestNGMethods.
    • calculateMethodCanonicalName

      protected static String calculateMethodCanonicalName(ITestNGMethod m)
    • getMethodsDependedUpon

      public static List<ITestNGMethod> getMethodsDependedUpon(ITestNGMethod method, ITestNGMethod[] methods, Comparator<ITestNGMethod> comparator)
      Returns:
      A sorted array containing all the methods 'method' depends on
    • fixMethodsWithClass

      public static void fixMethodsWithClass(ITestNGMethod[] methods, ITestClass testCls, List<ITestNGMethod> methodList)
    • methodsToMethodInstances

      public static List<IMethodInstance> methodsToMethodInstances(List<ITestNGMethod> sl)
    • methodInstancesToMethods

      public static List<ITestNGMethod> methodInstancesToMethods(List<IMethodInstance> methodInstances)
    • dumpInvokedMethodInfoToConsole

      public static void dumpInvokedMethodInfoToConsole(ITestNGMethod[] methods, int currentVerbosity)
    • calculateMethodCanonicalName

      protected static String calculateMethodCanonicalName(Class<?> methodClass, String methodName)
    • clear

      public static void clear(Stream<Method> methods)
    • calculateTimeOut

      public static long calculateTimeOut(ITestNGMethod tm)