デバイステスト実行オプション

public class DeviceTestRunOptions
extends Object

java.lang.オブジェクト
com.android.tradefed.testtype.junit4.DeviceTestRunOptions


BaseHostJUnit4Test を介したデバイス テストの実行に関連するオプションのビルダー クラス。

まとめ

パブリックコンストラクター

DeviceTestRunOptions (String packageName)

パブリックメソッド

DeviceTestRunOptions addExtraListener ( ITestLifeCycleReceiver listener)

実行中のインストルメンテーションに追加のリスナーを追加します。

DeviceTestRunOptions addInstrumentationArg (String key, String value)

インストルメンテーションに渡される引数を追加します。

void clearExtraListeners ()
void clearInstrumentationArgs ()

以前にaddInstrumentationArg(String, String)で設定されたすべてのインストルメンテーション引数をクリアします。

String getApkFileName ()

apk インストールの apk ファイルの名前を返します。

ITestDevice getDevice ()
getExtraListeners ()
String[] getInstallArgs ()

インストールコマンドの追加オプションを返します。

getInstrumentationArgs ()
Long getMaxInstrumentationTimeoutMs ()
Long getMaxTimeToOutputMs ()
String getPackageName ()
String getRunner ()
String getTestClassName ()
String getTestMethodName ()
Long getTestTimeoutMs ()
Integer getUserId ()
boolean isForceQueryable ()

インストールされる APK がクエリ可能であるかどうか。

boolean isGrantPermission ()

APK のインストールに対する権限を付与するかどうか。

boolean isHiddenApiCheckDisabled ()
boolean isIsolatedStorageDisabled ()
boolean isRestartDisabled ()
boolean isTestApiCheckDisabled ()
boolean isWindowAnimationDisabled ()
DeviceTestRunOptions setApkFileName (String apkFileName)

apk インストールの apk ファイルの名前を設定します。

DeviceTestRunOptions setCheckResults (boolean checkResults)

インストルメンテーションの実行結果をチェックして、障害が発生していないことを確認するかどうかを設定します。

DeviceTestRunOptions setDevice ( ITestDevice device)
DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)

ホスト側から使用される「aminstrument」に --no-hidden-api-checks を追加するかどうかを設定します。

DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

ホスト側から使用する「aminstrument」に--no-isoulated-storageを追加するかどうかを設定します。

DeviceTestRunOptions setDisableRestart (boolean disableRestart)

ホスト側から使用する「aminstrument」に--no-restartを付加するかどうかを設定します。

DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

ホスト側から使用する「am計測器」に--no-test-api-accessを追加するかどうかを設定します。

DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

ホスト側から使用する「aminstrument」に--no-window-animationを追加するかどうかを設定します。

DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

インストールされる APK がクエリ可能でない場合はfalseを設定します。

DeviceTestRunOptions setGrantPermission (boolean grantPermission)

APK をインストールするためのアクセス許可を付与します。

DeviceTestRunOptions setInstallArgs (String... installArgs)

インストールコマンドの追加オプションを設定します。

DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

完全なインストルメンテーションが実行して完了するまでに必要な最大時間 (ミリ秒単位) を設定します。

DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

インストルメンテーションが停止するまでに出力を停止できる最大時間 (ミリ秒単位) を設定します。

DeviceTestRunOptions setRunner (String runner)

インストルメンテーションの実行に使用するインストルメンテーション ランナーを設定します。

DeviceTestRunOptions setTestClassName (String testClassName)

インストルメンテーションが実行するクラス名を設定します。

DeviceTestRunOptions setTestMethodName (String testMethodName)

インストルメンテーションが実行するメソッド名を設定します。

DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

テストが中断されるまでに実行できる最大時間 (ミリ秒) を設定します。

DeviceTestRunOptions setUserId (Integer userId)

インストルメンテーションを実行する対象となるユーザー ID を設定します。

boolean shouldCheckResults ()

パブリックコンストラクター

デバイステスト実行オプション

public DeviceTestRunOptions (String packageName)

パラメーター
packageName String

パブリックメソッド

addExtraListener

public DeviceTestRunOptions addExtraListener (ITestLifeCycleReceiver listener)

実行中のインストルメンテーションに追加のリスナーを追加します。

パラメーター
listener ITestLifeCycleReceiver

戻り値
DeviceTestRunOptions

addInstrumentationArg

public DeviceTestRunOptions addInstrumentationArg (String key, 
                String value)

インストルメンテーションに渡される引数を追加します。

パラメーター
key String

value String

戻り値
DeviceTestRunOptions

クリアエクストラリスナー

public void clearExtraListeners ()

clearInstrumentationArgs

public void clearInstrumentationArgs ()

以前にaddInstrumentationArg(String, String)で設定されたすべてのインストルメンテーション引数をクリアします。

getApkファイル名

public String getApkFileName ()

apk インストールの apk ファイルの名前を返します。

戻り値
String

デバイスの取得

public ITestDevice getDevice ()

戻り値
ITestDevice

getExtraListeners

public  getExtraListeners ()

戻り値

getInstallArgs

public String[] getInstallArgs ()

インストールコマンドの追加オプションを返します。

戻り値
String[]

getInstrumentationArgs

public  getInstrumentationArgs ()

戻り値

getMaxInstrumentationTimeoutMs

public Long getMaxInstrumentationTimeoutMs ()

戻り値
Long

getMaxTimeToOutputMs

public Long getMaxTimeToOutputMs ()

戻り値
Long

getパッケージ名

public String getPackageName ()

戻り値
String

ゲットランナー

public String getRunner ()

戻り値
String

getテストクラス名

public String getTestClassName ()

戻り値
String

