IsolatedHostTest

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

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


メイン プロセスでテストを実行する代わりに、サブプロセスを使用して依存性の低い環境でテストを実行する TradeFed ランナーを実装します。

このランナーは、構成されたすべての jar が同じテスト ディレクトリにあると想定し、そのディレクトリでサブプロセスを起動します。サブプロセス用の作業ディレクトリを選択する必要があり、多くのテストでは、そのディレクトリがテスト ディレクトリであることでメリットが得られるため、これが最善の妥協案でした。

まとめ

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

IsolatedHostTest ()

公開メソッド

void addAllExcludeAnnotation ( notAnnotations) addAllExcludeAnnotation ( notAnnotations)

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

void addAllExcludeFilters ( filters) addAllExcludeFilters ( filters)

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

void addAllIncludeAnnotation ( annotations) addAllIncludeAnnotation ( annotations)

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

void addAllIncludeFilters ( filters) 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 ()

現在追跡されているすべての包含フィルターを削除します。

compileCommandArgs (String classpath, File artifactsDir)

サブプロセスランナーを実行するためのコマンド引数を組み立てます。

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

保護されたメソッド

String compileLdLibraryPath ()

ネイティブ ライブラリを必要とするテストの場合は、LD_LIBRARY_PATH を返します。

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

現在追跡されているすべての包含フィルターを削除します。

compileCommandArgs

public  compileCommandArgs (String classpath, 
                File artifactsDir)

サブプロセスランナーを実行するためのコマンド引数を組み立てます。

パラメーター
classpath String

artifactsDir File

戻り値

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

アップロードTestArtifacts

public void uploadTestArtifacts (File logDir, 
                ITestInvocationListener listener)

パラメーター
logDir File

listener ITestInvocationListener

useRobolectricResources

public boolean useRobolectricResources ()

戻り値
boolean

保護されたメソッド

compileLdLibraryPath

protected String compileLdLibraryPath ()

ネイティブ ライブラリを必要とするテストの場合は、LD_LIBRARY_PATH を返します。

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

getJarFile

protected File getJarFile (String jarName, 
                TestInformation testInfo)

単体テストの利用を模倣するために HostTest からコピーされました。

jar を見つけるために、さまざまなユースケースでアーティファクトが通常配置されているいくつかの場所を調べます。

パラメーター
jarName String

testInfo TestInformation

戻り値
File

setServer

protected void setServer (ServerSocket server)

パラメーター
server ServerSocket