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 を使用して、指定デバイスでインストルメンテーション テスト パッケージを実行するテスト。

概要

フィールド

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

デバイス側で新しい RunListener オーダーを有効にするために使用されるインストルメンテーション テストランナー引数。

public static final String USE_TEST_STORAGE_SERVICE

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

AndroidJUnitTest()

パブリック メソッド

void addAllExcludeAnnotation( excludeAnnotations)

テストにマークが付いている場合に除外するアノテーションの ERROR(/Set) を追加。

void addAllExcludeFilters( filters)

除外するテストのフィルタの ERROR(/Set) を追加します。

void addAllIncludeAnnotation( annotations)

テストにマークが付いている場合に含めるアノテーションの ERROR(/Set) を追加。

void addAllIncludeFilters( filters)

含めるテストのフィルタの ERROR(/Set) を追加します。

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()

除外するアノテーションの現在の ERROR(/Set) を返します。

getExcludeFilters()

除外フィルタの現在の ERROR(/Set) を返します。

File getExcludeTestFile()

除外されたテストを含むファイルを返します。

getIncludeAnnotations()

含めるアノテーションの現在の ERROR(/Set) を返します。

getIncludeFilters()

包含フィルタの現在の ERROR(/Set) を返します。

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)

split() の代替バージョン。実行が試行される 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 ()

現在トラッキングされている include アノテーションをすべて削除します。

clearIncludeFilters

public void clearIncludeFilters ()

現在トラッキングされている含めるフィルタをすべて削除します。

getExcludeAnnotations

public  getExcludeAnnotations ()

除外するアノテーションの現在の ERROR(/Set) を返します。

戻り値

getExcludeFilters

public  getExcludeFilters ()

除外フィルタの現在の ERROR(/Set) を返します。

戻り値

getExcludeTestFile

public File getExcludeTestFile ()

除外されたテストを含むファイルを返します。

戻り値
File

getIncludeAnnotations

public  getIncludeAnnotations ()

含めるアノテーションの現在の ERROR(/Set) を返します。

戻り値

getIncludeFilters

public  getIncludeFilters ()

包含フィルタの現在の ERROR(/Set) を返します。

戻り値

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

分割

public  split (int shardCount)

split() の代替バージョン。実行が試行される shardCount も提供します。これは、場合によっては任意に決定できない一部のテストランナーに便利です。

パラメータ
shardCount int: 試行されたシャードの数。

戻り値
個別に実行されるサブテストのコレクション。テストが現在シャーディング可能でない場合は null

保護されたメソッド

setRunnerArgs

protected void setRunnerArgs (IRemoteAndroidTestRunner runner)

パラメータ
runner IRemoteAndroidTestRunner