JsonHttpTestResultReporter
public class JsonHttpTestResultReporter
extends CollectingTestListener
结果报告器,对测试指标结果进行编码,并将设备信息分支为JSON,然后将POST分支为HTTP服务端点
概要
公共建设者
JsonHttpTestResultReporter
public JsonHttpTestResultReporter ()
公开方法
getValidMetrics
public getValidMetrics ( collectedMetrics)
仅添加数字指标,并跳过发布非数字指标。
参量 |
---|
collectedMetrics | :包含所有指标。 |
调用结束
public void invocationEnded (long elapsedTime)
调用失败
public void invocationFailed (Throwable cause)
调用开始
public void invocationStarted (IInvocationContext context)
参量 |
---|
context | IInvocationContext |
受保护的方法
getDevice
protected ITestDevice getDevice (IInvocationContext context)
参量 |
---|
context | IInvocationContext |
parseAdditionalDeviceDetails
protected void parseAdditionalDeviceDetails (ITestDevice testDevice)
从测试设备中检索设备名称,SDK版本号和内部版本ID。
参量 |
---|
testDevice | ITestDevice :从中收集信息的设备。 |
postResults
protected void postResults (JSONObject postData)
将数据发布到指定的HTTP端点
参量 |
---|
postData | JSONObject :要发布的数据 |