BaseHostJUnit4Test

public abstract class BaseHostJUnit4Test
extends Object implements IAbiReceiver , ITestInformationReceiver

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


ホスト JUnit4 スタイルのテストを実行するための基本テスト クラス。このクラスは、ホスト側からインストルメンテーション テストのインストール、実行、クリーンアップをサポートします。このクラスはマルチデバイスと互換性があります。ユーティリティと基本クラスの重複を避けるために、ホスト側からインストルメンテーション テストを実行するための唯一の信頼できる情報源である必要があります。

まとめ

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

BaseHostJUnit4Test ()

パブリックメソッド

final void autoTearDown ()

インストールされているすべての APK の自動ティアダウン。

final IAbi getAbi ()
final IBuildInfo getBuild ()
final ITestDevice getDevice ()
final IInvocationContext getInvocationContext ()
final TestRunResult getLastDeviceRunResults ()

実行された最新の runDeviceTest の結果のTestRunResultを返します。

final getListDevices ()
TestInformation getTestInformation ()
boolean hasDeviceFeature (String feature)
final void installPackage ( DeviceTestRunOptions options)

DeviceTestRunOptionsに基づいて APK をデバイスにインストールします。

final void installPackage (String apkFileName, String... options)

指定された名前の APK をデバイスにインストールします。

final void installPackage ( ITestDevice device, String apkFileName, String... options)

指定された名前の APK を指定されたデバイスにインストールします。

final void installPackageAsUser ( ITestDevice device, String apkFileName, boolean grantPermission, int userId, String... options)

特定のデバイス上の特定のユーザーに対して、名前を付けた APK をインストールします。

final void installPackageAsUser (String apkFileName, boolean grantPermission, int userId, String... options)

特定のユーザーに名前を付けて APK をインストールします。

final boolean isPackageInstalled (String pkg)

指定された名前のパッケージがデバイスにインストールされているかどうかを確認します

final boolean isPackageInstalled ( ITestDevice device, String pkg)

指定された名前のパッケージがデバイスにインストールされているかどうかを確認します

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, instrumentationArgs) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, instrumentationArgs)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests (String pkgName, String testClassName, String testMethodName)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( DeviceTestRunOptions options)

