OSDN Git Service

Implement new MockContentProvider. Also make ContentProvider aware of the class.
authorDaisuke Miyakawa <dmiyakawa@google.com>
Wed, 21 Oct 2009 23:36:42 +0000 (08:36 +0900)
committerDaisuke Miyakawa <dmiyakawa@google.com>
Fri, 4 Dec 2009 08:48:44 +0000 (17:48 +0900)
commit8280c2b15f6875b2d387c05df23d264864eb9cd5
tree509308daa0d9bd8807182788068c74bf3be8627c
parent3077f7df2eaf4127438d4337a9a25766261b02ee
Implement new MockContentProvider. Also make ContentProvider aware of the class.

Rename the old MockContentProvider to MockIContentProvider since it is
more appropriate name.

Detail:
Current developers inevitably depend on the backend used by ContentProvider,
which is useful but not ideal nor "testable" from the view of them.

Current MockContentResolver only accepts exact "ContentProvider" class, not
IContentProvider interface, since we want to hide "IContentProvider" while
the old MockContentProvider implements IContentProvider and as a result some
methods we want to hide may be exposed to the public SDK now and probably
for the future.

On the other hand, ContentProvider is not interface but an exact class
heavily depends on the internal logic and not suitable for external
developers to use for tests.

The new MockContentProvider introduces the mock implementation
for ContentProvider.
It extends ContentProvider, so "is" ContentProvider, but tries to avoid
depending on any backend System like IPC in Android, etc.
This should be useful from the view of application developers who do not
want to be confused with ContentProvider/ContentResolver backend
implementation "at all" and want to use MockContentResolver without
any other ContentProvider implementations tightly connected to the
external worlds.
api/current.xml
core/java/android/content/ContentProvider.java
test-runner/android/test/mock/MockContentProvider.java
test-runner/android/test/mock/MockIContentProvider.java [new file with mode: 0644]