管理遠端設備
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) 建立一個 |
公共方法 | |
---|---|
TestDeviceOptions | getOptions () 在嘗試進行遠端設定之前,請覆寫基本 getter 以便能夠解析動態選項。 |
GceAvdInfo | getRemoteAvdInfo () 傳回描述遠端執行個體的 |
void | postInvocationTearDown (Throwable exception) |
void | preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes) |
void | setTestLogger (ITestLogger testLogger) |
受保護的方法 | |
---|---|
long | getCurrentTime () 返回目前系統時間。 |
void | launchGce () 根據建置資訊啟動實際的 gce 裝置。 |
公共構造函數
管理遠端設備
public ManagedRemoteDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
建立一個ManagedRemoteDevice
。
參數 | |
---|---|
device | IDevice :關聯的IDevice |
stateMonitor | IDeviceStateMonitor :要使用的IDeviceStateMonitor 機制 |
allocationMonitor | IDeviceMonitor :通知指派狀態變更的IDeviceMonitor 。 |
公共方法
取得選項
public TestDeviceOptions getOptions ()
在嘗試進行遠端設定之前,請覆寫基本 getter 以便能夠解析動態選項。
退貨 | |
---|---|
TestDeviceOptions |
調用後拆卸
public void postInvocationTearDown (Throwable exception)
參數 | |
---|---|
exception | Throwable |
調用前設定
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
參數 | |
---|---|
info | IBuildInfo |
attributes | MultiMap |
投擲 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
設定測試記錄器
public void setTestLogger (ITestLogger testLogger)
參數 | |
---|---|
testLogger | ITestLogger |
受保護的方法
取得當前時間
protected long getCurrentTime ()
返回目前系統時間。暴露進行測試。
退貨 | |
---|---|
long |
啟動Gce
protected void launchGce ()
根據建置資訊啟動實際的 gce 裝置。
投擲 | |
---|---|
TargetSetupError |