DeviceTestRunOptionsの情報に基づいてインストルメンテーションを実行します。

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests (String pkgName, String testClassName, Integer userId, Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests (String pkgName, String testClassName)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests (String pkgName, String testClassName, Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners)

インストールされたインストルメンテーション パッケージを実行する方法。

final boolean runDeviceTests (String runner, String pkgName, String testClassName, String testMethodName)

インストールされたインストルメンテーション パッケージを実行する方法。

final void setAbi ( IAbi abi)
final void setTestInformation ( TestInformation testInformation)
final String uninstallPackage (String pkgName)

デバイス上のパッケージをアンインストールします。

final String uninstallPackage ( ITestDevice device, String pkgName)

デバイス上のパッケージをアンインストールします

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

BaseHostJUnit4Test

public BaseHostJUnit4Test ()

パブリックメソッド

自動ティアダウン

public final void autoTearDown ()

インストールされているすべての APK の自動ティアダウン。これにより、APK がインストールされているデバイスからすべての APK がアンインストールされます。

投げる
DeviceNotAvailableException

アビを取得

public final IAbi getAbi ()

戻り値
IAbi

getBuild

public final IBuildInfo getBuild ()

戻り値
IBuildInfo

デバイスの取得

public final ITestDevice getDevice ()

戻り値
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

戻り値
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

実行された最新の runDeviceTest の結果のTestRunResultを返します。結果が得られない場合は null。

戻り値
TestRunResult

getListDevices

public final  getListDevices ()

戻り値

テスト情報の取得

public TestInformation getTestInformation ()

戻り値
TestInformation

デバイス機能あり

public boolean hasDeviceFeature (String feature)

パラメーター
feature String

戻り値
boolean

投げる
DeviceNotAvailableException

インストールパッケージ

public final void installPackage (DeviceTestRunOptions options)

DeviceTestRunOptionsに基づいて APK をデバイスにインストールします。 APK は自動クリーニングされます。

パラメーター
options DeviceTestRunOptions : パッケージのインストールのオプション。

投げる
DeviceNotAvailableException
TargetSetupError

インストールパッケージ

public final void installPackage (String apkFileName, 
                String... options)

指定された名前の APK をデバイスにインストールします。 APK は自動クリーニングされます。

パラメーター
apkFileName String : apk ファイルの名前。

options String : インストールコマンドに指定された追加オプション

投げる
DeviceNotAvailableException
TargetSetupError

インストールパッケージ

public final void installPackage (ITestDevice device, 
                String apkFileName, 
                String... options)

指定された名前の APK を指定されたデバイスにインストールします。 APK は自動クリーニングされます。

パラメーター
device ITestDevice : APK をインストールするITestDevice

apkFileName String : apk ファイルの名前。

options String : インストールコマンドに指定された追加オプション

投げる
DeviceNotAvailableException
TargetSetupError

ユーザーとしてパッケージをインストール

public final void installPackageAsUser (ITestDevice device, 
                String apkFileName, 
                boolean grantPermission, 
                int userId, 
                String... options)

特定のデバイス上の特定のユーザーに対して、名前を付けた APK をインストールします。

パラメーター
device ITestDevice : APK をインストールするITestDevice

apkFileName String : apk ファイルの名前。

grantPermission boolean : APK のインストール時に許可フラグを渡すかどうか。

userId int : APK をインストールするユーザーのユーザー ID。

options String : インストールコマンドに指定された追加オプション

投げる
DeviceNotAvailableException
TargetSetupError

ユーザーとしてパッケージをインストール

public final void installPackageAsUser (String apkFileName, 
                boolean grantPermission, 
                int userId, 
                String... options)

特定のユーザーに名前を付けて APK をインストールします。

パラメーター
apkFileName String : apk ファイルの名前。

grantPermission boolean : APK のインストール時に許可フラグを渡すかどうか。

userId int : APK をインストールするユーザーのユーザー ID。

options String : インストールコマンドに指定された追加オプション

投げる
DeviceNotAvailableException
TargetSetupError

パッケージがインストールされています

public final boolean isPackageInstalled (String pkg)

指定された名前のパッケージがデバイスにインストールされているかどうかを確認します

パラメーター
pkg String : パッケージの名前

戻り値
booleanパッケージがデバイス上で見つかった場合は true

投げる
DeviceNotAvailableException

パッケージがインストールされています

public final boolean isPackageInstalled (ITestDevice device, 
                String pkg)

指定された名前のパッケージがデバイスにインストールされているかどうかを確認します

パラメーター
device ITestDevice : パッケージをアンインストールするデバイス。

pkg String : パッケージの名前

戻り値
booleanパッケージがデバイス上で見つかった場合は true

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

userId Integer : テストを実行するユーザーの ID。 null にすることもできます。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

maxTimeToOutputMs Long : テストが何かの出力を開始するために必要な最大タイムアウト。

maxInstrumentationTimeoutMs Long : 完全なインストルメンテーションが完了するまでに必要な最大タイムアウト。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                boolean isWindowAnimationDisabled, 
                 instrumentationArgs, 
                 extraListeners)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

runner String

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

userId Integer : テストを実行するユーザーの ID。 null にすることもできます。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

maxTimeToOutputMs Long : テストが何かの出力を開始するために必要な最大タイムアウト。

maxInstrumentationTimeoutMs Long : 完全なインストルメンテーションが完了するまでに必要な最大タイムアウト。

checkResults boolean : 結果のクラッシュがチェックされるかどうか。

isHiddenApiCheckDisabled boolean : 非表示の API チェックを無効にするかどうか。

isTestApiCheckDisabled boolean : テスト API チェックを無効にするかどうか。

isIsolatedStorageDisabled boolean : 分離ストレージを無効にするかどうか。

isWindowAnimationDisabled boolean : ウィンドウアニメーションを無効にするかどうか。

instrumentationArgs : インストルメンテーションに渡す引数。

extraListeners

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                 instrumentationArgs)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

runner String

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

userId Integer : テストを実行するユーザーの ID。 null にすることもできます。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

maxTimeToOutputMs Long : テストが何かの出力を開始するために必要な最大タイムアウト。