getテストメソッド名

public String getTestMethodName ()

戻り値
String

getTestTimeoutMs

public Long getTestTimeoutMs ()

戻り値
Long

ユーザーIDの取得

public Integer getUserId ()

戻り値
Integer

isForceQueryable

public boolean isForceQueryable ()

インストールされる APK がクエリ可能であるかどうか。デフォルト値は true です。

戻り値
boolean

isGrantPermission

public boolean isGrantPermission ()

APK のインストールに対する権限を付与するかどうか。

戻り値
boolean

isHiddenApiCheckDisabled

public boolean isHiddenApiCheckDisabled ()

戻り値
boolean

isIsolatedStorageDisabled

public boolean isIsolatedStorageDisabled ()

戻り値
boolean

isRestartDisabled

public boolean isRestartDisabled ()

戻り値
boolean

isTestApiCheckDisabled

public boolean isTestApiCheckDisabled ()

戻り値
boolean

isWindowAnimationDisabled

public boolean isWindowAnimationDisabled ()

戻り値
boolean

setApkファイル名

public DeviceTestRunOptions setApkFileName (String apkFileName)

apk インストールの apk ファイルの名前を設定します。

パラメーター
apkFileName String

戻り値
DeviceTestRunOptions

setCheckResults

public DeviceTestRunOptions setCheckResults (boolean checkResults)

インストルメンテーションの実行結果をチェックして、障害が発生していないことを確認するかどうかを設定します。

パラメーター
checkResults boolean

戻り値
DeviceTestRunOptions

セットデバイス

public DeviceTestRunOptions setDevice (ITestDevice device)

パラメーター
device ITestDevice

戻り値
DeviceTestRunOptions

setDisableHiddenApiCheck

public DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)

ホスト側から使用される「aminstrument」に --no-hidden-api-checks を追加するかどうかを設定します。

パラメーター
disableHiddenApiCheck boolean

戻り値
DeviceTestRunOptions

setDisableIsolatedStorage

public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

ホスト側から使用する「aminstrument」に--no-isoulated-storageを追加するかどうかを設定します。

パラメーター
disableIsolatedStorage boolean

戻り値
DeviceTestRunOptions

setDisableRestart

public DeviceTestRunOptions setDisableRestart (boolean disableRestart)

ホスト側から使用する「aminstrument」に--no-restartを付加するかどうかを設定します。

パラメーター
disableRestart boolean

戻り値
DeviceTestRunOptions

setDisableTestApiCheck

public DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

ホスト側から使用する「am計測器」に--no-test-api-accessを追加するかどうかを設定します。

パラメーター
disableTestApiCheck boolean

戻り値
DeviceTestRunOptions

setDisableWindowAnimation

public DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

ホスト側から使用する「aminstrument」に--no-window-animationを追加するかどうかを設定します。

パラメーター
disableWindowAnimation boolean

戻り値
DeviceTestRunOptions

setForceQueryable

public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

インストールされる APK がクエリ可能でない場合はfalseを設定します。

パラメーター
forceQueryable boolean

戻り値
DeviceTestRunOptions

setGrantPermission

public DeviceTestRunOptions setGrantPermission (boolean grantPermission)

APK をインストールするためのアクセス許可を付与します。

パラメーター
grantPermission boolean

戻り値
DeviceTestRunOptions

setInstallArgs

public DeviceTestRunOptions setInstallArgs (String... installArgs)

インストールコマンドの追加オプションを設定します。

パラメーター
installArgs String

戻り値
DeviceTestRunOptions

setMaxInstrumentationTimeoutMs

public DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

完全なインストルメンテーションが実行して完了するまでに必要な最大時間 (ミリ秒単位) を設定します。タイムアウトなしの場合は 0 に設定します。オプション。

パラメーター
maxInstrumentationTimeoutMs Long

戻り値
DeviceTestRunOptions

setMaxTimeToOutputMs

public DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

インストルメンテーションが停止するまでに出力を停止できる最大時間 (ミリ秒単位) を設定します。タイムアウトなしの場合は 0 に設定します。オプション。

パラメーター
maxTimeToOutputMs Long

戻り値
DeviceTestRunOptions

セットランナー

public DeviceTestRunOptions setRunner (String runner)

インストルメンテーションの実行に使用するインストルメンテーション ランナーを設定します。デフォルトのランナーは「android.support.test.runner.AndroidJUnitRunner」です。オプション。

パラメーター
runner String

戻り値
DeviceTestRunOptions

setTestClassName

public DeviceTestRunOptions setTestClassName (String testClassName)

インストルメンテーションが実行するクラス名を設定します。インストルメンテーションは、クラスのみを実行するようにフィルタリングされます。 setTestMethodName(String)とともに使用できます。オプション。

パラメーター
testClassName String

戻り値
DeviceTestRunOptions

setTestMethodName

public DeviceTestRunOptions setTestMethodName (String testMethodName)

インストルメンテーションが実行するメソッド名を設定します。正しく動作するには、 setTestClassName(String)を設定する必要があります。オプション。

パラメーター
testMethodName String

戻り値
DeviceTestRunOptions

setTestTimeoutMs

public DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

テストが中断されるまでに実行できる最大時間 (ミリ秒) を設定します。タイムアウトなしの場合は 0 に設定します。オプション。

パラメーター
testTimeoutMs Long

戻り値
DeviceTestRunOptions

setUserId

public DeviceTestRunOptions setUserId (Integer userId)

インストルメンテーションを実行する対象となるユーザー ID を設定します。オプション。

パラメーター
userId Integer

戻り値
DeviceTestRunOptions

shouldCheck結果

public boolean shouldCheckResults ()

戻り値
boolean