/** * Collects and orders test or configuration methods * @param methods methods to be worked on * @param forTests true for test methods, false for configuration methods * @param runInfo * @param finder annotation finder * @param unique true for unique methods, false otherwise * @param outExcludedMethods * @return list of ordered methods */ public static ITestNGMethod[] collectAndOrderMethods(List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, List<ITestNGMethod> outExcludedMethods, Comparator<ITestNGMethod> comparator) { List<ITestNGMethod> includedMethods = Lists.newArrayList(); MethodGroupsHelper.collectMethodsByGroup(methods.toArray(new ITestNGMethod[methods.size()]), forTests, includedMethods, outExcludedMethods, runInfo, finder, unique); return sortMethods(forTests, includedMethods, comparator).toArray(new ITestNGMethod[]{}); }
/** * Collects and orders test or configuration methods * * @param methods methods to be worked on * @param forTests true for test methods, false for configuration methods * @param runInfo - {@link RunInfo} object. * @param finder annotation finder * @param unique true for unique methods, false otherwise * @param outExcludedMethods - A List of excluded {@link ITestNGMethod} methods. * @return list of ordered methods */ public static ITestNGMethod[] collectAndOrderMethods( List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, List<ITestNGMethod> outExcludedMethods, Comparator<ITestNGMethod> comparator) { List<ITestNGMethod> includedMethods = Lists.newArrayList(); MethodGroupsHelper.collectMethodsByGroup( methods.toArray(new ITestNGMethod[0]), forTests, includedMethods, outExcludedMethods, runInfo, finder, unique); return sortMethods(forTests, includedMethods, comparator).toArray(new ITestNGMethod[] {}); }