測試訊息
public class TestInformation
extends Object
java.lang.Object | |
↳ | com.android.tradefed.invoker.TestInformation |
Holder 物件包含測試運行程序或測試正確執行可能需要的所有資訊和相依性。
概括
嵌套類 | |
---|---|
class | TestInformation.Builder 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 () 返回被測的主要設備。 |
getDevices () 傳回呼叫部分的設備列表。 | |
boolean | isTestTimedOut () 傳回測試是否被通知逾時。 |
static TestInformation.Builder | newBuilder () 建立一個用於建立 |
void | notifyTimeout () 通知此測試已觸發測試階段逾時。 |
ExecutionProperties | properties () 傳回調用執行期間產生的屬性。 |
final void | setActiveDeviceIndex (int index) 測試 Harness 內部方法以切換預設使用 |
公共方法
建立複製測試訊息
public static TestInformation createCopyTestInfo (TestInformation invocationInfo, IInvocationContext context)
使用複製的ExecutionFiles
建立TestInformation
。
參數 | |
---|---|
invocationInfo | TestInformation |
context | IInvocationContext |
退貨 | |
---|---|
TestInformation |
建立模組測試訊息
public static TestInformation createModuleTestInfo (TestInformation invocationInfo, IInvocationContext moduleContext)
建立代表模組而不是呼叫的TestInformation
。
參數 | |
---|---|
invocationInfo | TestInformation |
moduleContext | IInvocationContext |
退貨 | |
---|---|
TestInformation |
依賴資料夾
public File dependenciesFolder ()
傳回儲存呼叫的所有依賴項的資料夾。
退貨 | |
---|---|
File |
執行檔
public ExecutionFiles executionFiles ()
傳回呼叫執行期間產生的檔案。透過ExecutionFiles
傳遞檔案是使檔案在 target_preparers 和測試之間可用的推薦方法。
退貨 | |
---|---|
ExecutionFiles |
取得依賴文件
public File getDependencyFile (String fileName, boolean targetFirst)
根據名稱搜尋依賴項/工件文件,以及它是否是目標文件或主機文件(以便更快搜尋)。
參數 | |
---|---|
fileName | String :我們正在尋找的檔案的名稱。 |
targetFirst | boolean :我們是否支援目標端檔案與主機端檔案進行搜尋。 |
退貨 | |
---|---|
File | 找到的工件檔案。 |
投擲 | |
---|---|
| 如果找不到該文件。 |
取得設備
publicgetDevices ()
傳回呼叫部分的設備列表。
退貨 | |
---|---|
測試超時
public boolean isTestTimedOut ()
傳回測試是否被通知逾時。
退貨 | |
---|---|
boolean |
新建造者
public static TestInformation.Builder newBuilder ()
建立一個用於建立TestInformation
實例的建構器。
退貨 | |
---|---|
TestInformation.Builder |
通知逾時
public void notifyTimeout ()
通知此測試已觸發測試階段逾時。
特性
public ExecutionProperties properties ()
傳回調用執行期間產生的屬性。透過ExecutionProperties
傳遞值和資訊是在 target_preparers 和測試之間交換資訊的推薦方法。
退貨 | |
---|---|
ExecutionProperties |
設定活動設備索引
public final void setActiveDeviceIndex (int index)
測試 Harness 內部方法以切換預設使用getDevice()
傳回的裝置。始終重置為 0。
參數 | |
---|---|
index | int |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。