@Test
public void testOnError() {

    ImageView imageView = new ImageView(RuntimeEnvironment.application);
    ImageViewTarget target = new ImageViewTarget(imageView);
    target.onError(new IOException("test exc"), Mirage.Source.EXTERNAL, new MirageRequest());
    Assert.assertNull(imageView.getDrawable());
    imageView = new ImageView(RuntimeEnvironment.application);
    target = new ImageViewTarget(imageView);
    target.error(R.drawable.abc_btn_check_material);
    target.onError(new IOException("test exc"), Mirage.Source.EXTERNAL, new MirageRequest());
    // the res image drawable is now set async in imageview so this doesn't work
      Assert.assertNotNull(imageView.getDrawable());
    imageView = new ImageView(RuntimeEnvironment.application);
    target = new ImageViewTarget(imageView);
    target.error(new ColorDrawable(Color.RED));
    target.onError(new IOException("test exc"), Mirage.Source.EXTERNAL, new MirageRequest());
    Assert.assertNotNull(imageView.getDrawable());
}