private void runConfigurationListeners(ITestResult tr, boolean before) { if (before) { TestListenerHelper.runPreConfigurationListeners(tr, m_notifier.getConfigurationListeners()); } else { TestListenerHelper.runPostConfigurationListeners(tr, m_notifier.getConfigurationListeners()); } }
public int getStatus() { if (!exitCodeListener.hasTests()) { return ExitCode.HAS_NO_TEST; } return exitCode.getExitCode(); }
@Override public boolean includeMethod(IMethodSelectorContext context, ITestNGMethod tm, boolean isTestMethod) { if (!m_isInitialized) { m_isInitialized = true; init(context); } if (m_expression != null) { return m_bsh.includeMethodFromExpression(m_expression, tm); } return includeMethodFromIncludeExclude(tm, isTestMethod); }
@Override public boolean isDefault(String s) { return Utils.isStringEmpty(s); } };
private static void includeOrExcludeClass(String packageName, String className, List<String> included, List<String> excluded, List<String> classes) { if (isIncluded(packageName, included, excluded)) { Utils.log(PACKAGE_UTILS, 4, "... Including class " + className); classes.add(makeFullClassName(packageName, className)); } else { Utils.log(PACKAGE_UTILS, 4, "... Excluding class " + className); } }
void runTestListeners(ITestResult tr) { TestListenerHelper.runTestListeners(tr, m_notifier.getTestListeners()); }
private void addNeighbor(T tm, T predecessor) { findNode(tm).addNeighbor(findNode(predecessor)); }
private void init(boolean useDefaultListeners) { m_instance = this; m_useDefaultListeners = useDefaultListeners; m_configuration = new Configuration(); }
/** * Define which groups will be excluded from this run. * * @param groups A list of group names separated by a comma. */ public void setExcludedGroups(String groups) { m_excludedGroups = Utils.split(groups, ","); }
public static Class getClass(String namedParameter) { Class result = null; if (namedParameter != null) { result = ClassHelper.forName(namedParameter); } return result; }
/** * Set the status for a set of nodes. */ public void setStatus(Collection<T> nodes, Status status) { for (T n : nodes) { setStatus(n, status); } }
/** * {@inheritDoc} */ @Override public String toString() { return getSignature(); }
private Node<T> findNodeWithNoPredecessors(List<Node<T>> nodes) { for (Node<T> n : nodes) { if (! n.hasPredecessors()) { return n; } } return null; }
/** * {@inheritDoc} This implementation returns the associated Java Method's hash code. * @return the associated Java Method's hash code. */ @Override public int hashCode() { return m_method.hashCode(); }
protected String getSignature() { if (m_signature == null) { m_signature = computeSignature(); } return m_signature; }
public List<ITestNGMethod> getBeforeGroupMethodsForGroup(String group) { synchronized (beforeGroupsThatHaveAlreadyRun) { return retrieve(beforeGroupsThatHaveAlreadyRun, m_beforeGroupsMethods, group); } }
public static ParallelMode skipDeprecatedValues(ParallelMode parallel) { if (parallel == ParallelMode.TRUE) { Utils.log("XmlSuite", 1, "[WARN] 'parallel' value 'true' is deprecated, default value will be used instead: '" + ParallelMode.METHODS + "'."); return ParallelMode.METHODS; } if (parallel == ParallelMode.FALSE) { Utils.log("XmlSuite", 1, "[WARN] 'parallel' value 'false' is deprecated, default value will be used instead: '" + ParallelMode.NONE + "'."); return ParallelMode.NONE; } return parallel; }
/** * @return true if at least one test was skipped. */ public boolean hasSkip() { return this.exitCode.hasSkip(); }
public void setTestMethods(List<ITestNGMethod> testMethods) { for (MethodSelectorDescriptor mds : m_methodSelectors) { mds.setTestMethods(testMethods); } } }
/** * @return true if at least one test failed within success percentage. */ public boolean hasFailureWithinSuccessPercentage() { return this.exitCode.hasFailureWithinSuccessPercentage(); }