Added in API level 1
Deprecated in API level 5

ProviderTestCase


abstract class ProviderTestCase<T : ContentProvider!> : InstrumentationTestCase
kotlin.Any
   ↳ android.test.InstrumentationTestCase
   ↳ android.test.ProviderTestCase

If you would like to test a single content provider with an InstrumentationTestCase, this provides some of the boiler plate in setUp and tearDown.

Summary

Public constructors
ProviderTestCase(providerClass: Class<T>!, providerAuthority: String!)

Public methods
open MockContentResolver!

open IsolatedContext!

open T

open static ContentResolver!
newResolverWithContentProviderFromSql(targetContext: Context!, providerClass: Class<T>!, authority: String!, databaseName: String!, databaseVersion: Int, sql: String!)

Protected methods
open Unit

open Unit

Tears down the environment for the test fixture.

Inherited functions

Public constructors

ProviderTestCase

Added in API level 1
ProviderTestCase(
    providerClass: Class<T>!,
    providerAuthority: String!)

Public methods

getMockContentResolver

Added in API level 1
open fun getMockContentResolver(): MockContentResolver!

Deprecated: Deprecated in Java.

getMockContext

Added in API level 1
open fun getMockContext(): IsolatedContext!

Deprecated: Deprecated in Java.

getProvider

Added in API level 1
open fun getProvider(): T

Deprecated: Deprecated in Java.

newResolverWithContentProviderFromSql

Added in API level 1
open static fun <T : ContentProvider!> newResolverWithContentProviderFromSql(
    targetContext: Context!,
    providerClass: Class<T>!,
    authority: String!,
    databaseName: String!,
    databaseVersion: Int,
    sql: String!
): ContentResolver!

Deprecated: Deprecated in Java.

Protected methods

setUp

Added in API level 1
protected open fun setUp(): Unit

Deprecated: Deprecated in Java.

tearDown

Added in API level 1
protected open fun tearDown(): Unit

Deprecated: Deprecated in Java.

Tears down the environment for the test fixture.

Calls android.content.ContentProvider#shutdown() on the android.content.ContentProvider represented by mProvider.

Exceptions
java.lang.Exception