託管遠程設備

public class ManagedRemoteDevice
extends TestDevice implements ITestLoggerReceiver

java.lang.Object
com.android.tradefed.device.NativeDevice
com.android.tradefed.device.TestDevice
com.android.tradefed.device.cloud.ManagedRemoteDevice


在我們通過虛擬機內的 Tradefed 實例遠程管理的虛擬機內運行的設備。

概括

公共構造函數

ManagedRemoteDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

創建一個ManagedRemoteDevice

公共方法

TestDeviceOptions getOptions ()

在嘗試進行遠程設置之前覆蓋基本的 getter 以便能夠解析動態選項。

GceAvdInfo getRemoteAvdInfo ()

返回描述遠程實例的GceAvdInfo

void postInvocationTearDown (Throwable exception)

特定於設備的額外步驟需要清理,將在調用完成後執行。

void preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes)

設備特定所需設置的額外步驟將在調用流程之前在設備上執行。

void setTestLogger ( ITestLogger testLogger)

注入ITestLogger實例

受保護的方法

long getCurrentTime ()

返回當前系統時間。

void launchGce ( MultiMap <String, String> attributes)

根據構建信息啟動實際的 gce 設備。

公共構造函數

託管遠程設備

public ManagedRemoteDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

創建一個ManagedRemoteDevice

參數
device IDevice :關聯的IDevice

stateMonitor IDeviceStateMonitor :要使用的IDeviceStateMonitor機制

allocationMonitor IDeviceMonitor :通知分配狀態更改的IDeviceMonitor

公共方法

獲取選項

public TestDeviceOptions getOptions ()

在嘗試進行遠程設置之前覆蓋基本的 getter 以便能夠解析動態選項。

退貨
TestDeviceOptions與被測設備相關的TestDeviceOptions

getRemoteAvdInfo

public GceAvdInfo getRemoteAvdInfo ()

返回描述遠程實例的GceAvdInfo

退貨
GceAvdInfo

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

特定於設備的額外步驟需要清理,將在調用完成後執行。

參數
exception Throwable :如果有的話,調用失敗引發的最終異常。

預調用設置

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

設備特定所需設置的額外步驟將在調用流程之前在設備上執行。

參數
info IBuildInfo :設備的IBuildInfo

attributes MultiMap :存儲在調用上下文中的屬性

投擲
DeviceNotAvailableException
TargetSetupError

設置測試記錄器

public void setTestLogger (ITestLogger testLogger)

注入ITestLogger實例

參數
testLogger ITestLogger

受保護的方法

獲取當前時間

protected long getCurrentTime ()

返回當前系統時間。暴露測試。

退貨
long

啟動Gce

protected void launchGce (MultiMap<String, String> attributes)

根據構建信息啟動實際的 gce 設備。

參數
attributes MultiMap

投擲
TargetSetupError