package com.novoda.imageloader.acceptance;

import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.Suppress;

import com.novoda.imageloader.core.ImageManager;
import com.novoda.imageloader.core.LoaderSettings;

/**
 * Created with IntelliJ IDEA. User: friedger Date: 29.10.12 Time: 21:59 To change this template use File | Settings | File Templates.
 */
public class ImageManagerInstrumentationTest extends InstrumentationTestCase {

    public ImageManagerInstrumentationTest(String name) {
        super();
        setName(name);
    }

    @Suppress()
    // XXX No assertions so not running - gives NPE
    public void testCacheImage() {
        // Bitmap bmOriginal = BitmapFactory.decodeResource(getInstrumentation().getContext().getResources(), R.drawable.icon); // unused

        LoaderSettings settings = new LoaderSettings();

        ImageManager imageManager = new ImageManager(getInstrumentation().getTargetContext(), settings);
        imageManager.cacheImage("http://king.com/img.png", 100, 100);

    }
}

@@ -85,62 +85,8 @@
 ase;
-%0Aimport android.test.suitebuilder.annotation.Suppress;
 %0A%0Aim
@@ -520,253 +520,76 @@
     
-@Suppress()%0A    // XXX No assertions so not running - gives NPE%0A    public void testCacheImage() %7B%0A        // Bitmap bmOriginal = BitmapFactory.decodeResource(getInstrumentation().getContext().getResources(), R.drawable.icon); // unused%0A%0A       
+public void testCacheImage() %7B%0A        LoaderSettings settings = new
  Loa
@@ -603,43 +603,69 @@
 ings
- s
+.S
 ettings
- = new LoaderSettings(
+Builder().build(getInstrumentation().getContext()
 );%0A
-%0A
     
@@ -769,79 +769,184 @@
 s);%0A
-        imageManager.cacheImage(%22http://king.com/img.png%22, 100, 100
+%0A        String url = %22http://imgur.com/5FirD.png%22;%0A        imageManager.cacheImage(url, 64, 64);%0A%0A        assertTrue(imageManager.getCacheManager().get(url, 64, 64) != null
 );%0A
-%0A
     

add test to demonstrate that ImageManager.cacheImage() is broken