MoblyBinaryHost測試

public class MoblyBinaryHostTest
extends Object implements IRemoteTest , IDeviceTest , IBuildReceiver , ITestFilterReceiver , IShardableTest

java.lang.Object
com.android.tradefed.testtype.mobly.MoblyBinaryHostTest


主機測試意味著從 Android 構建系統運行 mobly python 二進製文件 (Soong)

概括

公共構造函數

MoblyBinaryHostTest ()

公共方法

void addAllExcludeFilters ( filters) addAllExcludeFilters ( filters)

添加要排除的測試的過濾器的ERROR(/Set)

void addAllIncludeFilters ( filters) addAllIncludeFilters ( filters)

添加要包含的測試的過濾器的ERROR(/Set)

void addExcludeFilter (String filter)

添加要排除的測試的過濾器。

void addIncludeFilter (String filter)

添加要包含的測試的過濾器。

void clearExcludeFilters ()

刪除當前跟踪的所有排除過濾器。

void clearIncludeFilters ()

刪除當前跟踪的所有包含過濾器。

ITestDevice getDevice ()

獲取被測設備。

getExcludeFilters ()

返回排除過濾器的當前ERROR(/Set)

getIncludeFilters ()

返回包含過濾器的當前ERROR(/Set)

final void run ( TestInformation testInfo, ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

void setBuild ( IBuildInfo buildInfo)
void setDevice ( ITestDevice device)

注入被測設備。

split (int shardCountHint)

split()的替代版本還提供嘗試運行的 shardCount。

受保護的方法

String[] buildCommandLineArray (String filePath, String configPath, tests) buildCommandLineArray (String filePath, String configPath, tests)
String[] buildCommandLineArray (String filePath, String configPath)
filterTests (String[] testListLines, String runName, ITestInvocationListener listener)
String getLogDirAbsolutePath ()
File getLogDirFile ()
boolean processYamlTestResults (InputStream inputStream, MoblyYamlResultParser parser, ITestInvocationListener listener, String runName)

解析 Mobly 測試結果並進行結果報告。

void reportLogs (File logDir, ITestInvocationListener listener)
void updateConfigFile (InputStream configInputStream, Writer writer)

公共構造函數

MoblyBinaryHost測試

public MoblyBinaryHostTest ()

公共方法

添加所有排除過濾器

public void addAllExcludeFilters ( filters)

添加要排除的測試的過濾器的ERROR(/Set)

參數
filters

添加所有包含過濾器

public void addAllIncludeFilters ( filters)

添加要包含的測試的過濾器的ERROR(/Set)

參數
filters

添加排除過濾器

public void addExcludeFilter (String filter)

添加要排除的測試的過濾器。

參數
filter String

添加包含過濾器

public void addIncludeFilter (String filter)

添加要包含的測試的過濾器。

參數
filter String

清除排除過濾器

public void clearExcludeFilters ()

刪除當前跟踪的所有排除過濾器。

清除包含過濾器

public void clearIncludeFilters ()

刪除當前跟踪的所有包含過濾器。

獲取設備

public ITestDevice getDevice ()

獲取被測設備。

退貨
ITestDevice ITestDevice

獲取排除過濾器

public  getExcludeFilters ()

返回排除過濾器的當前ERROR(/Set)

退貨

獲取包含過濾器

public  getIncludeFilters ()

返回包含過濾器的當前ERROR(/Set)

退貨

跑步

public final void run (TestInformation testInfo, 
                ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

參數
testInfo TestInformationTestInformation對象包含運行測試的有用信息。

listener ITestInvocationListener :測試結果的ITestInvocationListener

設置構建

public void setBuild (IBuildInfo buildInfo)

參數
buildInfo IBuildInfo

設置設備

public void setDevice (ITestDevice device)

注入被測設備。

參數
device ITestDevice :要使用的ITestDevice

分裂

public  split (int shardCountHint)

split()的替代版本還提供嘗試運行的 shardCount。這對於某些有時無法隨意決定的測試運行者很有用。

參數
shardCountHint int :嘗試的分片計數。

退貨
要單獨執行的子測試的集合,如果測試當前不可分片,則為null

受保護的方法

構建命令行數組

protected String[] buildCommandLineArray (String filePath, 
                String configPath, 
                 tests)

參數
filePath String

configPath String

tests

退貨
String[]

構建命令行數組

protected String[] buildCommandLineArray (String filePath, 
                String configPath)

參數
filePath String

configPath String

退貨
String[]

過濾測試

protected  filterTests (String[] testListLines, 
                String runName, 
                ITestInvocationListener listener)

參數
testListLines String

runName String

listener ITestInvocationListener

退貨

獲取LogDirAbsolutePath

protected String getLogDirAbsolutePath ()

退貨
String

獲取日誌目錄文件

protected File getLogDirFile ()

退貨
File

流程Yaml測試結果

protected boolean processYamlTestResults (InputStream inputStream, 
                MoblyYamlResultParser parser, 
                ITestInvocationListener listener, 
                String runName)

解析 Mobly 測試結果並進行結果報告。

參數
inputStream InputStream :讀取 Mobly 測試結果文件中的 InputStream 對象。

parser MoblyYamlResultParser :處理 Mobly 測試結果的 MoblyYamlResultParser 對象。

listener ITestInvocationListener :執行各種報告的 ITestInitationListener 實例。

runName String : str,Mobly 測試二進制運行的名稱。

退貨
boolean

報告日誌

protected void reportLogs (File logDir, 
                ITestInvocationListener listener)

參數
logDir File

listener ITestInvocationListener

更新配置文件

protected void updateConfigFile (InputStream configInputStream, 
                Writer writer)

參數
configInputStream InputStream

writer Writer

投擲
HarnessRuntimeException