MoblyBinaryHostTest

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

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


主機測試,旨在從 Android 建構系統 (Soong) 執行 mobly Python 二進位檔案

摘要

公用建構函式

MoblyBinaryHostTest()

公用方法

void addAllExcludeFilters( filters)

新增篩選器的 ERROR(/Set),用於排除要排除的測試。

void 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() 的替代版本,同時提供嘗試執行的區塊計數。

受保護的方法

String[] 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)

公用建構函式

MoblyBinaryHostTest

public MoblyBinaryHostTest ()

公用方法

addAllExcludeFilters

public void addAllExcludeFilters ( filters)

新增篩選器的 ERROR(/Set),用於排除要排除的測試。

參數
filters

addAllIncludeFilters

public void addAllIncludeFilters ( filters)

新增篩選器的 ERROR(/Set),用於指定要納入哪些測試。

參數
filters

addExcludeFilter

public void addExcludeFilter (String filter)

新增篩選器,用於排除要排除的測試。

參數
filter String

addIncludeFilter

public void addIncludeFilter (String filter)

新增篩選器,用於篩選要納入的測試。

參數
filter String

clearExcludeFilters

public void clearExcludeFilters ()

刪除目前追蹤的所有排除篩選條件。

clearIncludeFilters

public void clearIncludeFilters ()

刪除目前追蹤的所有包含篩選器。

getDevice

public ITestDevice getDevice ()

取得測試裝置。

傳回
ITestDevice ITestDevice

getExcludeFilters

public  getExcludeFilters ()

傳回排除篩選器的目前 ERROR(/Set)

傳回

getIncludeFilters

public  getIncludeFilters ()

傳回目前的 include 篩選器 ERROR(/Set)

傳回

得分

public final void run (TestInformation testInfo, 
                ITestInvocationListener listener)

執行測試,並將結果回報給監聽器。

參數
testInfo TestInformation:包含執行測試所需實用資訊的 TestInformation 物件。

listener ITestInvocationListener:測試結果的 ITestInvocationListener

setBuild

public void setBuild (IBuildInfo buildInfo)

參數
buildInfo IBuildInfo

setDevice

public void setDevice (ITestDevice device)

插入測試中的裝置。

參數
device ITestDevice:要使用的 ITestDevice

拆分

public  split (int shardCountHint)

split() 的替代版本,同時提供嘗試執行的區塊計數。這對某些無法隨意決定的測試執行程式相當實用。

參數
shardCountHint int:嘗試的分割區數量。

傳回
要個別執行的子測試集合,或如果測試目前無法分割,則為 null

受保護的方法

buildCommandLineArray

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

參數
filePath String

configPath String

tests

傳回
String[]

buildCommandLineArray

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

參數
filePath String

configPath String

傳回
String[]

filterTests

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

參數
testListLines String

runName String

listener ITestInvocationListener

傳回

getLogDirAbsolutePath

protected String getLogDirAbsolutePath ()

傳回
String

getLogDirFile

protected File getLogDirFile ()

傳回
File

processYamlTestResults

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

剖析 Mobly 測試結果並進行結果回報。

參數
inputStream InputStream:在 Mobly 測試結果檔案中讀取的 InputStream 物件。

parser MoblyYamlResultParser:處理 Mobly 測試結果的 MoblyYamlResultParser 物件。

listener ITestInvocationListener:執行各種回報作業的 ITestInvocationListener 例項。

runName String: str,Mobly 測試二進位執行作業的名稱。

傳回
boolean

reportLogs

protected void reportLogs (File logDir, 
                ITestInvocationListener listener)

參數
logDir File

listener ITestInvocationListener

updateConfigFile

protected void updateConfigFile (InputStream configInputStream, 
                Writer writer)

參數
configInputStream InputStream

writer Writer

擲回
HarnessRuntimeException