TestInformation

public class TestInformation
extends Object

java.lang.Object
   ↳ com.android.tradefed.invoker.TestInformation


容器物件,其中包含測試執行程式或測試可能需要的所有資訊和依附元件,才能正確執行。

摘要

巢狀類別

class TestInformation.Builder

用於建立 TestInformation 例項的建構工具。 

公用方法

static TestInformation createCopyTestInfo(TestInformation invocationInfo, IInvocationContext context)

使用複製的 ExecutionFiles 建立 TestInformation

static TestInformation createModuleTestInfo(TestInformation invocationInfo, IInvocationContext moduleContext)

建立代表模組而非叫用的 TestInformation

File dependenciesFolder()

傳回用於儲存叫用項所有依附元件的資料夾。

ExecutionFiles executionFiles()

傳回在叫用執行期間產生的檔案。

IBuildInfo getBuildInfo()

傳回主要裝置版本資訊。

IInvocationContext getContext()

傳回目前的叫用情境,如果是模組,則傳回模組情境。

File getDependencyFile(String fileName, boolean targetFirst)

根據依附元件/構件檔案的名稱和是否為目標或主機檔案 (可加快搜尋速度) 進行搜尋。

ITestDevice getDevice()

傳回測試中的主要裝置。

getDevices()

傳回叫用作業的裝置清單。

boolean isTestTimedOut()

傳回測試是否已收到逾時通知。

static TestInformation.Builder newBuilder()

建立建構工具,用於建立 TestInformation 例項。

void notifyTimeout()

通知系統已為這項測試觸發測試階段逾時。

ExecutionProperties properties()

傳回在叫用執行期間產生的屬性。

final void setActiveDeviceIndex(int index)

測試控管工具內部方法,可透過 getDevice() 切換預設傳回的裝置。

公用方法

createCopyTestInfo

public static TestInformation createCopyTestInfo (TestInformation invocationInfo, 
                IInvocationContext context)

使用複製的 ExecutionFiles 建立 TestInformation

參數
invocationInfo TestInformation

context IInvocationContext

傳回
TestInformation

createModuleTestInfo

public static TestInformation createModuleTestInfo (TestInformation invocationInfo, 
                IInvocationContext moduleContext)

建立代表模組而非叫用的 TestInformation

參數
invocationInfo TestInformation

moduleContext IInvocationContext

傳回
TestInformation

dependenciesFolder

public File dependenciesFolder ()

傳回用於儲存叫用作業的所有依附元件的資料夾。

傳回
File

executionFiles

public ExecutionFiles executionFiles ()

傳回在叫用執行期間產生的檔案。建議您透過 ExecutionFiles 傳遞檔案,以便在 target_preparers 和測試之間提供檔案。

傳回
ExecutionFiles

getBuildInfo

public IBuildInfo getBuildInfo ()

傳回主要裝置版本資訊。

傳回
IBuildInfo

getContext

public IInvocationContext getContext ()

傳回目前的叫用情境,如果是模組,則傳回模組情境。

傳回
IInvocationContext

getDependencyFile

public File getDependencyFile (String fileName, 
                boolean targetFirst)

根據依附元件/構件檔案的名稱和是否為目標或主機檔案 (可加快搜尋速度) 搜尋該檔案。

參數
fileName String:我們要尋找的檔案名稱。

targetFirst boolean:我們是否偏好在搜尋時使用目標端檔案,而非主機端檔案。

傳回
File 找到的構件檔案。

擲回
如果找不到檔案。

getDevice

public ITestDevice getDevice ()

傳回測試中的主要裝置。

傳回
ITestDevice

getDevices

public  getDevices ()

傳回叫用作業的裝置清單。

傳回

isTestTimedOut

public boolean isTestTimedOut ()

傳回測試是否已收到逾時通知。

傳回
boolean

newBuilder

public static TestInformation.Builder newBuilder ()

建立建構工具,用於建立 TestInformation 例項。

傳回
TestInformation.Builder

notifyTimeout

public void notifyTimeout ()

通知系統已為這項測試觸發測試階段逾時。

屬性

public ExecutionProperties properties ()

傳回在叫用執行期間產生的屬性。在 target_preparer 和測試之間交換資訊時,建議透過 ExecutionProperties 傳遞值和資訊。

傳回
ExecutionProperties

setActiveDeviceIndex

public final void setActiveDeviceIndex (int index)

測試控管工具內部方法,可切換預設傳回的裝置 (使用 getDevice())。一律重設為 0。

參數
index int