FilteredResultForwarder

public class FilteredResultForwarder
extends ResultForwarder

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


ResultForwarder 的变体,仅允许报告 TestDescription 的允许列表。

摘要

公共构造函数

FilteredResultForwarder(Collection<TestDescription> allowedTests, ITestInvocationListener... listeners)

公共方法

void testAssumptionFailure(TestDescription test, FailureDescription failure)

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

void testAssumptionFailure(TestDescription test, String trace)

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

void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)
void testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)

与 testEnded(TestDescription,Map) 不同,我们可以直接指定结束时间。

void testEnded(TestDescription test, Map<String, String> testMetrics)
void testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)

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

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(TestDescription) 不同,我们还指定了测试的开始时间,并结合 testEnded(TestDescription,long,Map) 进行准确测量。

void testStarted(TestDescription test)

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

公共构造函数

FilteredResultForwarder

public FilteredResultForwarder (Collection<TestDescription> allowedTests, 
                ITestInvocationListener... listeners)

参数
allowedTests Collection

listeners ITestInvocationListener

公共方法

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

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

参数
test TestDescription:标识测试

failure FailureDescription:描述失败及其上下文的 FailureDescription。

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

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

参数
test TestDescription:标识测试

trace String:失败的堆栈轨迹

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                Map<String, String> testMetrics)

参数
test TestDescription

endTime long

testMetrics Map

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

与 testEnded(TestDescription,Map) 不同,我们可以直接指定结束时间 。结合 testStarted(TestDescription,long) 进行准确测量。

参数
test TestDescription:标识测试

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

testMetrics HashMap:发出的指标的 Map

testEnded

public void testEnded (TestDescription test, 
                Map<String, String> testMetrics)

参数
test TestDescription

testMetrics Map

testEnded

public void testEnded (TestDescription test, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

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

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

参数
test TestDescription:标识测试

testMetrics HashMap:发出的指标的 Map

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

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

将在 testStarted 和 testEnded 之间调用。

参数
test TestDescription:标识测试

failure FailureDescription:描述失败及其上下文的 FailureDescription。

testFailed

public void testFailed (TestDescription test, 
                String trace)

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

将在 testStarted 和 testEnded 之间调用。

参数
test TestDescription:标识测试

trace String:失败的堆栈轨迹

testIgnored

public void testIgnored (TestDescription test)

当测试不会运行(通常是因为测试方法使用 org.junit.Ignore 注释)时调用。

参数
test TestDescription:标识测试

testStarted

public void testStarted (TestDescription test, 
                long startTime)

与 testStarted(TestDescription) 不同,我们还指定了测试的开始时间,并结合 testEnded(TestDescription,long,Map) 进行准确测量。

参数
test TestDescription:标识测试

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

testStarted

public void testStarted (TestDescription test)

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

参数
test TestDescription:标识测试