FileDocCategorySizeDatePackage
MockContentResolver.javaAPI DocAndroid 1.5 API2158Wed May 06 22:42:02 BST 2009android.test.mock

MockContentResolver

public class MockContentResolver extends android.content.ContentResolver
A mock {@link android.content.ContentResolver} class that isolates the test code from the real content system. All methods are non-functional and throw {@link java.lang.UnsupportedOperationException}.

This only isolates the test code in ways that have proven useful so far. More should be added as they become a problem.

Fields Summary
Map
mProviders
Constructors Summary
public MockContentResolver()

        super(null);
        mProviders = Maps.newHashMap();
    
Methods Summary
protected android.content.IContentProvideracquireProvider(android.content.Context context, java.lang.String name)

hide

        final ContentProvider provider = mProviders.get(name);
        if (provider != null) {
            return provider.getIContentProvider();
        } else {
            return null;
        }
    
public voidaddProvider(java.lang.String name, android.content.ContentProvider provider)

        mProviders.put(name, provider);
    
public voidnotifyChange(android.net.Uri uri, android.database.ContentObserver observer, boolean syncToNetwork)

    
public booleanreleaseProvider(android.content.IContentProvider provider)

hide

        return true;