Build 1.0_r1(from source)

android.test.mock
Class MockContentProvider

java.lang.Object
  extended by android.test.mock.MockContentProvider
All Implemented Interfaces:
IContentProvider, IInterface

public class MockContentProvider
extends Object
implements IContentProvider

Mock implementation of IContentProvider that does nothing. All methods are non-functional and throw UnsupportedOperationException. Tests can extend this class to implement behavior needed for tests.


Field Summary
 
Fields inherited from interface android.content.IContentProvider
BULK_INSERT_TRANSACTION, DELETE_TRANSACTION, descriptor, GET_SYNC_ADAPTER_TRANSACTION, GET_TYPE_TRANSACTION, INSERT_TRANSACTION, OPEN_FILE_TRANSACTION, QUERY_TRANSACTION, UPDATE_TRANSACTION
 
Constructor Summary
MockContentProvider()
           
 
Method Summary
 IBinder asBinder()
          Retrieve the Binder object associated with this interface.
 int bulkInsert(Uri url, ContentValues[] initialValues)
           
 IBulkCursor bulkQuery(Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder, IContentObserver observer, CursorWindow window)
           
 int delete(Uri url, String selection, String[] selectionArgs)
           
 ISyncAdapter getSyncAdapter()
           
 String getType(Uri url)
           
 Uri insert(Uri url, ContentValues initialValues)
           
 ParcelFileDescriptor openFile(Uri url, String mode)
           
 Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder)
           
 int update(Uri url, ContentValues values, String selection, String[] selectionArgs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockContentProvider

public MockContentProvider()
Method Detail

bulkInsert

public int bulkInsert(Uri url,
                      ContentValues[] initialValues)
               throws RemoteException
Specified by:
bulkInsert in interface IContentProvider
Throws:
RemoteException

bulkQuery

public IBulkCursor bulkQuery(Uri url,
                             String[] projection,
                             String selection,
                             String[] selectionArgs,
                             String sortOrder,
                             IContentObserver observer,
                             CursorWindow window)
                      throws RemoteException
Specified by:
bulkQuery in interface IContentProvider
Throws:
RemoteException

delete

public int delete(Uri url,
                  String selection,
                  String[] selectionArgs)
           throws RemoteException
Specified by:
delete in interface IContentProvider
Throws:
RemoteException

getSyncAdapter

public ISyncAdapter getSyncAdapter()
                            throws RemoteException
Specified by:
getSyncAdapter in interface IContentProvider
Throws:
RemoteException

getType

public String getType(Uri url)
               throws RemoteException
Specified by:
getType in interface IContentProvider
Throws:
RemoteException

insert

public Uri insert(Uri url,
                  ContentValues initialValues)
           throws RemoteException
Specified by:
insert in interface IContentProvider
Throws:
RemoteException

openFile

public ParcelFileDescriptor openFile(Uri url,
                                     String mode)
                              throws RemoteException,
                                     FileNotFoundException
Specified by:
openFile in interface IContentProvider
Throws:
RemoteException
FileNotFoundException

query

public Cursor query(Uri url,
                    String[] projection,
                    String selection,
                    String[] selectionArgs,
                    String sortOrder)
             throws RemoteException
Specified by:
query in interface IContentProvider
Throws:
RemoteException

update

public int update(Uri url,
                  ContentValues values,
                  String selection,
                  String[] selectionArgs)
           throws RemoteException
Specified by:
update in interface IContentProvider
Throws:
RemoteException

asBinder

public IBinder asBinder()
Description copied from interface: IInterface
Retrieve the Binder object associated with this interface. You must use this instead of a plain cast, so that proxy objects can return the correct result.

Specified by:
asBinder in interface IInterface

Build 1.0_r1(from source)

Please submit a feedback, bug or feature