基础后处理器

public abstract class BasePostProcessor
extends Object implements IPostProcessor

对象
com.android.tradefed.postprocessor.BasePostProcessor


该基地IPostProcessor每个执行应该扩展。确保在最终结果报告者之前调用后处理方法。

概括

公共构造函数

BasePostProcessor ()

公共方法

final ITestInvocationListener init (ITestInvocationListener listener)

后处理器的初始化步骤。

final void invocationEnded (long elapsedTime)
final void invocationFailed (FailureDescription failure)
final void invocationFailed (Throwable cause)
final void invocationStarted (IInvocationContext context)

用于转发的调用侦听器

final boolean isDisabled ()

如果整个对象被禁用(跳过安装和拆卸),则返回 True。

final void logAssociation (String dataName, LogFile logFile)

更新日志到测试关联。

processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs) processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs)

实施此方法以汇总所有测试中的指标和日志。

abstract processRunMetricsAndLogs ( rawMetrics, runLogs) processRunMetricsAndLogs ( rawMetrics, runLogs) processRunMetricsAndLogs ( rawMetrics, runLogs)

实施此方法以从现有指标和日志生成一组新指标。

processTestMetricsAndLogs (TestDescription testDescription, testMetrics, testLogs) processTestMetricsAndLogs (TestDescription testDescription, testMetrics, testLogs) processTestMetricsAndLogs (TestDescription testDescription, testMetrics, testLogs)

实施此方法以发布每个测试的流程指标和日志。

final void setLogSaver (ILogSaver logSaver)
final void testAssumptionFailure (TestDescription test, String trace)
final void testAssumptionFailure (TestDescription test, FailureDescription failure)
final void testEnded (TestDescription test, long endTime, testMetrics) testEnded (TestDescription test, long endTime, testMetrics)
final void testEnded (TestDescription test, testMetrics) testEnded (TestDescription test, testMetrics)
final void testFailed (TestDescription test, FailureDescription failure)
final void testFailed (TestDescription test, String trace)
final void testIgnored (TestDescription test)
final void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)

使用此方法记录来自 PostProcessor 实现的文件。

final void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
final void testModuleEnded ()
final void testModuleStarted (IInvocationContext moduleContext)
final void testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics)
final void testRunFailed (FailureDescription failure)
final void testRunFailed (String errorMessage)
final void testRunStarted (String runName, int testCount, int attemptNumber)
final void testRunStarted (String runName, int testCount)

测试运行回调

final void testRunStopped (long elapsedTime)
final void testStarted (TestDescription test, long startTime)
final void testStarted (TestDescription test)

测试用例回调

受保护的方法

MetricMeasurement.DataType getMetricType ()

如果需要,覆盖此方法以更改指标类型。

String getRunName ()

公共构造函数

基础后处理器

public BasePostProcessor ()

公共方法

在里面

public final ITestInvocationListener init (ITestInvocationListener listener)

后处理器的初始化步骤。确保在任何测试回调之前调用。

参数
listener ITestInvocationListener

退货
ITestInvocationListener

调用结束

public final void invocationEnded (long elapsedTime)

参数
elapsedTime long

调用失败

public final void invocationFailed (FailureDescription failure)

参数
failure FailureDescription

调用失败

public final void invocationFailed (Throwable cause)

参数
cause Throwable

调用开始

public final void invocationStarted (IInvocationContext context)

用于转发的调用侦听器

参数
context IInvocationContext

被禁用

public final boolean isDisabled ()

如果整个对象被禁用(跳过安装和拆卸),则返回 True。否则为假。

退货
boolean

日志关联

public final void logAssociation (String dataName, 
                LogFile logFile)

更新日志到测试关联。如果在测试过程中调用该方法,则日志属于该测试;否则它将是一个运行日志。

参数
dataName String

logFile LogFile

processAllTestMetricsAndLogs

public  processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, 
                 allTestLogs)

实施此方法以汇总所有测试中的指标和日志。来自此方法的指标将作为运行指标报告。只应返回新生成的指标,并具有唯一的键名(不允许与现有键发生冲突)。

参数
allTestMetrics ListMultimap :甲HashMultimap存储从通过量度名称分组每个测试的指标。

allTestLogs :一个地图存储通过数据名称键入日志文件,每个测试的地图,使用每个测试的TestDescription作为键。

退货
从所有测试指标中新生成的一组指标。

processRunMetricsAndLogs

public abstract  processRunMetricsAndLogs ( rawMetrics, 
                 runLogs)

实施此方法以从现有指标和日志生成一组新指标。只应返回新生成的指标,并具有唯一的键名(不允许与现有键发生冲突)。

参数
rawMetrics :可用于运行的原始指标集。

runLogs :测试运行的日志文件集。

退货
从运行指标中新生成的指标集。

processTestMetricsAndLogs

public  processTestMetricsAndLogs (TestDescription testDescription, 
                 testMetrics, 
                 testLogs)

实施此方法以发布每个测试的流程指标和日志。只应返回新生成的指标,并具有唯一的键名(不允许与现有键发生冲突)。

参数
testDescription TestDescription :描述测试的TestDescription对象。

testMetrics :测试中的一组指标。

testLogs :测试期间记录的文件集。

退货
从测试指标中新生成的指标集。

设置日志保护程序

public final void setLogSaver (ILogSaver logSaver)

参数
logSaver ILogSaver

测试假设失败

public final void testAssumptionFailure (TestDescription test, 
                String trace)

参数
test TestDescription

trace String

测试假设失败

public final void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

参数
test TestDescription

failure FailureDescription

测试结束

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

参数
test TestDescription

endTime long

testMetrics

测试结束

public final void testEnded (TestDescription test, 
                 testMetrics)

参数
test TestDescription

testMetrics

测试失败

public final void testFailed (TestDescription test, 
                FailureDescription failure)

参数
test TestDescription

failure FailureDescription

测试失败

public final void testFailed (TestDescription test, 
                String trace)

参数
test TestDescription

trace String

测试忽略

public final void testIgnored (TestDescription test)

参数
test TestDescription

测试日志

public final void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

使用此方法记录来自 PostProcessor 实现的文件。

参数
dataName String

dataType LogDataType

dataStream InputStreamSource

测试日志已保存

public final void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

参数
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

测试模块结束

public final void testModuleEnded ()

测试模块启动

public final void testModuleStarted (IInvocationContext moduleContext)

参数
moduleContext IInvocationContext

测试运行结束

public final void testRunEnded (long elapsedTime, 
                 runMetrics)

参数
elapsedTime long

runMetrics

测试运行失败

public final void testRunFailed (FailureDescription failure)

参数
failure FailureDescription

测试运行失败

public final void testRunFailed (String errorMessage)

参数
errorMessage String

测试运行开始

public final void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

参数
runName String

testCount int

attemptNumber int

测试运行开始

public final void testRunStarted (String runName, 
                int testCount)

测试运行回调

参数
runName String

testCount int

测试运行停止

public final void testRunStopped (long elapsedTime)

参数
elapsedTime long

测试开始

public final void testStarted (TestDescription test, 
                long startTime)

参数
test TestDescription

startTime long

测试开始

public final void testStarted (TestDescription test)

测试用例回调

参数
test TestDescription

受保护的方法

获取度量类型

protected MetricMeasurement.DataType getMetricType ()

如果需要,覆盖此方法以更改指标类型。默认情况下,指标设置为已处理类型。

退货
MetricMeasurement.DataType

获取运行名称

protected String getRunName ()

退货
String