android for junit,AndroidJUnitTest

AndroidJUnitTest

java.lang.Object

com.android.tradefed.testtype.AndroidJUnitTest

A Test that runs an instrumentation test package on given device using the

android.support.test.runner.AndroidJUnitRunner.

Summary

Fields

public

static

final

String

public

static

final

String

Options from the collector side helper library.

public

static

final

String

instrumentation test runner argument used to enable the new

Public constructors

Public methods

void

Adds a

void

Adds the

void

Adds a

void

Adds the

void

addExcludeAnnotation(String excludeAnnotation)

Adds an annotation to exclude if a tests if marked with it.

void

Adds a filter of which tests to exclude.

void

Adds an annotation to include if a tests if marked with it.

void

Adds a filter of which tests to include.

void

Delete all the exclude annotations currently tracked.

void

Delete all the exclude filters currently tracked.

void

Delete all the include annotations currently tracked.

void

Delete all the include filters currently tracked.

Returns the current

Returns the current

Returns the current

Returns the current

long

Return the expected runtime of the test in

milliseconds.

boolean

isClassOrMethod(String filter)

Return if a string is the name of a Class or a Method.

boolean

isRegex(String filter)

Return if a string is a regex for filter.

void

Runs the tests, and reports result to the listener.

void

Guice-injected object, that can influence the instrumentation args.

void

Sets the test file of excludes.

void

Sets the test file of includes.

split(int shardCount)

Alternative version of

Protected methods

void

setRunnerArgs(IRemoteAndroidTestRunner runner)

Fields

EXCLUDE_COLLECTOR_FILTER_KEY

public static final String EXCLUDE_COLLECTOR_FILTER_KEY

INCLUDE_COLLECTOR_FILTER_KEY

public static final String INCLUDE_COLLECTOR_FILTER_KEY

Options from the collector side helper library.

NEW_RUN_LISTENER_ORDER_KEY

public static final String NEW_RUN_LISTENER_ORDER_KEY

instrumentation test runner argument used to enable the new

Public constructors

AndroidJUnitTest

public AndroidJUnitTest ()

Public methods

addAllExcludeAnnotation

public void addAllExcludeAnnotation (excludeAnnotations)

Adds a

Parameters

excludeAnnotations

addAllExcludeFilters

public void addAllExcludeFilters (filters)

Adds the

Parameters

filters

addAllIncludeAnnotation

public void addAllIncludeAnnotation (annotations)

Adds a

Parameters

annotations

addAllIncludeFilters

public void addAllIncludeFilters (filters)

Adds the

Parameters

filters

addExcludeAnnotation

public void addExcludeAnnotation (String excludeAnnotation)

Adds an annotation to exclude if a tests if marked with it.

Parameters

excludeAnnotation

String

addExcludeFilter

public void addExcludeFilter (String filter)

Adds a filter of which tests to exclude.

Parameters

filter

String

addIncludeAnnotation

public void addIncludeAnnotation (String annotation)

Adds an annotation to include if a tests if marked with it.

Parameters

annotation

String

addIncludeFilter

public void addIncludeFilter (String filter)

Adds a filter of which tests to include.

Parameters

filter

String

clearExcludeAnnotations

public void clearExcludeAnnotations ()

Delete all the exclude annotations currently tracked.

clearExcludeFilters

public void clearExcludeFilters ()

Delete all the exclude filters currently tracked.

clearIncludeAnnotations

public void clearIncludeAnnotations ()

Delete all the include annotations currently tracked.

clearIncludeFilters

public void clearIncludeFilters ()

Delete all the include filters currently tracked.

getExcludeAnnotations

public getExcludeAnnotations ()

Returns the current

Returns

getExcludeFilters

public getExcludeFilters ()

Returns the current

Returns

getIncludeAnnotations

public getIncludeAnnotations ()

Returns the current

Returns

getIncludeFilters

public getIncludeFilters ()

Returns the current

Returns

getRuntimeHint

public long getRuntimeHint ()

Return the expected runtime of the test in

milliseconds.

The time is used to load balance sharded execution

Returns

long

isClassOrMethod

public boolean isClassOrMethod (String filter)

Return if a string is the name of a Class or a Method.

Parameters

filter

String

Returns

boolean

isRegex

public boolean isRegex (String filter)

Return if a string is a regex for filter.

Parameters

filter

String

Returns

boolean

run

public void run (ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters

listener

ITestInvocationListener: the

setDeviceSpec

public void setDeviceSpec (IConfiguration spec)

Guice-injected object, that can influence the instrumentation args.

Parameters

spec

IConfiguration

setExcludeTestFile

public void setExcludeTestFile (File testFile)

Sets the test file of excludes. Does not ensure that testFile exists or is a file.

Parameters

testFile

File

setIncludeTestFile

public void setIncludeTestFile (File testFile)

Sets the test file of includes. Does not ensure that testFile exists or is a file.

Parameters

testFile

File

split

public split (int shardCount)

Alternative version of

Parameters

shardCount

int: the attempted shard count.

Returns

a collection of subtests to be executed separately or null if test is

not currently shardable

Protected methods

setRunnerArgs

protected void setRunnerArgs (IRemoteAndroidTestRunner runner)

Parameters

runner

IRemoteAndroidTestRunner

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值