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(Set<String> excludeAnnotations)
テストにマークされている場合に除外するアノテーションの |
void
|
addAllExcludeFilters(Set<String> filters)
除外するテストのフィルタの |
void
|
addAllIncludeAnnotation(Set<String> annotations)
テストがマークされている場合に含めるアノテーションの |
void
|
addAllIncludeFilters(Set<String> 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()
現在トラッキングされているすべての包含フィルタを削除します。 |
Set<String>
|
getExcludeAnnotations()
除外するアノテーションの現在の |
Set<String>
|
getExcludeFilters()
除外フィルタの現在の |
File
|
getExcludeTestFile()
除外されたテストを含むファイルを返します。 |
Set<String>
|
getIncludeAnnotations()
含めるアノテーションの現在の |
Set<String>
|
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)
インクルードのテストファイルを設定します。 |
Collection<IRemoteTest>
|
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 (Set<String> excludeAnnotations)
テストにマークされている場合に除外するアノテーションの Set を追加します。
| パラメータ | |
|---|---|
excludeAnnotations |
Set |
addAllExcludeFilters
public void addAllExcludeFilters (Set<String> filters)
除外するテストのフィルタの Set を追加します。
| パラメータ | |
|---|---|
filters |
Set |
addAllIncludeAnnotation
public void addAllIncludeAnnotation (Set<String> annotations)
テストがマークされている場合に含めるアノテーションの Set を追加します。
| パラメータ | |
|---|---|
annotations |
Set |
addAllIncludeFilters
public void addAllIncludeFilters (Set<String> filters)
テストに含めるフィルタの Set を追加します。
| パラメータ | |
|---|---|
filters |
Set |
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 ()
現在トラッキングされているすべての除外フィルタを削除します。
getExcludeAnnotations
public Set<String> getExcludeAnnotations ()
除外するアノテーションの現在の Set を返します。
| 戻り値 | |
|---|---|
Set<String> |
|
getExcludeTestFile
public File getExcludeTestFile ()
除外されたテストを含むファイルを返します。
| 戻り値 | |
|---|---|
File |
|
getIncludeAnnotations
public Set<String> getIncludeAnnotations ()
含めるアノテーションの現在の Set を返します。
| 戻り値 | |
|---|---|
Set<String> |
|
getIncludeFilters
public Set<String> getIncludeFilters ()
インクルード フィルタの現在の Set を返します。
| 戻り値 | |
|---|---|
Set<String> |
|
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 |
|
run
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 |
split
public Collection<IRemoteTest> split (int shardCount)
実行しようとした shardCount も提供する split() の代替バージョン。これは、テストランナーが任意に決定できない場合に便利です。
| パラメータ | |
|---|---|
shardCount |
int: 試行されたシャード数。 |
| 戻り値 | |
|---|---|
Collection<IRemoteTest> |
個別に実行されるサブテストのコレクション。テストが現在シャード可能でない場合は null |
保護されたメソッド
setRunnerArgs
protected void setRunnerArgs (IRemoteAndroidTestRunner runner)
| パラメータ | |
|---|---|
runner |
IRemoteAndroidTestRunner |