Google is committed to advancing racial equity for Black communities. See how.
Added in API level 1
Deprecated in API level 5

ProviderTestCase

abstract class ProviderTestCase<T : ContentProvider!> : InstrumentationTestCase
kotlin.Any
   ↳ junit.framework.Assert
   ↳ junit.framework.TestCase
   ↳ 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
<init>(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

<init>

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

Public methods

getMockContentResolver

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

Deprecated.

getMockContext

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

Deprecated.

getProvider

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

Deprecated.

newResolverWithContentProviderFromSql

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

Deprecated.

Protected methods

setUp

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

Deprecated.

tearDown

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

Deprecated.

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