maxInstrumentationTimeoutMs Long : 完全なインストルメンテーションが完了するまでに必要な最大タイムアウト。

checkResults boolean : 結果のクラッシュがチェックされるかどうか。

isHiddenApiCheckDisabled boolean : 非表示の API チェックを無効にするかどうか。

instrumentationArgs : インストルメンテーションに渡す引数。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                String testMethodName)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (DeviceTestRunOptions options)

DeviceTestRunOptionsの情報に基づいてインストルメンテーションを実行します。

パラメーター
options DeviceTestRunOptions : インストルメンテーションのセットアップを制御するDeviceTestRunOptions

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                boolean isWindowAnimationDisabled, 
                boolean isRestartDisabled, 
                 instrumentationArgs, 
                 extraListeners)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

runner String

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

userId Integer : テストを実行するユーザーの ID。 null にすることもできます。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

maxTimeToOutputMs Long : テストが何かの出力を開始するために必要な最大タイムアウト。

maxInstrumentationTimeoutMs Long : 完全なインストルメンテーションが完了するまでに必要な最大タイムアウト。

checkResults boolean : 結果のクラッシュがチェックされるかどうか。

isHiddenApiCheckDisabled boolean : 非表示の API チェックを無効にするかどうか。

isTestApiCheckDisabled boolean : テスト API チェックを無効にするかどうか。

isIsolatedStorageDisabled boolean : 分離ストレージを無効にするかどうか。

isWindowAnimationDisabled boolean : ウィンドウアニメーションを無効にするかどうか。

isRestartDisabled boolean

instrumentationArgs : インストルメンテーションに渡す引数。

extraListeners

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                Integer userId, 
                Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

userId Integer : テストを実行するユーザーの ID。 null にすることもできます。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                Long testTimeoutMs)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                 instrumentationArgs, 
                 extraListeners)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
device ITestDevice : インストルメンテーションを実行するデバイス。

runner String

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

userId Integer : テストを実行するユーザーの ID。 null にすることもできます。

testTimeoutMs Long : 各テスト ケースに適用されるタイムアウト (ミリ秒)。

maxTimeToOutputMs Long : テストが何かの出力を開始するために必要な最大タイムアウト。

maxInstrumentationTimeoutMs Long : 完全なインストルメンテーションが完了するまでに必要な最大タイムアウト。

checkResults boolean : 結果のクラッシュがチェックされるかどうか。

isHiddenApiCheckDisabled boolean : 非表示の API チェックを無効にするかどうか。

isTestApiCheckDisabled boolean : テスト API チェックを無効にするかどうか。

isIsolatedStorageDisabled boolean : 分離ストレージを無効にするかどうか。

instrumentationArgs : インストルメンテーションに渡す引数。

extraListeners

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

デバイステストの実行

public final boolean runDeviceTests (String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName)

インストールされたインストルメンテーション パッケージを実行する方法。結果の詳細を取得するには、直後にgetLastDeviceRunResults()を使用します。

パラメーター
runner String : 使用されるインスツルメンテーション ランナー。

pkgName String : 実行するパッケージの名前。

testClassName String : 実行するテストクラスの名前。

testMethodName String : 実行されるクラス内のテスト メソッドの名前。

戻り値
boolean失敗せずに成功した場合は True。それ以外の場合は false。

投げる
DeviceNotAvailableException

セットアビ

public final void setAbi (IAbi abi)

パラメーター
abi IAbi

setTestInformation

public final void setTestInformation (TestInformation testInformation)

パラメーター
testInformation TestInformation

アンインストールパッケージ

public final String uninstallPackage (String pkgName)

デバイス上のパッケージをアンインストールします。

パラメーター
pkgName String : アンインストールする Android パッケージ

戻り値
Stringエラーコードを含むString 、または成功した場合はnull

投げる
DeviceNotAvailableException

アンインストールパッケージ

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

デバイス上のパッケージをアンインストールします

パラメーター
device ITestDevice : パッケージをアンインストールするデバイス。

pkgName String : アンインストールする Android パッケージ

戻り値
Stringエラーコードを含むString 、または成功した場合はnull

投げる
DeviceNotAvailableException