Code example for ByteArrayInputStream

0
    assertThat(activities.size()).isEqualTo(0);
  } 
 
  @Test 
  public void canResolveDrawableGivenPackageAndResourceId() throws Exception { 
    Drawable drawable = ShadowDrawable.createFromStream(new ByteArrayInputStream(new byte[0]), "my_source");
    rpm.addDrawableResolution("com.example.foo", 4334, drawable);
    Drawable actual = rpm.getDrawable("com.example.foo", 4334, null);
    assertThat(actual).isSameAs(drawable);
  } 
 
  @Test 
  public void shouldAssignTheApplicationNameFromTheManifest() throws Exception { 
    AndroidManifest appManifest = newConfigWith("<application android:name=\"org.robolectric.TestApplication\"/>");
    rpm.addManifest(appManifest);
    ApplicationInfo applicationInfo = rpm.getApplicationInfo("org.robolectric", 0);
    assertThat(applicationInfo.name).isEqualTo("org.robolectric.TestApplication");
  } 
 
  @Test 
  public void testLaunchIntentForPackage() {