IsolatedHostTest

public class IsolatedHostTest
extends Object implements IBuildReceiver, IConfigurationReceiver, IRemoteTest, ITestAnnotationFilterReceiver, ITestCollector, ITestFilterReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.IsolatedHostTest


サブプロセスを使用して依存関係の少ないテストを実行する TradeFed ランナーを実装します。 実行するのではなく

このランナーは、構成したすべての jar が同じテスト ディレクトリにあり、 そのディレクトリでサブプロセスを起動します。アプリケーションの作業ディレクトリを 多くのテストでは、このディレクトリがテスト ディレクトリであることからメリットを得られます。これは、 判断できます。

概要

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

IsolatedHostTest()

パブリック メソッド

void addAllExcludeAnnotation( notAnnotations)

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

void addAllExcludeFilters( filters)

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

void addAllIncludeAnnotation( annotations)

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

void addAllIncludeFilters( filters)

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

void addExcludeAnnotation(String notAnnotation)

テストがマークされている場合に除外するアノテーションを追加します。

void addExcludeFilter(String filter)

除外するテストのフィルタを追加します。

void addIncludeAnnotation(String annotation)

テストがマークされている場合に、含めるアノテーションを追加します。

void addIncludeFilter(String filter)

含めるテストのフィルタを追加します。

void clearExcludeAnnotations()

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

void clearExcludeFilters()

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

void clearIncludeAnnotations()

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

void clearIncludeFilters()

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

String compileClassPath()

テストの実行に必要な JAR を含むサブプロセスのクラスパスを作成する

compileCommandArgs(String classpath, File artifactsDir)

コマンド引数を組み合わせて、サブプロセス ランナーを実行します。

void deleteTempFiles()
File getCoverageExecFile()
getExcludeAnnotations()

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

getExcludeFilters()

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

getIncludeAnnotations()

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

getIncludeFilters()

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

void run(TestInformation testInfo, ITestInvocationListener listener)

テストを実行し、結果をリスナーに報告します。

void setBuild(IBuildInfo build)

void setCollectTestsOnly(boolean shouldCollectTest)

テスト収集モードを有効または無効にします

void setConfiguration(IConfiguration configuration)

使用中の IConfiguration を注入します。

void setDebug(boolean debug)
void uploadTestArtifacts(File logDir, ITestInvocationListener listener)
boolean useRavenwoodResources()
boolean useRobolectricResources()

保護されたメソッド

String compileLdLibraryPathInner(String androidHostOut)

単体テストからこのバージョンを呼び出し、ANDROID_HOST_OUT を直接渡します。

File getJarFile(String jarName, TestInformation testInfo)

単体テストハーネスを模倣するために、HostTest からコピーされます。

void setServer(ServerSocket server)

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

IsolatedHostTest

public IsolatedHostTest ()

パブリック メソッド

addAllExcludeAnnotation

public void addAllExcludeAnnotation ( notAnnotations)

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

パラメータ
notAnnotations

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

テストがマークされている場合に除外するアノテーションを追加します。

パラメータ
notAnnotation 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 ()

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

compileClassPath

public String compileClassPath ()

テストの実行に必要な JAR を含むサブプロセスのクラスパスを作成する

戻り値
String コロンで区切られたクラスパスを指定する文字列。

compileCommandArgs

public  compileCommandArgs (String classpath, 
                File artifactsDir)

コマンド引数を組み合わせて、サブプロセス ランナーを実行します。

パラメータ
classpath String

artifactsDir File

戻り値

deleteTempFiles

public void deleteTempFiles ()

getCoverageExecFile

public File getCoverageExecFile ()

戻り値
File

getExcludeAnnotations

public  getExcludeAnnotations ()

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

戻り値

getExcludeFilters

public  getExcludeFilters ()

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

戻り値

getIncludeAnnotations

public  getIncludeAnnotations ()

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

戻り値

getIncludeFilters

public  getIncludeFilters ()

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

戻り値

ホームラン

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

テストを実行し、結果をリスナーに報告します。

パラメータ
testInfo TestInformation: 実行に役立つ情報を含む TestInformation オブジェクト テストです。

listener ITestInvocationListener: テスト結果の ITestInvocationListener

例外
DeviceNotAvailableException

setBuild

public void setBuild (IBuildInfo build)

パラメータ
build IBuildInfo

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

テスト収集モードを有効または無効にします

setConfiguration

public void setConfiguration (IConfiguration configuration)

使用中の IConfiguration を注入します。

パラメータ
configuration IConfiguration

setDebug

public void setDebug (boolean debug)

パラメータ
debug boolean

UploadTestArtifacts

public void uploadTestArtifacts (File logDir, 
                ITestInvocationListener listener)

パラメータ
logDir File

listener ITestInvocationListener

useRavenwoodResources

public boolean useRavenwoodResources ()

戻り値
boolean

useRobolectricResources

public boolean useRobolectricResources ()

戻り値
boolean

保護されたメソッド

compileLdLibraryPathInner

protected String compileLdLibraryPathInner (String androidHostOut)

単体テストからこのバージョンを呼び出し、ANDROID_HOST_OUT を直接渡します。必要なのは Java には環境変数を設定する API がないためです。

パラメータ
androidHostOut String

戻り値
String

getJarFile

protected File getJarFile (String jarName, 
                TestInformation testInfo)

単体テストハーネスを模倣するために、HostTest からコピーされます。

さまざまなユースケースで、アーティファクトが通常配置されている複数の場所を検査し、 見つけましょう。

パラメータ
jarName String

testInfo TestInformation

戻り値
File

setServer

protected void setServer (ServerSocket server)

パラメータ
server ServerSocket