UiAutomatorTest

public class UiAutomatorTest
extends Object implements IDeviceTest, IRemoteTest, ITestFilterReceiver

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


概要

フィールド

protected Collection<ITestLifeCycleReceiver> mListeners

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

UiAutomatorTest()

パブリック メソッド

void addAllExcludeFilters(Set<String> filters)

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

void addAllIncludeFilters(Set<String> filters)

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

void addClassName(String className)

実行するテストクラス名を追加します。

void addClassNames(Collection<String> classNames)

実行するテストクラス名のコレクションを追加します。

void addExcludeFilter(String filter)

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

void addIncludeFilter(String filter)

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

void addRunArg(String key, String value)

UI Automator テストの実行時に提供する引数を追加します。

void clearExcludeFilters()

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

void clearIncludeFilters()

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

List<String> getClassNames()

ハーネスが実行するように構成されているテストクラス名のリストを取得します。

ITestDevice getDevice()

テスト対象デバイスを取得します。

Set<String> getExcludeFilters()

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

Set<String> getIncludeFilters()

現在のインクルード フィルタの Set を返します。

long getSyncTime()
List<String> getTestJarPaths()
Map<String, String> getTestRunArgMap()
IRemoteAndroidTestRunner getTestRunner()
boolean isInstrumentationTest()
void run(TestInformation testInfo, ITestInvocationListener listener)

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

void setCaptureLogs(boolean captureLogs)

このメソッドは非推奨です。代わりに setLoggingOption(LoggingOption) を使用してください。

cts-tradefed との互換性を維持するために保持

void setDevice(ITestDevice device)

テスト対象デバイスを挿入します。

void setLoggingOption(UiAutomatorTest.LoggingOption loggingOption)
void setRunName(String runName)
void setRunnerName(String runnerName)
void setSyncTime(long syncTime)
void setTestJarPaths(List<String> jarPaths)
void setTestRunArgMap(Map<String, String> runArgMap)

保護されたメソッド

IRemoteAndroidTestRunner createTestRunner()
IRunUtil getRunUtil()
void onScreenshotAndBugreport(ITestDevice device, ITestInvocationListener listener, String prefix, UiAutomatorTest.TestFailureAction overrideAction)
void onScreenshotAndBugreport(ITestDevice device, ITestInvocationListener listener, String prefix)
void preTestSetup()

UI Automator コンポーネントがデバイスに存在するかどうかを確認します。

フィールド

mListeners

protected Collection<ITestLifeCycleReceiver> mListeners

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

UiAutomatorTest

public UiAutomatorTest ()

パブリック メソッド

addAllExcludeFilters

public void addAllExcludeFilters (Set<String> filters)

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

パラメータ
filters Set

addAllIncludeFilters

public void addAllIncludeFilters (Set<String> filters)

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

パラメータ
filters Set

addClassName

public void addClassName (String className)

実行するテストクラスの名前を追加します。

パラメータ
className String

addClassNames

public void addClassNames (Collection<String> classNames)

実行するテストクラス名のコレクションを追加します。

パラメータ
classNames Collection

addExcludeFilter

public void addExcludeFilter (String filter)

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

パラメータ
filter String

addIncludeFilter

public void addIncludeFilter (String filter)

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

パラメータ
filter String

addRunArg

public void addRunArg (String key, 
                String value)

UI Automator テストの実行時に提供する引数を追加

パラメータ
key String: 引数名

value String: 引数の値

clearExcludeFilters

public void clearExcludeFilters ()

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

clearIncludeFilters

public void clearIncludeFilters ()

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

getClassNames

public List<String> getClassNames ()

ハーネスが実行するように構成されているテストクラス名のリストを取得します

戻り値
List<String> テストクラス名のリスト

getDevice

public ITestDevice getDevice ()

テスト対象デバイスを取得します。

戻り値
ITestDevice ITestDevice

getExcludeFilters

public Set<String> getExcludeFilters ()

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

戻り値
Set<String>

getIncludeFilters

public Set<String> getIncludeFilters ()

インクルード フィルタの現在の Set を返します。

戻り値
Set<String>

getSyncTime

public long getSyncTime ()

戻り値
long テストの同期に割り当てられた時間。

getTestJarPaths

public List<String> getTestJarPaths ()

戻り値
List<String> テスト jar のパス。

getTestRunArgMap

public Map<String, String> getTestRunArgMap ()

戻り値
Map<String, String> UiAutomatorRunner に渡す引数のマップ。

getTestRunner

public IRemoteAndroidTestRunner getTestRunner ()

戻り値
IRemoteAndroidTestRunner テストランナー。

isInstrumentationTest

public boolean isInstrumentationTest ()

戻り値
boolean

run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

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

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

listener ITestInvocationListener: テスト結果の ITestInvocationListener

例外
DeviceNotAvailableException

setCaptureLogs

public void setCaptureLogs (boolean captureLogs)

このメソッドは非推奨です。
代わりに setLoggingOption(LoggingOption) を使用してください。

cts-tradefed との互換性のために保持

パラメータ
captureLogs boolean

setDevice

public void setDevice (ITestDevice device)

テスト対象デバイスを挿入します。

パラメータ
device ITestDevice: 使用する ITestDevice

setLoggingOption

public void setLoggingOption (UiAutomatorTest.LoggingOption loggingOption)

パラメータ
loggingOption UiAutomatorTest.LoggingOption

setRunName

public void setRunName (String runName)

パラメータ
runName String

setRunnerName

public void setRunnerName (String runnerName)

パラメータ
runnerName String

setSyncTime

public void setSyncTime (long syncTime)

パラメータ
syncTime long: テストファイルの同期にかかる時間。

setTestJarPaths

public void setTestJarPaths (List<String> jarPaths)

パラメータ
jarPaths List: テスト jar のロケーション。

setTestRunArgMap

public void setTestRunArgMap (Map<String, String> runArgMap)

パラメータ
runArgMap Map: UiAutomatorRunner に渡す引数。

保護されたメソッド

createTestRunner

protected IRemoteAndroidTestRunner createTestRunner ()

戻り値
IRemoteAndroidTestRunner

例外
DeviceNotAvailableException

getRunUtil

protected IRunUtil getRunUtil ()

戻り値
IRunUtil

onScreenshotAndBugreport

protected void onScreenshotAndBugreport (ITestDevice device, 
                ITestInvocationListener listener, 
                String prefix, 
                UiAutomatorTest.TestFailureAction overrideAction)

パラメータ
device ITestDevice

listener ITestInvocationListener

prefix String

overrideAction UiAutomatorTest.TestFailureAction

onScreenshotAndBugreport

protected void onScreenshotAndBugreport (ITestDevice device, 
                ITestInvocationListener listener, 
                String prefix)

パラメータ
device ITestDevice

listener ITestInvocationListener

prefix String

preTestSetup

protected void preTestSetup ()

デバイスに UI Automator コンポーネントが存在するかどうかを確認します

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException