Android.Test 命名空间

用于编写 Android 测试用例和套件的框架。

类

名称 说明
AssertionFailedError

断言失败时引发。

ComparisonFailure

当字符串的断言等于时引发。

FlakyTest

此批注可用于 android.test.InstrumentationTestCase测试方法。

FlakyTestAttribute

标记测试 android.test.InstrumentationTestCase 方法以便在失败时重新执行。

InstrumentationTestRunner

Instrumentation针对 Android 包(应用程序)运行各种类型的 junit.framework.TestCases。

IsolatedContext

模拟上下文,可阻止其用户与设备的其余部分通信,同时使用足够的方法来满足尝试与其他包通信的代码。

MoreAsserts

包含 JUnit 中未找到的其他断言方法。

RenamingDelegatingContext

这是委托给给定上下文的类,但使用重命名的数据库/文件名执行数据库和文件操作(为具有给定前缀的默认名称添加前缀)。

TouchUtils

用于生成触摸事件的可重用方法。

UiThreadTest

此批注可用于 InstrumentationTestCase测试方法。

UiThreadTestAttribute

标记在 android.test.InstrumentationTestCase 应用程序的主线程上运行的测试方法。

ViewAsserts

有关视图的一些有用断言。

接口

名称 说明
IFlakyTest

此批注可用于 android.test.InstrumentationTestCase测试方法。

IPerformanceTestCase

测试用例的更复杂的接口性能。

IPerformanceTestCaseIntermediates

的回调 。PerformanceTestCase

IUiThreadTest

此批注可用于 InstrumentationTestCase测试方法。

枚举

名称 说明
TestResult

枚举由多个方法 TestResult返回的值。

注解

此命名空间包括断言帮助程序、检测测试运行程序以及隔离测试的上下文。 对于新测试,请使用 AndroidX 测试 而不是弃用的 Android 测试框架。