过滤结果转发器

public class FilteredResultForwarder
extends ResultForwarder

java.lang.Object
com.android.tradefed.result.ResultForwarder
com.android.tradefed.result.FilteredResultForwarder


ResultForwarder的变体,仅允许报告TestDescription的白名单。

概括

公共构造函数

FilteredResultForwarder ( allowedTests, ITestInvocationListener... listeners) FilteredResultForwarder ( allowedTests, ITestInvocationListener... listeners)

公共方法

void testAssumptionFailure ( TestDescription test, FailureDescription failure)

当原子测试标记其假定条件为 false 时调用

void testAssumptionFailure ( TestDescription test, String trace)

当原子测试标记其假定条件为 false 时调用

void testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, testMetrics)

报告单个测试用例的执行结束。

void testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))的替代方案,我们可以直接指定结束时间。

void testFailed ( TestDescription test, FailureDescription failure)

报告单个测试用例的失败。

void testFailed ( TestDescription test, String trace)

报告单个测试用例的失败。

void testIgnored ( TestDescription test)

当测试不会运行时调用,通常是因为测试方法用 org.junit.Ignore 注解。

void testStarted ( TestDescription test, long startTime)

testStarted(com.android.tradefed.result.TestDescription)的替代方案,其中我们还指定测试开始时间,并结合ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))进行准确测量。

void testStarted ( TestDescription test)

报告单个测试用例的开始。

公共构造函数

过滤结果转发器

public FilteredResultForwarder ( allowedTests, 
                ITestInvocationListener... listeners)

参数
allowedTests

listeners ITestInvocationListener

公共方法

测试假设失败

public void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

当原子测试标记其假定条件为 false 时调用

参数
test TestDescription :标识测试

failure FailureDescription :描述故障及其上下文的FailureDescription

测试假设失败

public void testAssumptionFailure (TestDescription test, 
                String trace)

当原子测试标记其假定条件为 false 时调用

参数
test TestDescription :标识测试

trace String : 失败的堆栈跟踪

测试结束

public void testEnded (TestDescription test, 
                 testMetrics)

报告单个测试用例的执行结束。

如果未调用testFailed(TestDescription, FailureDescription) ,则此测试通过。还返回测试用例执行期间可能发出的任何键/值指标。

参数
test TestDescription :标识测试

testMetrics :发出的指标的ERROR(/Map)

测试结束

public void testEnded (TestDescription test, 
                long endTime, 
                 testMetrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))的替代方案,我们可以直接指定结束时间。与testStarted(com.android.tradefed.result.TestDescription, long)结合使用以进行准确测量。

参数
test TestDescription :标识测试

endTime long :测试结束的时间,通过System.currentTimeMillis()测量

testMetrics :发出的指标的ERROR(/Map)

测试失败

public void testFailed (TestDescription test, 
                FailureDescription failure)

报告单个测试用例的失败。

将在 testStarted 和 testEnded 之间调用。

参数
test TestDescription :标识测试

failure FailureDescription :描述故障及其上下文的FailureDescription

测试失败

public void testFailed (TestDescription test, 
                String trace)

报告单个测试用例的失败。

将在 testStarted 和 testEnded 之间调用。

参数
test TestDescription :标识测试

trace String : 失败的堆栈跟踪

测试被忽略

public void testIgnored (TestDescription test)

当测试不会运行时调用,通常是因为测试方法用 org.junit.Ignore 注解。

参数
test TestDescription :标识测试

测试开始

public void testStarted (TestDescription test, 
                long startTime)

testStarted(com.android.tradefed.result.TestDescription)的替代方案,其中我们还指定测试开始时间,并结合ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))进行准确测量。

参数
test TestDescription :标识测试

startTime long :测试开始的时间,通过System.currentTimeMillis()测量

测试开始

public void testStarted (TestDescription test)

报告单个测试用例的开始。较旧的接口,应尽可能使用testStarted(com.android.tradefed.result.TestDescription)

参数
test TestDescription :标识测试