RunOnSecondaryUserTargetPreparer
public class RunOnSecondaryUserTargetPreparer
extends BaseTargetPreparer
implements IConfigurationReceiver
ITargetPreparer
,用於在設定中建立輔助用戶,並標記測試應在該用戶中執行。
在拆卸過程中,次要用戶被刪除。
如果輔助用戶已存在,則會使用該用戶而不是建立新用戶,並且在拆卸時不會將其刪除。
如果設備沒有能力在需要時建立新用戶,則將設定檢測參數skip-tests-reason,並且不會更改用戶。在設備上執行的測試可以讀取此參數來回應此狀態。
概括
公共構造函數
RunOnSecondaryUserTargetPreparer
public RunOnSecondaryUserTargetPreparer ()
公共方法
public void setUp (TestInformation testInfo)
參數 |
---|
testInfo | TestInformation |
投擲 |
---|
DeviceNotAvailableException | |
TargetSetupError | |
public void tearDown (TestInformation testInfo,
Throwable e)
參數 |
---|
testInfo | TestInformation |
e | Throwable |
投擲 |
---|
DeviceNotAvailableException | |
受保護的方法
可以創建其他用戶
protected boolean canCreateAdditionalUsers (ITestDevice device,
int numberOfUsers)
檢查是否可以建立所需數量的使用者。
參數 |
---|
device | ITestDevice |
numberOfUsers | int |
投擲 |
---|
DeviceNotAvailableException | |