1package org.testng;
2
3import java.io.Serializable;
4import java.util.List;
5
6/**
7 * This interface is used to augment or replace TestNG's algorithm to
8 * decide whether a test method should be included in a test run.
9 *
10 * Created on Sep 26, 2005
11 * @author cbeust
12 */
13public interface IMethodSelector extends Serializable {
14
15  /**
16   * @param context The selector context.  The implementation of this method
17   * can invoke setHalted(true) to indicate that no other Method Selector
18   * should be invoked by TestNG after this one.  Additionally, this
19   * implementation can manipulate the Map object returned by
20   * getUserData().
21   * @param method The test method
22   * @param isTestMethod true if this is a @Test method, false if it's a
23   * configuration method
24   * @return true if this method should be included in the test run, false
25   * otherwise
26   */
27  public boolean includeMethod(IMethodSelectorContext context,
28      ITestNGMethod method, boolean isTestMethod);
29
30  /**
31   * Invoked when all the test methods are known so that the method selector
32   * can perform additional work, such as adding the transitive closure of
33   * all the groups being included and depended upon.
34   */
35  public void setTestMethods(List<ITestNGMethod> testMethods);
36
37}
38