robolectric/robolectric — pull request #1008 by aravance (2014-03-21 16:10:05+00:00)
Title: Add support for ContentProviderClient.

Added support for ContentProviderClient.

Right now I'm using the ShadowContentProviderClient to directly attach the correct ContentProvider to the ContentProviderClient. The actual implementation uses an IContentProvider internally, but I've had some issues with NoSuchMethodError coming from contentResolver.getPackageName(), and IContentProvider methods. It seems to work correctly in the unit tests for robolectric, but when importing the SNAPSHOT to test it on a separate project, I see the errors I mentioned. All that to say, I've forgone the IContentProvider connection and attached directly to the relevant ContentProvider instance.

I'm not entirely convinced that's the absolute best way to go about this, but it's the best I've been able to come up with so far. It may be better to use the IContentProvider connection to more closely emulate the actual implementation, see above issues. It seems to be enough to use the direct connection, though. I'm open to suggestions.