TestInformation
public
class
TestInformation
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.invoker.TestInformation |
這個物件包含測試執行器或測試可能需要的所有資訊和依附元件,才能正確執行。
摘要
巢狀類別 | |
|---|---|
class |
TestInformation.Builder
用於建立 |
公用方法 | |
|---|---|
static
TestInformation
|
createCopyTestInfo(TestInformation invocationInfo, IInvocationContext context)
使用複製的 |
static
TestInformation
|
createModuleTestInfo(TestInformation invocationInfo, IInvocationContext moduleContext)
建立 |
File
|
dependenciesFolder()
傳回儲存呼叫所有依附元件的資料夾。 |
ExecutionFiles
|
executionFiles()
傳回在叫用執行期間產生的檔案。 |
IBuildInfo
|
getBuildInfo()
傳回主要裝置的建構資訊。 |
IInvocationContext
|
getContext()
傳回目前的叫用內容,如果是模組,則傳回模組內容。 |
File
|
getDependencyFile(String fileName, boolean targetFirst)
根據名稱搜尋依附元件/構件檔案,以及是否為目標或主機檔案 (可加快搜尋速度)。 |
ITestDevice
|
getDevice()
傳回測試中的主要裝置。 |
List<ITestDevice>
|
getDevices()
傳回屬於叫用部分的裝置清單。 |
boolean
|
isTestTimedOut()
傳回測試是否已收到逾時通知。 |
static
TestInformation.Builder
|
newBuilder()
建立建構工具,用於建立 |
void
|
notifyTimeout()
通知這項測試已觸發測試階段逾時。 |
ExecutionProperties
|
properties()
傳回在叫用執行期間產生的屬性。 |
final
void
|
setActiveDeviceIndex(int index)
測試控管工具內部方法,可切換 |
公用方法
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 |
|
getDependencyFile
public File getDependencyFile (String fileName,
boolean targetFirst)根據名稱搜尋依附元件/構件檔案,以及是否為目標或主機檔案 (可加快搜尋速度)。
| 參數 | |
|---|---|
fileName |
String:我們要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
| 傳回 | |
|---|---|
File |
找到的構件檔案。 |
| 擲回 | |
|---|---|
FileNotFoundException |
如果找不到檔案。 |
isTestTimedOut
public boolean isTestTimedOut ()
傳回測試是否已收到逾時通知。
| 傳回 | |
|---|---|
boolean |
|
newBuilder
public static TestInformation.Builder newBuilder ()
建立用於建立 TestInformation 執行個體的建構工具。
| 傳回 | |
|---|---|
TestInformation.Builder |
|
notifyTimeout
public void notifyTimeout ()
通知這項測試已觸發測試階段逾時。
屬性
public ExecutionProperties properties ()
傳回在叫用執行期間產生的屬性。建議您透過 ExecutionProperties 傳遞值和資訊,在 target_preparer 和測試之間交換資訊。
| 傳回 | |
|---|---|
ExecutionProperties |
|
setActiveDeviceIndex
public final void setActiveDeviceIndex (int index)
測試控管工具內部方法,可使用 getDevice() 切換預設傳回的裝置。一律重設為 0。
| 參數 | |
|---|---|
index |
int |