use of org.robolectric.DefaultTestLifecycle in project robolectric by robolectric.
the class ShadowContentResolverTest method getProvider_shouldNotReturnAnyProviderWhenManifestIsNull.
@Test
public void getProvider_shouldNotReturnAnyProviderWhenManifestIsNull() {
Application application = new DefaultTestLifecycle().createApplication(null, null, null);
ReflectionHelpers.callInstanceMethod(application, "attach", ReflectionHelpers.ClassParameter.from(Context.class, RuntimeEnvironment.application.getBaseContext()));
assertThat(ShadowContentResolver.getProvider(Uri.parse("content://"))).isNull();
}
use of org.robolectric.DefaultTestLifecycle in project robolectric by robolectric.
the class ParallelUniverseTest method setUpApplicationState.
private void setUpApplicationState(Config defaultConfig) {
ResourceTable sdkResourceProvider = ResourceTableFactory.newFrameworkResourceTable(new ResourcePath(android.R.class, null, null));
final RoutingResourceTable routingResourceTable = new RoutingResourceTable(ResourceTableFactory.newResourceTable("org.robolectric", new ResourcePath(R.class, null, null)));
pu.setUpApplicationState(null, new DefaultTestLifecycle(), new AndroidManifest(null, null, null, "package"), defaultConfig, sdkResourceProvider, routingResourceTable, RuntimeEnvironment.getSystemResourceTable());
}
Aggregations