测试过滤助手

public class TestFilterHelper
extends Object

java.lang.Object
com.android.tradefed.util.TestFilterHelper


用于过滤测试的辅助类

概括

公共构造函数

TestFilterHelper ()
TestFilterHelper ( includeFilters, excludeFilters, includeAnnotation, excludeAnnotation) TestFilterHelper ( includeFilters, excludeFilters, includeAnnotation, excludeAnnotation) TestFilterHelper ( includeFilters, excludeFilters, includeAnnotation, excludeAnnotation) TestFilterHelper ( includeFilters, excludeFilters, includeAnnotation, excludeAnnotation) TestFilterHelper ( includeFilters, excludeFilters, includeAnnotation, excludeAnnotation)

公共方法

void addAllExcludeAnnotation ( notAnnotations) addAllExcludeAnnotation ( notAnnotations)

添加要运行的测试的排除注释的ERROR(/Set)

void addAllExcludeFilters ( filters) addAllExcludeFilters ( filters)

添加要排除的测试的过滤器的ERROR(/Set)

void addAllIncludeAnnotation ( annotations) addAllIncludeAnnotation ( annotations)

添加要运行的测试的包含注释的ERROR(/Set)

void addAllIncludeFilters ( filters) addAllIncludeFilters ( filters)

添加要包含的测试的过滤器的ERROR(/Set)

void addExcludeAnnotation (String notAnnotation)

添加要运行的测试的排除注释

void addExcludeFilter (String filter)

添加要排除的测试的过滤器

void addIncludeAnnotation (String annotation)

添加要运行的测试的包含注释

void addIncludeFilter (String filter)

添加要包含的测试的过滤器

void clearExcludeAnnotations ()
void clearExcludeFilters ()
void clearIncludeAnnotations ()
void clearIncludeFilters ()
getExcludeAnnotation ()
getExcludeFilters ()
getIncludeAnnotation ()
getIncludeFilters ()
boolean shouldRun (Description desc, extraJars) shouldRun (Description desc, extraJars)

检查带有注释的元素是否通过过滤器

boolean shouldRun (String packageName, Class<?> classObj, Method method)

检查带有注释的元素是否通过过滤器

boolean shouldTestRun (AnnotatedElement annotatedElement)

检查带有注释的元素是否通过过滤器

公共构造函数

测试过滤助手

public TestFilterHelper ()

测试过滤助手

public TestFilterHelper ( includeFilters, 
                 excludeFilters, 
                 includeAnnotation, 
                 excludeAnnotation)

参数
includeFilters

excludeFilters

includeAnnotation

excludeAnnotation

公共方法

添加全部排除注释

public void addAllExcludeAnnotation ( notAnnotations)

添加要运行的测试的排除注释的ERROR(/Set)

参数
notAnnotations

添加所有排除过滤器

public void addAllExcludeFilters ( filters)

添加要排除的测试的过滤器的ERROR(/Set)

参数
filters

添加全部包含注释

public void addAllIncludeAnnotation ( annotations)

添加要运行的测试的包含注释的ERROR(/Set)

参数
annotations

添加所有包含过滤器

public void addAllIncludeFilters ( filters)

添加要包含的测试的过滤器的ERROR(/Set)

参数
filters

添加排除注释

public void addExcludeAnnotation (String notAnnotation)

添加要运行的测试的排除注释

参数
notAnnotation String

添加排除过滤器

public void addExcludeFilter (String filter)

添加要排除的测试的过滤器

参数
filter String

添加包含注释

public void addIncludeAnnotation (String annotation)

添加要运行的测试的包含注释

参数
annotation String

添加包含过滤器

public void addIncludeFilter (String filter)

添加要包含的测试的过滤器

参数
filter String

清除排除注释

public void clearExcludeAnnotations ()

清除排除过滤器

public void clearExcludeFilters ()

清除包含注释

public void clearIncludeAnnotations ()

清除包含过滤器

public void clearIncludeFilters ()

获取排除注释

public  getExcludeAnnotation ()

退货

获取排除过滤器

public  getExcludeFilters ()

退货

获取包含注释

public  getIncludeAnnotation ()

退货

获取包含过滤器

public  getIncludeFilters ()

退货

应该运行

public boolean shouldRun (Description desc, 
                 extraJars)

检查带有注释的元素是否通过过滤器

参数
desc Description :描述测试的Description

extraJars :指向要加载的额外 jar 的ERROR(/File)列表。

退货
boolean如果测试方法应该运行则为 true,否则为 false

应该运行

public boolean shouldRun (String packageName, 
                Class<?> classObj, 
                Method method)

检查带有注释的元素是否通过过滤器

参数
packageName String : 方法包的名称

classObj Class :方法的类

method Method :测试方法

退货
boolean如果测试方法应该运行则为 true,否则为 false

应该测试运行

public boolean shouldTestRun (AnnotatedElement annotatedElement)

检查带有注释的元素是否通过过滤器

参数
annotatedElement AnnotatedElement :要过滤的元素

退货
boolean如果测试应该运行则为 true,否则为 false