AndroidJUnitTest
public
class
AndroidJUnitTest
extends InstrumentationTest
implements
IRuntimeHintProvider,
IShardableTest,
ITestAnnotationFilterReceiver,
ITestFileFilterReceiver,
ITestFilterReceiver
| java.lang.Object | ||
| ↳ | com.android.tradefed.testtype.InstrumentationTest | |
| ↳ | com.android.tradefed.testtype.AndroidJUnitTest | |
android.support.test.runner.AndroidJUnitRunner を使用して、指定されたデバイスでインストルメンテーション テスト パッケージを実行するテスト。
概要
定数 | |
|---|---|
String |
EXCLUDE_COLLECTOR_FILTER_KEY
|
String |
INCLUDE_COLLECTOR_FILTER_KEY
コレクタ側のヘルパー ライブラリのオプション。 |
String |
NEW_RUN_LISTENER_ORDER_KEY
デバイス側で新しい |
String |
USE_TEST_STORAGE_SERVICE
|
パブリック コンストラクタ | |
|---|---|
AndroidJUnitTest()
|
|
パブリック メソッド | |
|---|---|
void
|
addAllExcludeAnnotation(
テストにマークされている場合に除外するアノテーションの |
void
|
addAllExcludeFilters(
除外するテストのフィルタの |
void
|
addAllIncludeAnnotation(
テストにマークが付いている場合に含めるアノテーションの |
void
|
addAllIncludeFilters(
含めるテストのフィルタの |
void
|
addExcludeAnnotation(String excludeAnnotation)
テストにマークが付いている場合に除外するアノテーションを追加します。 |
void
|
addExcludeFilter(String filter)
除外するテストのフィルタを追加します。 |
void
|
addIncludeAnnotation(String annotation)
テストにアノテーションが付けられている場合に、そのアノテーションを含めるようにします。 |
void
|
addIncludeFilter(String filter)
含めるテストのフィルタを追加します。 |
void
|
clearExcludeAnnotations()
現在トラッキングされている除外アノテーションをすべて削除します。 |
void
|
clearExcludeFilters()
現在トラッキングされている除外フィルタをすべて削除します。 |
void
|
clearIncludeAnnotations()
現在トラッキングされているすべての include アノテーションを削除します。 |
void
|
clearIncludeFilters()
現在トラッキングされているすべてのインクルード フィルタを削除します。 |
|
getExcludeAnnotations()
除外するアノテーションの現在の |
|
getExcludeFilters()
除外フィルタの現在の |
File
|
getExcludeTestFile()
除外されたテストを含むファイルを返します。 |
|
getIncludeAnnotations()
含めるアノテーションの現在の |
|
getIncludeFilters()
インクルード フィルタの現在の |
File
|
getIncludeTestFile()
含まれているテストを含むファイルを返します。 |
long
|
getRuntimeHint()
テストの想定実行時間をミリ秒単位で返します。 |
boolean
|
isClassOrMethod(String filter)
文字列がクラスまたはメソッドの名前であるかどうかを返します。 |
boolean
|
isParameterizedTest(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
定数値: "exclude-filter-group"
INCLUDE_COLLECTOR_FILTER_KEY
public static final String INCLUDE_COLLECTOR_FILTER_KEY
コレクタ側のヘルパー ライブラリのオプション。
定数値: "include-filter-group"
NEW_RUN_LISTENER_ORDER_KEY
public static final String NEW_RUN_LISTENER_ORDER_KEY
デバイス側で新しい RunListener 順序を有効にするために使用されるインストルメンテーション テストランナー引数。
定数値: "newRunListenerMode"
USE_TEST_STORAGE_SERVICE
public static final String USE_TEST_STORAGE_SERVICE
定数値: "useTestStorageService"
パブリック コンストラクタ
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 |
|
isParameterizedTest
public boolean isParameterizedTest (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 |