/** * @return true as soon as we fond a Method Selector that returns * true for the method "tm". */ public boolean includeMethod(ITestNGMethod tm, boolean isTestMethod) { Collections.sort(m_methodSelectors); boolean foundNegative = false; IMethodSelectorContext context = new DefaultMethodSelectorContext(); boolean result = false; for (MethodSelectorDescriptor mds : m_methodSelectors) { // If we found any negative priority, we break as soon as we encounter // a selector with a positive priority if (! foundNegative) { foundNegative = mds.getPriority() < 0; } if (foundNegative && mds.getPriority() >= 0) { break; } // Proceeed normally IMethodSelector md = mds.getMethodSelector(); result = md.includeMethod(context, tm, isTestMethod); if (context.isStopped()) { return result; } // This selector returned false, move on to the next } return result; }
/** @return true as soon as we fond a Method Selector that returns true for the method "tm". */ public boolean includeMethod(ITestNGMethod tm, boolean isTestMethod) { Collections.sort(m_methodSelectors); boolean foundNegative = false; IMethodSelectorContext context = new DefaultMethodSelectorContext(); boolean result = false; for (MethodSelectorDescriptor mds : m_methodSelectors) { // If we found any negative priority, we break as soon as we encounter // a selector with a positive priority if (!foundNegative) { foundNegative = mds.getPriority() < 0; } if (foundNegative && mds.getPriority() >= 0) { break; } // Proceeed normally IMethodSelector md = mds.getMethodSelector(); result = md.includeMethod(context, tm, isTestMethod); if (context.isStopped()) { return result; } // This selector returned false, move on to the next } return result; }