BaseHostJUnit4Test

public abstract class BaseHostJUnit4Test
extends Object implements IAbiReceiver , ITestInformationReceiver

java.lang.Object
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 ()

実行された最新の runDeviceTests から得られた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 ()

公開メソッド

autoTearDown

public final void autoTearDown ()

インストールされているすべての apk の自動破棄。これにより、インストール先のデバイスからすべての apk がアンインストールされます。

スロー
DeviceNotAvailableException

getAbi

public final IAbi getAbi ()

戻り値
IAbi

getBuild

public final IBuildInfo getBuild ()

戻り値
IBuildInfo

getDevice

public final ITestDevice getDevice ()

戻り値
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

戻り値
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

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

戻り値
TestRunResult

getListDevices

public final  getListDevices ()

戻り値

getTestInformation

public TestInformation getTestInformation ()

戻り値
TestInformation

hasDeviceFeature

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

installPackageAsUser

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

installPackageAsUser

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

isPackageInstalled

public final boolean isPackageInstalled (String pkg)

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

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

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

スロー
DeviceNotAvailableException

isPackageInstalled

public final boolean isPackageInstalled (ITestDevice device, 
                String pkg)

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

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

pkg String : パッケージの名前

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

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

スロー
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (DeviceTestRunOptions options)

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

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

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

スロー
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

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

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

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

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

スロー
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

スロー
DeviceNotAvailableException

runDeviceTests

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。それ以外の場合は偽。

スロー
DeviceNotAvailableException

runDeviceTests

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

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

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

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

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

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

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

スロー
DeviceNotAvailableException

setAbi

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エラー コードを含むERROR(/String) 、または成功した場合はnull

スロー
DeviceNotAvailableException

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

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

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

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

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

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

スロー
DeviceNotAvailableException