Code example for ReentrantLock

Methods: newCondition

0
 
    } 
 
    private class SpiceArrayAdapterUnderTest extends SpiceArrayAdapter<DataUnderTest> {
 
        private ReentrantLock reentrantLock = new ReentrantLock();
        private Condition loadBitmapHasBeenCalledCondition = reentrantLock.newCondition();
        private boolean loadBitmapHasBeenCalled = false;
 
        public SpiceArrayAdapterUnderTest(Context context, BitmapSpiceManager spiceManagerBinary, List<DataUnderTest> data) {
            super(context, spiceManagerBinary, data);
        } 
 
        @Override 
        public BitmapRequest createRequest(DataUnderTest data, int imageIndex, int reqWidth, int reqHeight) {
            return new BitmapRequest(mockWebServer.getUrl("/" + data.getImageUrl()).toString(), reqWidth, reqHeight, cacheFile);
        } 
 
        // ---------------------------------------------------- 
        // ----- Block Test thread until drawable is refreshed. 
        // ----------------------------------------------------