AndroidJUnitTest
public class AndroidJUnitTest
extends InstrumentationTest
implements IRuntimeHintProvider , ITestFileFilterReceiver , ITestFilterReceiver , ITestAnnotationFilterReceiver , IShardableTest
java.lang.Object | ||
↳ | com.android.tradefed.testtype.InstrumentationTest | |
↳ | com.android.tradefed.testtype.AndroidJUnitTest |
android.support.test.runner.AndroidJUnitRunner を使用して、特定のデバイスで計測テスト パッケージを実行するテスト。
まとめ
田畑 | |
---|---|
public static final String | EXCLUDE_COLLECTOR_FILTER_KEY |
public static final String | INCLUDE_COLLECTOR_FILTER_KEY コレクター側のヘルパー ライブラリのオプション。 |
public static final String | NEW_RUN_LISTENER_ORDER_KEY デバイス側で新しい |
public static final String | USE_TEST_STORAGE_SERVICE
|
パブリック コンストラクター | |
---|---|
AndroidJUnitTest () |
公開メソッド | |
---|---|
void | addAllExcludeAnnotation ( excludeAnnotations) addAllExcludeAnnotation ( excludeAnnotations) テストがマークされている場合に除外する注釈の |
void | addAllExcludeFilters ( filters) addAllExcludeFilters ( filters) 除外するテストのフィルターの |
void | addAllIncludeAnnotation ( annotations) addAllIncludeAnnotation ( annotations) テストがマークされている場合に含める注釈の |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 含めるテストのフィルターの |
void | addExcludeAnnotation (String excludeAnnotation) テストがマークされている場合に除外するアノテーションを追加します。 |
void | addExcludeFilter (String filter) 除外するテストのフィルターを追加します。 |
void | addIncludeAnnotation (String annotation) テストがマークされている場合に含めるアノテーションを追加します。 |
void | addIncludeFilter (String filter) 含めるテストのフィルターを追加します。 |
void | clearExcludeAnnotations () 現在追跡されているすべての除外注釈を削除します。 |
void | clearExcludeFilters () 現在追跡されているすべての除外フィルターを削除します。 |
void | clearIncludeAnnotations () 現在追跡されているすべてのインクルード アノテーションを削除します。 |
void | clearIncludeFilters () 現在追跡されているすべての包含フィルターを削除します。 |
getExcludeAnnotations () 除外する注釈の現在の | |
getExcludeFilters () 除外フィルターの現在の | |
File | getExcludeTestFile () 除外されたテストを含むファイルを返します。 |
getIncludeAnnotations () 含める注釈の現在の | |
getIncludeFilters () インクルード フィルターの現在の | |
File | getIncludeTestFile () 含まれているテストを含むファイルを返します。 |
long | getRuntimeHint () テストの予想実行時間をミリ秒単位で返します。 |
boolean | isClassOrMethod (String filter) 文字列がクラスまたはメソッドの名前であるかどうかを返します。 |
boolean | isRegex (String filter) 文字列がフィルターの正規表現であるかどうかを返します。 |
void | run ( TestInformation testInfo, ITestInvocationListener listener) テストを実行し、結果をリスナーに報告します。 |
void | setExcludeTestFile (File testFile) 除外のテスト ファイルを設定します。 |
void | setIncludeTestFile (File testFile) インクルードのテスト ファイルを設定します。 |
split (int shardCount) 実行しようとする shardCount も提供する |
保護されたメソッド | |
---|---|
void | setRunnerArgs (IRemoteAndroidTestRunner runner)
|
田畑
EXCLUDE_COLLECTOR_FILTER_KEY
public static final String EXCLUDE_COLLECTOR_FILTER_KEY
INCLUDE_COLLECTOR_FILTER_KEY
public static final String INCLUDE_COLLECTOR_FILTER_KEY
コレクター側のヘルパー ライブラリのオプション。
NEW_RUN_LISTENER_ORDER_KEY
public static final String NEW_RUN_LISTENER_ORDER_KEY
デバイス側で新しいRunListener
オーダーを有効にするために使用されるインストルメンテーション テスト ランナー引数。
USE_TEST_STORAGE_SERVICE
public static final String USE_TEST_STORAGE_SERVICE
パブリック コンストラクター
AndroidJUnitTest
public AndroidJUnitTest ()
公開メソッド
addAllExcludeAnnotation
public void addAllExcludeAnnotation (excludeAnnotations)
テストがマークされている場合に除外する注釈のERROR(/Set)
を追加します。
パラメーター | |
---|---|
excludeAnnotations |
addAllExcludeFilters
public void addAllExcludeFilters (filters)
除外するテストのフィルターのERROR(/Set)
を追加します。
パラメーター | |
---|---|
filters |
addAllIncludeAnnotation
public void addAllIncludeAnnotation (annotations)
テストがマークされている場合に含める注釈のERROR(/Set)
を追加します。
パラメーター | |
---|---|
annotations |
addAllIncludeFilters
public void addAllIncludeFilters (filters)
含めるテストのフィルターのERROR(/Set)
を追加します。
パラメーター | |
---|---|
filters |
addExcludeAnnotation
public void addExcludeAnnotation (String excludeAnnotation)
テストがマークされている場合に除外するアノテーションを追加します。
パラメーター | |
---|---|
excludeAnnotation | String |
addExcludeFilter
public void addExcludeFilter (String filter)
除外するテストのフィルターを追加します。
パラメーター | |
---|---|
filter | String |
addIncludeAnnotation
public void addIncludeAnnotation (String annotation)
テストがマークされている場合に含めるアノテーションを追加します。
パラメーター | |
---|---|
annotation | String |
addIncludeFilter
public void addIncludeFilter (String filter)
含めるテストのフィルターを追加します。
パラメーター | |
---|---|
filter | String |
clearExcludeAnnotations
public void clearExcludeAnnotations ()
現在追跡されているすべての除外注釈を削除します。
clearExcludeFilters
public void clearExcludeFilters ()
現在追跡されているすべての除外フィルターを削除します。
clearIncludeAnnotations
public void clearIncludeAnnotations ()
現在追跡されているすべてのインクルード アノテーションを削除します。
clearIncludeFilters
public void clearIncludeFilters ()
現在追跡されているすべての包含フィルターを削除します。
getExcludeTestFile
public File getExcludeTestFile ()
除外されたテストを含むファイルを返します。
戻り値 | |
---|---|
File |
getIncludeTestFile
public File getIncludeTestFile ()
含まれているテストを含むファイルを返します。
戻り値 | |
---|---|
File |
getRuntimeHint
public long getRuntimeHint ()
テストの予想実行時間をミリ秒単位で返します。この時間は、シャード実行の負荷分散に使用されます
戻り値 | |
---|---|
long |
isClassOrMethod
public boolean isClassOrMethod (String filter)
文字列がクラスまたはメソッドの名前であるかどうかを返します。
パラメーター | |
---|---|
filter | String |
戻り値 | |
---|---|
boolean |
isRegex
public boolean isRegex (String filter)
文字列がフィルターの正規表現であるかどうかを返します。
パラメーター | |
---|---|
filter | String |
戻り値 | |
---|---|
boolean |
走る
public void run (TestInformation testInfo, ITestInvocationListener listener)
テストを実行し、結果をリスナーに報告します。
パラメーター | |
---|---|
testInfo | TestInformation : テストを実行するための有用な情報を含むTestInformation オブジェクト。 |
listener | ITestInvocationListener : テスト結果のITestInvocationListener |
スロー | |
---|---|
DeviceNotAvailableException |
setExcludeTestFile
public void setExcludeTestFile (File testFile)
除外のテスト ファイルを設定します。 testFile が存在すること、またはファイルであることを保証しません。
パラメーター | |
---|---|
testFile | File |
setIncludeTestFile
public void setIncludeTestFile (File testFile)
インクルードのテスト ファイルを設定します。 testFile が存在すること、またはファイルであることを保証しません。
パラメーター | |
---|---|
testFile | File |
スプリット
publicsplit (int shardCount)
実行しようとする shardCount も提供するsplit()
の代替バージョン。これは、時々任意に決定できないテスト ランナーに役立ちます。
パラメーター | |
---|---|
shardCount | int : 試行されたシャード数。 |
戻り値 | |
---|---|
個別に実行されるサブテストのコレクション、またはテストが現在シャード可能でない場合はnull |
保護されたメソッド
setRunnerArgs
protected void setRunnerArgs (IRemoteAndroidTestRunner runner)
パラメーター | |
---|---|
runner | IRemoteAndroidTestRunner |