Search in sources :

Example 6 with CacheLoadingException

use of com.octo.android.robospice.persistence.exception.CacheLoadingException in project robospice by stephanenicolas.

the class InFileBitmapObjectPersisterTest method testLoadDataFromCache_expired.

public void testLoadDataFromCache_expired() throws Exception {
    testPersister.saveDataToCacheAndReturnData(TEST_BITMAP_LARGE, TEST_CACHE_KEY);
    Thread.sleep(TEST_EXPIRATION_DURATION);
    try {
        Bitmap data = testPersister.loadDataFromCache(TEST_CACHE_KEY, TEST_EXPIRATION_DURATION);
        assertNull(data);
    } catch (CacheLoadingException e) {
        fail("A cache miss should not throw exception ");
    }
}
Also used : Bitmap(android.graphics.Bitmap) CacheLoadingException(com.octo.android.robospice.persistence.exception.CacheLoadingException)

Aggregations

CacheLoadingException (com.octo.android.robospice.persistence.exception.CacheLoadingException)6 Bitmap (android.graphics.Bitmap)2 CacheCreationException (com.octo.android.robospice.persistence.exception.CacheCreationException)2 CacheSavingException (com.octo.android.robospice.persistence.exception.CacheSavingException)2 RequestListener (com.octo.android.robospice.request.listener.RequestListener)2 PendingRequestListenerWithProgressStub (com.octo.android.robospice.stub.PendingRequestListenerWithProgressStub)2 RequestListenerWithProgressStub (com.octo.android.robospice.stub.RequestListenerWithProgressStub)2 FileInputStream (java.io.FileInputStream)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 HashSet (java.util.HashSet)2 JsonParser (com.google.api.client.json.JsonParser)1 DefaultRetryPolicy (com.octo.android.robospice.retry.DefaultRetryPolicy)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileReader (java.io.FileReader)1 InputStream (java.io.InputStream)1 TypedInput (retrofit.mime.TypedInput)1