MockContentProviderpublic class MockContentProvider extends android.content.ContentProvider Mock implementation of ContentProvider. All methods are non-functional and throw
{@link java.lang.UnsupportedOperationException}. Tests can extend this class to
implement behavior needed for tests. |
Fields Summary |
---|
private final InversionIContentProvider | mIContentProvider |
Constructors Summary |
---|
protected MockContentProvider()A constructor using {@link MockContext} instance as a Context in it.
super(new MockContext(), "", "", null);
| public MockContentProvider(android.content.Context context)A constructor accepting a Context instance, which is supposed to be the subclasss of
{@link MockContext}.
super(context, "", "", null);
| public MockContentProvider(android.content.Context context, String readPermission, String writePermission, android.content.pm.PathPermission[] pathPermissions)A constructor which initialize four member variables which
{@link android.content.ContentProvider} have internally.
super(context, readPermission, writePermission, pathPermissions);
|
Methods Summary |
---|
public android.content.ContentProviderResult[] | applyBatch(java.util.ArrayList operations)
throw new UnsupportedOperationException("unimplemented mock method");
| public void | attachInfo(android.content.Context context, android.content.pm.ProviderInfo info)
throw new UnsupportedOperationException("unimplemented mock method");
| public int | bulkInsert(android.net.Uri uri, android.content.ContentValues[] values)If you're reluctant to implement this manually, please just call super.bulkInsert().
throw new UnsupportedOperationException("unimplemented mock method");
| public android.os.Bundle | call(java.lang.String method, java.lang.String request, android.os.Bundle args)
throw new UnsupportedOperationException("unimplemented mock method call");
| public int | delete(android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)
throw new UnsupportedOperationException("unimplemented mock method");
| public final android.content.IContentProvider | getIContentProvider()Returns IContentProvider which calls back same methods in this class.
By overriding this class, we avoid the mechanism hidden behind ContentProvider
(IPC, etc.)
return mIContentProvider;
| public java.lang.String[] | getStreamTypes(android.net.Uri url, java.lang.String mimeTypeFilter)
throw new UnsupportedOperationException("unimplemented mock method call");
| public java.lang.String | getType(android.net.Uri uri)
throw new UnsupportedOperationException("unimplemented mock method");
| public android.net.Uri | insert(android.net.Uri uri, android.content.ContentValues values)
throw new UnsupportedOperationException("unimplemented mock method");
| public boolean | onCreate()
throw new UnsupportedOperationException("unimplemented mock method");
| public android.content.res.AssetFileDescriptor | openTypedAssetFile(android.net.Uri url, java.lang.String mimeType, android.os.Bundle opts)
throw new UnsupportedOperationException("unimplemented mock method call");
| public android.database.Cursor | query(android.net.Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
throw new UnsupportedOperationException("unimplemented mock method");
| public int | update(android.net.Uri uri, android.content.ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)
throw new UnsupportedOperationException("unimplemented mock method");
|
|