From e9b8758b63ec905d54b4cabec08e16cf588bcb38 Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Thu, 6 Jul 2023 15:29:33 -0700 Subject: [PATCH] Introduce a constant for Robolectric tests using sdk = 18. This commit replaces hardcoded instances of 'Config(sdk = 18') with a constant. The intent is to make it easier to update the value in the future when Robolectric stops supporting sdk 18. Tested via gradle test testDebugUnitTest. --- .../test/src/test/java/com/bumptech/glide/GlideTest.java | 3 ++- .../src/test/java/com/bumptech/glide/ListPreloaderTest.java | 2 +- .../test/java/com/bumptech/glide/RequestBuilderTest.java | 2 +- .../test/java/com/bumptech/glide/RequestManagerTest.java | 3 ++- .../test/java/com/bumptech/glide/RobolectricConstants.java | 6 ++++++ .../src/test/java/com/bumptech/glide/load/OptionsTest.java | 4 +++- .../bumptech/glide/load/data/ExifOrientationStreamTest.java | 3 ++- .../glide/load/data/FileDescriptorAssetPathFetcherTest.java | 3 ++- .../bumptech/glide/load/data/HttpUrlFetcherServerTest.java | 3 ++- .../com/bumptech/glide/load/data/HttpUrlFetcherTest.java | 3 ++- .../com/bumptech/glide/load/data/LocalUriFetcherTest.java | 3 ++- .../glide/load/data/StreamAssetPathFetcherTest.java | 3 ++- .../glide/load/data/mediastore/MediaStoreUtilTest.java | 3 ++- .../glide/load/data/mediastore/ThumbFetcherTest.java | 3 ++- .../load/data/mediastore/ThumbnailStreamOpenerTest.java | 3 ++- .../data/resource/FileDescriptorLocalUriFetcherTest.java | 3 ++- .../glide/load/data/resource/StreamLocalUriFetcherTest.java | 3 ++- .../java/com/bumptech/glide/load/engine/EngineJobTest.java | 3 ++- .../java/com/bumptech/glide/load/engine/EngineKeyTest.java | 3 ++- .../com/bumptech/glide/load/engine/EngineResourceTest.java | 3 ++- .../java/com/bumptech/glide/load/engine/EngineTest.java | 3 ++- .../bumptech/glide/load/engine/ResourceRecyclerTest.java | 3 ++- .../engine/bitmap_recycle/AttributeStrategyKeyTest.java | 3 ++- .../load/engine/bitmap_recycle/AttributeStrategyTest.java | 3 ++- .../load/engine/bitmap_recycle/GroupedLinkedMapTest.java | 3 ++- .../glide/load/engine/bitmap_recycle/LruArrayPoolTest.java | 3 ++- .../glide/load/engine/cache/DiskLruCacheWrapperTest.java | 3 ++- .../glide/load/engine/cache/SafeKeyGeneratorTest.java | 3 ++- .../glide/load/engine/executor/GlideExecutorTest.java | 3 ++- .../glide/load/engine/prefill/BitmapPreFillRunnerTest.java | 3 ++- .../glide/load/engine/prefill/BitmapPreFillerTest.java | 3 ++- .../bumptech/glide/load/engine/prefill/PreFillTypeTest.java | 3 ++- .../com/bumptech/glide/load/model/AssetUriLoaderTest.java | 3 ++- .../com/bumptech/glide/load/model/DataUrlLoaderTest.java | 3 ++- .../java/com/bumptech/glide/load/model/GlideUrlTest.java | 3 ++- .../java/com/bumptech/glide/load/model/LazyHeadersTest.java | 3 ++- .../glide/load/model/MultiModelLoaderFactoryTest.java | 3 ++- .../com/bumptech/glide/load/model/ResourceLoaderTest.java | 3 ++- .../com/bumptech/glide/load/model/StreamEncoderTest.java | 3 ++- .../com/bumptech/glide/load/model/StringLoaderTest.java | 3 ++- .../java/com/bumptech/glide/load/model/UriLoaderTest.java | 3 ++- .../com/bumptech/glide/load/model/UrlUriLoaderTest.java | 3 ++- .../glide/load/model/stream/BaseGlideUrlLoaderTest.java | 3 ++- .../load/resource/bitmap/BitmapDrawableResourceTest.java | 3 ++- .../resource/bitmap/BitmapDrawableTransformationTest.java | 3 ++- .../glide/load/resource/bitmap/BitmapEncoderTest.java | 3 ++- .../glide/load/resource/bitmap/BitmapResourceTest.java | 3 ++- .../load/resource/bitmap/BitmapTransformationTest.java | 3 ++- .../glide/load/resource/bitmap/CenterInsideTest.java | 3 ++- .../load/resource/bitmap/DefaultImageHeaderParserTest.java | 3 ++- .../load/resource/bitmap/DrawableTransformationTest.java | 3 ++- .../bumptech/glide/load/resource/bitmap/FitCenterTest.java | 3 ++- .../resource/bitmap/RecyclableBufferedInputStreamTest.java | 3 ++- .../glide/load/resource/drawable/DrawableResourceTest.java | 3 ++- .../glide/load/resource/gif/ByteBufferGifDecoderTest.java | 3 ++- .../glide/load/resource/gif/GifDrawableResourceTest.java | 3 ++- .../bumptech/glide/load/resource/gif/GifDrawableTest.java | 3 ++- .../load/resource/gif/GifDrawableTransformationTest.java | 3 ++- .../glide/load/resource/gif/GifFrameLoaderTest.java | 3 ++- .../load/resource/gif/GifFrameResourceDecoderTest.java | 3 ++- .../glide/load/resource/gif/StreamGifDecoderTest.java | 3 ++- .../load/resource/transcode/BitmapBytesTranscoderTest.java | 3 ++- .../resource/transcode/BitmapDrawableTranscoderTest.java | 3 ++- .../manager/DefaultConnectivityMonitorFactoryTest.java | 3 ++- .../bumptech/glide/manager/RequestManagerRetrieverTest.java | 3 ++- .../java/com/bumptech/glide/module/ManifestParserTest.java | 3 ++- .../com/bumptech/glide/request/RequestFutureTargetTest.java | 3 ++- .../java/com/bumptech/glide/request/SingleRequestTest.java | 3 ++- .../bumptech/glide/request/target/AppWidgetTargetTest.java | 3 ++- .../glide/request/target/BitmapImageViewTargetTest.java | 3 ++- .../glide/request/target/ImageViewTargetFactoryTest.java | 3 ++- .../bumptech/glide/request/target/ImageViewTargetTest.java | 3 ++- .../glide/request/target/NotificationTargetTest.java | 3 ++- .../bumptech/glide/request/target/PreloadTargetTest.java | 3 ++- .../request/transition/DrawableCrossFadeFactoryTest.java | 3 ++- .../transition/DrawableCrossFadeViewAnimationTest.java | 3 ++- .../glide/request/transition/ViewAnimationTest.java | 3 ++- .../glide/request/transition/ViewPropertyAnimationTest.java | 3 ++- .../test/java/com/bumptech/glide/resize/load/ExifTest.java | 3 ++- .../glide/signature/ApplicationVersionSignatureTest.java | 3 ++- .../java/com/bumptech/glide/util/ByteBufferUtilTest.java | 3 ++- .../bumptech/glide/util/ContentLengthInputStreamTest.java | 3 ++- .../bumptech/glide/util/FixedPreloadSizeProviderTest.java | 3 ++- .../bumptech/glide/util/ViewPreloadSizeProviderTest.java | 2 +- 84 files changed, 170 insertions(+), 83 deletions(-) create mode 100644 library/test/src/test/java/com/bumptech/glide/RobolectricConstants.java diff --git a/library/test/src/test/java/com/bumptech/glide/GlideTest.java b/library/test/src/test/java/com/bumptech/glide/GlideTest.java index e628e895f6..e174df7e7e 100644 --- a/library/test/src/test/java/com/bumptech/glide/GlideTest.java +++ b/library/test/src/test/java/com/bumptech/glide/GlideTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.request.RequestOptions.decodeTypeOf; import static com.bumptech.glide.request.RequestOptions.errorOf; import static com.bumptech.glide.request.RequestOptions.placeholderOf; @@ -94,7 +95,7 @@ @LooperMode(LEGACY) @RunWith(RobolectricTestRunner.class) @Config( - sdk = 18, + sdk = ROBOLECTRIC_SDK, shadows = { GlideTest.ShadowFileDescriptorContentResolver.class, GlideTest.ShadowMediaMetadataRetriever.class, diff --git a/library/test/src/test/java/com/bumptech/glide/ListPreloaderTest.java b/library/test/src/test/java/com/bumptech/glide/ListPreloaderTest.java index 7d1f1aacd8..b5e5f52389 100644 --- a/library/test/src/test/java/com/bumptech/glide/ListPreloaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/ListPreloaderTest.java @@ -30,7 +30,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK) public class ListPreloaderTest { @Mock private RequestBuilder request; diff --git a/library/test/src/test/java/com/bumptech/glide/RequestBuilderTest.java b/library/test/src/test/java/com/bumptech/glide/RequestBuilderTest.java index 4f076a5097..7c2e0a5446 100644 --- a/library/test/src/test/java/com/bumptech/glide/RequestBuilderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/RequestBuilderTest.java @@ -40,7 +40,7 @@ @SuppressWarnings("unchecked") @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK) public class RequestBuilderTest { @Rule public TearDownGlide tearDownGlide = new TearDownGlide(); diff --git a/library/test/src/test/java/com/bumptech/glide/RequestManagerTest.java b/library/test/src/test/java/com/bumptech/glide/RequestManagerTest.java index 8c2f2e7233..b1bf1dd9c3 100644 --- a/library/test/src/test/java/com/bumptech/glide/RequestManagerTest.java +++ b/library/test/src/test/java/com/bumptech/glide/RequestManagerTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.BackgroundUtil.testInBackground; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -42,7 +43,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class RequestManagerTest { @Rule public TearDownGlide tearDownGlide = new TearDownGlide(); diff --git a/library/test/src/test/java/com/bumptech/glide/RobolectricConstants.java b/library/test/src/test/java/com/bumptech/glide/RobolectricConstants.java new file mode 100644 index 0000000000..e517951598 --- /dev/null +++ b/library/test/src/test/java/com/bumptech/glide/RobolectricConstants.java @@ -0,0 +1,6 @@ +package com.bumptech.glide; + +public class RobolectricConstants { + /** The default SDK used for Robolectric tests */ + public static final int ROBOLECTRIC_SDK = 18; +} diff --git a/library/test/src/test/java/com/bumptech/glide/load/OptionsTest.java b/library/test/src/test/java/com/bumptech/glide/load/OptionsTest.java index cf96d4bb28..85419ff5ce 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/OptionsTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/OptionsTest.java @@ -1,5 +1,7 @@ package com.bumptech.glide.load; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; + import androidx.annotation.NonNull; import com.bumptech.glide.load.Option.CacheKeyUpdater; import com.bumptech.glide.tests.KeyTester; @@ -12,7 +14,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class OptionsTest { @Rule public final KeyTester keyTester = new KeyTester(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/ExifOrientationStreamTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/ExifOrientationStreamTest.java index 1183068070..36cdb2baad 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/ExifOrientationStreamTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/ExifOrientationStreamTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool; @@ -15,7 +16,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ExifOrientationStreamTest { private ArrayPool byteArrayPool; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/FileDescriptorAssetPathFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/FileDescriptorAssetPathFetcherTest.java index 8939938d9c..4b19156135 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/FileDescriptorAssetPathFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/FileDescriptorAssetPathFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class FileDescriptorAssetPathFetcherTest { @Mock private AssetManager assetManager; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherServerTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherServerTest.java index bf5ff27fe7..4366e6144b 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherServerTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherServerTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.mock; @@ -36,7 +37,7 @@ * com.bumptech.glide.load.data.HttpUrlFetcherTest}, response handling should go here. */ @RunWith(RobolectricTestRunner.class) -@Config(manifest = Config.NONE, sdk = 18) +@Config(manifest = Config.NONE, sdk = ROBOLECTRIC_SDK) public class HttpUrlFetcherServerTest { private static final String DEFAULT_PATH = "/fakepath"; private static final int TIMEOUT_TIME_MS = 300; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherTest.java index 28c95e6893..8922fc6426 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/HttpUrlFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doThrow; @@ -30,7 +31,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class HttpUrlFetcherTest { @Mock private HttpURLConnection urlConnection; @Mock private HttpUrlFetcher.HttpUrlConnectionFactory connectionFactory; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/LocalUriFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/LocalUriFetcherTest.java index ea33c89f1f..01557e7746 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/LocalUriFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/LocalUriFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -23,7 +24,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class LocalUriFetcherTest { private TestLocalUriFetcher fetcher; @Mock private DataFetcher.DataCallback callback; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/StreamAssetPathFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/StreamAssetPathFetcherTest.java index 36acc7e96c..23fe4d38c1 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/StreamAssetPathFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/StreamAssetPathFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class StreamAssetPathFetcherTest { @Mock private AssetManager assetManager; @Mock private InputStream expected; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/MediaStoreUtilTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/MediaStoreUtilTest.java index 6c84f79ac6..d741fa920e 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/MediaStoreUtilTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/MediaStoreUtilTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data.mediastore; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import android.net.Uri; @@ -10,7 +11,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class MediaStoreUtilTest { @Test diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbFetcherTest.java index 1c447b9a4e..eac904eb5e 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data.mediastore; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -19,7 +20,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ThumbFetcherTest { @Mock private ThumbnailStreamOpener opener; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbnailStreamOpenerTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbnailStreamOpenerTest.java index 498359e686..bdda77a451 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbnailStreamOpenerTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/mediastore/ThumbnailStreamOpenerTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data.mediastore; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -36,7 +37,7 @@ import org.robolectric.fakes.RoboCursor; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ThumbnailStreamOpenerTest { private Harness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/resource/FileDescriptorLocalUriFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/resource/FileDescriptorLocalUriFetcherTest.java index ea32cd4376..af597f4b8e 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/resource/FileDescriptorLocalUriFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/resource/FileDescriptorLocalUriFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data.resource; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.mock; @@ -28,7 +29,7 @@ @RunWith(RobolectricTestRunner.class) @Config( - sdk = 18, + sdk = ROBOLECTRIC_SDK, shadows = {ContentResolverShadow.class}) public class FileDescriptorLocalUriFetcherTest { diff --git a/library/test/src/test/java/com/bumptech/glide/load/data/resource/StreamLocalUriFetcherTest.java b/library/test/src/test/java/com/bumptech/glide/load/data/resource/StreamLocalUriFetcherTest.java index 83c651c1c6..577a37d080 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/data/resource/StreamLocalUriFetcherTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/data/resource/StreamLocalUriFetcherTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.data.resource; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.verify; @@ -26,7 +27,7 @@ @RunWith(RobolectricTestRunner.class) @Config( - sdk = 18, + sdk = ROBOLECTRIC_SDK, shadows = {ContentResolverShadow.class}) public class StreamLocalUriFetcherTest { @Mock private DataFetcher.DataCallback callback; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineJobTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineJobTest.java index ff8f49fe2f..9229d600e9 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineJobTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineJobTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.anyResource; import static com.bumptech.glide.tests.Util.isADataSource; import static com.bumptech.glide.tests.Util.mockResource; @@ -41,7 +42,7 @@ import org.robolectric.shadows.ShadowLooper; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class EngineJobTest { private EngineJobHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineKeyTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineKeyTest.java index 6ea803c99c..6d82835e50 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineKeyTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineKeyTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertThrows; import androidx.annotation.NonNull; @@ -23,7 +24,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class EngineKeyTest { @Mock private Transformation transformation; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineResourceTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineResourceTest.java index d53bd8135f..660f66fac6 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineResourceTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineResourceTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.mockResource; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -21,7 +22,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class EngineResourceTest { private EngineResource engineResource; @Mock private EngineResource.ResourceListener listener; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineTest.java index 86068be361..78f89e2bd6 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/EngineTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/EngineTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.anyResource; import static com.bumptech.glide.tests.Util.isADataSource; import static com.bumptech.glide.tests.Util.mockResource; @@ -44,7 +45,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) @SuppressWarnings("unchecked") public class EngineTest { private EngineTestHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/ResourceRecyclerTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/ResourceRecyclerTest.java index dbae4380c7..94767b4d8e 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/ResourceRecyclerTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/ResourceRecyclerTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.mockResource; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.never; @@ -16,7 +17,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ResourceRecyclerTest { private ResourceRecycler recycler; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyKeyTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyKeyTest.java index d4f1a824d5..e537a7cf3c 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyKeyTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyKeyTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.bitmap_recycle; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.mockito.ArgumentMatchers.eq; @@ -16,7 +17,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class AttributeStrategyKeyTest { private AttributeStrategy.KeyPool keyPool; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyTest.java index d2337f51e3..47fbb9bb7b 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategyTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.bitmap_recycle; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -11,7 +12,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class AttributeStrategyTest { private AttributeStrategy strategy; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/GroupedLinkedMapTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/GroupedLinkedMapTest.java index a877778aeb..8438edf0a3 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/GroupedLinkedMapTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/GroupedLinkedMapTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.bitmap_recycle; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertNull; @@ -10,7 +11,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GroupedLinkedMapTest { private GroupedLinkedMap map; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/LruArrayPoolTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/LruArrayPoolTest.java index 6df26cc5e6..70cd10fe5a 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/LruArrayPoolTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/bitmap_recycle/LruArrayPoolTest.java @@ -4,6 +4,7 @@ import static android.content.ComponentCallbacks2.TRIM_MEMORY_COMPLETE; import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL; import static android.content.ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -19,7 +20,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class LruArrayPoolTest { private static final int MAX_SIZE = 10; private static final int MAX_PUT_SIZE = MAX_SIZE / 2; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/cache/DiskLruCacheWrapperTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/cache/DiskLruCacheWrapperTest.java index 0dc500cef6..269fecc8c1 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/cache/DiskLruCacheWrapperTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/cache/DiskLruCacheWrapperTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.cache; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; @@ -21,7 +22,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DiskLruCacheWrapperTest { private DiskCache cache; private byte[] data; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/cache/SafeKeyGeneratorTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/cache/SafeKeyGeneratorTest.java index 0510e3e62d..29e7ffbdc8 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/cache/SafeKeyGeneratorTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/cache/SafeKeyGeneratorTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.cache; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertTrue; import androidx.annotation.NonNull; @@ -14,7 +15,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class SafeKeyGeneratorTest { private SafeKeyGenerator keyGenerator; private int nextId; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/executor/GlideExecutorTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/executor/GlideExecutorTest.java index 8d4f0736bf..17f376685d 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/executor/GlideExecutorTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/executor/GlideExecutorTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.executor; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import androidx.annotation.NonNull; @@ -14,7 +15,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GlideExecutorTest { @Test diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillRunnerTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillRunnerTest.java index 2e5a0cb770..b57c607d17 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillRunnerTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillRunnerTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.prefill; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.anyResource; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertNotEquals; @@ -43,7 +44,7 @@ import org.robolectric.shadows.ShadowLog; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapPreFillRunnerTest { @Mock private BitmapPreFillRunner.Clock clock; @Mock private BitmapPool pool; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillerTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillerTest.java index 10722901aa..c1382a009e 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillerTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/BitmapPreFillerTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.prefill; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -30,7 +31,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapPreFillerTest { private static final int DEFAULT_BITMAP_WIDTH = 100; private static final int DEFAULT_BITMAP_HEIGHT = 50; diff --git a/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/PreFillTypeTest.java b/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/PreFillTypeTest.java index f3e6acb4de..023094a85d 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/PreFillTypeTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/engine/prefill/PreFillTypeTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.engine.prefill; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import android.graphics.Bitmap; @@ -10,7 +11,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class PreFillTypeTest { @Test(expected = IllegalArgumentException.class) diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/AssetUriLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/AssetUriLoaderTest.java index 9f57b3c7ba..57e1f5b38a 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/AssetUriLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/AssetUriLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; @@ -21,7 +22,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class AssetUriLoaderTest { private static final int IMAGE_SIDE = 10; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/DataUrlLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/DataUrlLoaderTest.java index 7c2678d43a..8ea708e9b7 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/DataUrlLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/DataUrlLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -26,7 +27,7 @@ /** Tests for the {@link DataUrlLoader} class. */ @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DataUrlLoaderTest { // A valid base64-encoded PNG (a small "Google" logo). diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/GlideUrlTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/GlideUrlTest.java index 12892f9c4a..52f1547333 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/GlideUrlTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/GlideUrlTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; @@ -13,7 +14,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GlideUrlTest { @Test(expected = NullPointerException.class) diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/LazyHeadersTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/LazyHeadersTest.java index db2de337f7..c58dc0d411 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/LazyHeadersTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/LazyHeadersTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -16,7 +17,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class LazyHeadersTest { private static final String DEFAULT_USER_AGENT = "default_user_agent"; private static final String DEFAULT_USER_AGENT_PROPERTY = "http.agent"; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/MultiModelLoaderFactoryTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/MultiModelLoaderFactoryTest.java index e2fa7f4c2f..605cab562e 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/MultiModelLoaderFactoryTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/MultiModelLoaderFactoryTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; import static org.mockito.ArgumentMatchers.eq; @@ -26,7 +27,7 @@ // containsExactly produces a spurious warning. @SuppressWarnings("ResultOfMethodCallIgnored") @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class MultiModelLoaderFactoryTest { @Mock private ModelLoaderFactory firstFactory; @Mock private ModelLoader firstModelLoader; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java index e66f86bc6f..1bda30e238 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/ResourceLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -26,7 +27,7 @@ /** Tests for the {@link com.bumptech.glide.load.model.ResourceLoader} class. */ @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ResourceLoaderTest { @Mock private ModelLoader uriLoader; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/StreamEncoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/StreamEncoderTest.java index 8185adaece..b34c4bcb27 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/StreamEncoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/StreamEncoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import androidx.test.core.app.ApplicationProvider; @@ -17,7 +18,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class StreamEncoderTest { private StreamEncoder encoder; private File file; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/StringLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/StringLoaderTest.java index 9122f98f66..831500a924 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/StringLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/StringLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -26,7 +27,7 @@ /** Tests for the {@link com.bumptech.glide.load.model.StringLoader} class. */ @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class StringLoaderTest { // Not a magic number, just an arbitrary non zero value. private static final int IMAGE_SIDE = 100; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/UriLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/UriLoaderTest.java index 3766c6dba2..daa1e51cc9 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/UriLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/UriLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; @@ -21,7 +22,7 @@ /** Tests for the {@link UriLoader} class. */ @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class UriLoaderTest { // Not a magic number, just arbitrary non zero. private static final int IMAGE_SIDE = 120; diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/UrlUriLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/UrlUriLoaderTest.java index 1c2db6f1f8..f8af156398 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/UrlUriLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/UrlUriLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; @@ -17,7 +18,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class UrlUriLoaderTest { private static final int IMAGE_SIDE = 100; private static final Options OPTIONS = new Options(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/model/stream/BaseGlideUrlLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/model/stream/BaseGlideUrlLoaderTest.java index b51bcfaf66..7ff18aa9cc 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/model/stream/BaseGlideUrlLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/model/stream/BaseGlideUrlLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.model.stream; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.any; @@ -29,7 +30,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BaseGlideUrlLoaderTest { @Mock private ModelCache modelCache; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableResourceTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableResourceTest.java index 3da1166694..ff7597035d 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableResourceTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableResourceTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; import static org.mockito.ArgumentMatchers.eq; @@ -17,7 +18,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapDrawableResourceTest { private BitmapDrawableResourceHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableTransformationTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableTransformationTest.java index c2397235ab..58cc355771 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableTransformationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapDrawableTransformationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.anyContext; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -37,7 +38,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) @SuppressWarnings("deprecation") public class BitmapDrawableTransformationTest { @Rule public final KeyTester keyTester = new KeyTester(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java index 6eeb0e5c70..cead09fb7b 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapEncoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.mockResource; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; @@ -26,7 +27,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapEncoderTest { private EncoderHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapResourceTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapResourceTest.java index 9ce34dd7a8..da38169052 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapResourceTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapResourceTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -18,7 +19,7 @@ // TODO: add a test for bitmap size using getAllocationByteSize when robolectric supports kitkat. @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapResourceTest { private int currentBuildVersion; private BitmapResourceHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapTransformationTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapTransformationTest.java index 7ea1d86a63..fd2cc43966 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapTransformationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/BitmapTransformationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; @@ -26,7 +27,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapTransformationTest { @Mock private BitmapPool bitmapPool; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/CenterInsideTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/CenterInsideTest.java index 327360d3f0..9dfe1e2f11 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/CenterInsideTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/CenterInsideTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.mockito.ArgumentMatchers.any; @@ -32,7 +33,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class CenterInsideTest { @Rule public final KeyTester keyTester = new KeyTester(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DefaultImageHeaderParserTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DefaultImageHeaderParserTest.java index 302c3f903c..41daf87fa0 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DefaultImageHeaderParserTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DefaultImageHeaderParserTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -23,7 +24,7 @@ import org.robolectric.util.Util; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DefaultImageHeaderParserTest { private static final byte[] PNG_HEADER_WITH_IHDR_CHUNK = diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DrawableTransformationTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DrawableTransformationTest.java index c894273e77..5aeab4e09b 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DrawableTransformationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/DrawableTransformationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -39,7 +40,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DrawableTransformationTest { @Rule public final KeyTester keyTester = new KeyTester(); @Mock private Transformation bitmapTransformation; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/FitCenterTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/FitCenterTest.java index 7417052145..f49de5ae6b 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/FitCenterTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/FitCenterTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; @@ -31,7 +32,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class FitCenterTest { @Rule public final KeyTester keyTester = new KeyTester(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStreamTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStreamTest.java index 659d681160..18315758b5 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStreamTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStreamTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.bitmap; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doThrow; @@ -22,7 +23,7 @@ // Not required in tests. @SuppressWarnings("ResultOfMethodCallIgnored") @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class RecyclableBufferedInputStreamTest { private static final int DATA_SIZE = 30; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/drawable/DrawableResourceTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/drawable/DrawableResourceTest.java index e1826ce95c..c312e0d234 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/drawable/DrawableResourceTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/drawable/DrawableResourceTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.drawable; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertNotEquals; import static org.mockito.Mockito.mock; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DrawableResourceTest { private TestDrawable drawable; private DrawableResource resource; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/ByteBufferGifDecoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/ByteBufferGifDecoderTest.java index 10b81999f9..9d5b413713 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/ByteBufferGifDecoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/ByteBufferGifDecoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; @@ -32,7 +33,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ByteBufferGifDecoderTest { private static final byte[] GIF_HEADER = new byte[] {0x47, 0x49, 0x46}; private static final int ARRAY_POOL_SIZE_BYTES = 4 * 1024 * 1024; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableResourceTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableResourceTest.java index b72af39106..c2b3a102b6 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableResourceTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableResourceTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; @@ -13,7 +14,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GifDrawableResourceTest { private GifDrawable drawable; private GifDrawableResource resource; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTest.java index 1aee6a7dfb..015cc786e3 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -48,7 +49,7 @@ import org.robolectric.shadows.ShadowCanvas; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GifDrawableTest { @Rule public final TearDownGlide tearDownGlide = new TearDownGlide(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTransformationTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTransformationTest.java index 33047862e6..b81e6c1f9c 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTransformationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifDrawableTransformationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.mockResource; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -34,7 +35,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GifDrawableTransformationTest { @Rule public final KeyTester keyTester = new KeyTester(); @Mock private Transformation wrapped; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameLoaderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameLoaderTest.java index b7e359d2c2..dc9faf286a 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameLoaderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameLoaderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -46,7 +47,7 @@ @LooperMode(LEGACY) @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GifFrameLoaderTest { @Rule public TearDownGlide tearDownGlide = new TearDownGlide(); diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameResourceDecoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameResourceDecoderTest.java index e9fa2d914e..ab1cb63425 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameResourceDecoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/GifFrameResourceDecoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.Mockito.mock; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class GifFrameResourceDecoderTest { private GifDecoder gifDecoder; private GifFrameResourceDecoder resourceDecoder; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/StreamGifDecoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/StreamGifDecoderTest.java index 75182fbbd8..5ba3cddf96 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/gif/StreamGifDecoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/gif/StreamGifDecoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.gif; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import com.bumptech.glide.load.ImageHeaderParser; @@ -21,7 +22,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class StreamGifDecoderTest { private static final byte[] GIF_HEADER = new byte[] {0x47, 0x49, 0x46}; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapBytesTranscoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapBytesTranscoderTest.java index d180f61967..e8076411c0 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapBytesTranscoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapBytesTranscoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.transcode; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.mockResource; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.verify; @@ -17,7 +18,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapBytesTranscoderTest { private BitmapBytesTranscoderHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapDrawableTranscoderTest.java b/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapDrawableTranscoderTest.java index feb8f31a1e..eb70c89912 100644 --- a/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapDrawableTranscoderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/load/resource/transcode/BitmapDrawableTranscoderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.load.resource.transcode; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.mockResource; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; @@ -16,7 +17,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapDrawableTranscoderTest { private BitmapDrawableTranscoder transcoder; diff --git a/library/test/src/test/java/com/bumptech/glide/manager/DefaultConnectivityMonitorFactoryTest.java b/library/test/src/test/java/com/bumptech/glide/manager/DefaultConnectivityMonitorFactoryTest.java index 8862294b1c..3d1a7b58a2 100644 --- a/library/test/src/test/java/com/bumptech/glide/manager/DefaultConnectivityMonitorFactoryTest.java +++ b/library/test/src/test/java/com/bumptech/glide/manager/DefaultConnectivityMonitorFactoryTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.manager; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.mock; import static org.robolectric.Shadows.shadowOf; @@ -13,7 +14,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DefaultConnectivityMonitorFactoryTest { private ConnectivityMonitorFactory factory; diff --git a/library/test/src/test/java/com/bumptech/glide/manager/RequestManagerRetrieverTest.java b/library/test/src/test/java/com/bumptech/glide/manager/RequestManagerRetrieverTest.java index 2b181eaf2b..4e56768051 100644 --- a/library/test/src/test/java/com/bumptech/glide/manager/RequestManagerRetrieverTest.java +++ b/library/test/src/test/java/com/bumptech/glide/manager/RequestManagerRetrieverTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.manager; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.BackgroundUtil.testInBackground; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; @@ -43,7 +44,7 @@ @LooperMode(LEGACY) @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class RequestManagerRetrieverTest { @Rule public TearDownGlide tearDownGlide = new TearDownGlide(); diff --git a/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java b/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java index c4ecf72f98..1c769fb9ff 100644 --- a/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java +++ b/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.module; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; @@ -27,7 +28,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) @SuppressWarnings("deprecation") public class ManifestParserTest { private static final String MODULE_VALUE = "GlideModule"; diff --git a/library/test/src/test/java/com/bumptech/glide/request/RequestFutureTargetTest.java b/library/test/src/test/java/com/bumptech/glide/request/RequestFutureTargetTest.java index 09bf8f98b7..cfc1dc87d6 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/RequestFutureTargetTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/RequestFutureTargetTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -27,7 +28,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class RequestFutureTargetTest { private int width; private int height; diff --git a/library/test/src/test/java/com/bumptech/glide/request/SingleRequestTest.java b/library/test/src/test/java/com/bumptech/glide/request/SingleRequestTest.java index 9a34fae7d1..2376cc13f1 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/SingleRequestTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/SingleRequestTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.bumptech.glide.tests.Util.isADataSource; import static com.bumptech.glide.tests.Util.mockResource; import static com.google.common.truth.Truth.assertThat; @@ -59,7 +60,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) @SuppressWarnings("rawtypes") public class SingleRequestTest { diff --git a/library/test/src/test/java/com/bumptech/glide/request/target/AppWidgetTargetTest.java b/library/test/src/test/java/com/bumptech/glide/request/target/AppWidgetTargetTest.java index b804580c5f..0cc279f44c 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/target/AppWidgetTargetTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/target/AppWidgetTargetTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.target; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; @@ -22,7 +23,7 @@ import org.robolectric.shadows.ShadowAppWidgetManager; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18, shadows = AppWidgetTargetTest.UpdateShadowAppWidgetManager.class) +@Config(sdk = ROBOLECTRIC_SDK, shadows = AppWidgetTargetTest.UpdateShadowAppWidgetManager.class) public class AppWidgetTargetTest { private UpdateShadowAppWidgetManager shadowManager; private RemoteViews views; diff --git a/library/test/src/test/java/com/bumptech/glide/request/target/BitmapImageViewTargetTest.java b/library/test/src/test/java/com/bumptech/glide/request/target/BitmapImageViewTargetTest.java index e33f184b71..12bba565da 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/target/BitmapImageViewTargetTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/target/BitmapImageViewTargetTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.target; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import android.graphics.Bitmap; @@ -13,7 +14,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class BitmapImageViewTargetTest { private ImageView view; diff --git a/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetFactoryTest.java b/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetFactoryTest.java index 3706e84c9e..d7a32d94d5 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetFactoryTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetFactoryTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.target; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import android.graphics.Bitmap; @@ -16,7 +17,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ImageViewTargetFactoryTest { private ImageViewTargetFactory factory; private ImageView view; diff --git a/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetTest.java b/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetTest.java index b5d287410e..a5b1f956bf 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/target/ImageViewTargetTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.target; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -29,7 +30,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ImageViewTargetTest { @Mock private AnimatedDrawable animatedDrawable; diff --git a/library/test/src/test/java/com/bumptech/glide/request/target/NotificationTargetTest.java b/library/test/src/test/java/com/bumptech/glide/request/target/NotificationTargetTest.java index b7e8bebc2b..dacb283bd6 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/target/NotificationTargetTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/target/NotificationTargetTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.target; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -22,7 +23,7 @@ import org.robolectric.shadows.ShadowNotificationManager; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18, shadows = NotificationTargetTest.UpdateShadowNotificationManager.class) +@Config(sdk = ROBOLECTRIC_SDK, shadows = NotificationTargetTest.UpdateShadowNotificationManager.class) public class NotificationTargetTest { private UpdateShadowNotificationManager shadowManager; private RemoteViews remoteViews; diff --git a/library/test/src/test/java/com/bumptech/glide/request/target/PreloadTargetTest.java b/library/test/src/test/java/com/bumptech/glide/request/target/PreloadTargetTest.java index 63cacaca87..cf94ccdbca 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/target/PreloadTargetTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/target/PreloadTargetTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.target; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -19,7 +20,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class PreloadTargetTest { @Mock private RequestManager requestManager; diff --git a/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeFactoryTest.java b/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeFactoryTest.java index 8ded2f2533..d6a2a1cbe0 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeFactoryTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeFactoryTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.transition; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -12,7 +13,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DrawableCrossFadeFactoryTest { private DrawableCrossFadeFactory factory; diff --git a/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeViewAnimationTest.java b/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeViewAnimationTest.java index 618f903e42..267342b6fe 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeViewAnimationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/transition/DrawableCrossFadeViewAnimationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.transition; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class DrawableCrossFadeViewAnimationTest { private CrossFadeHarness harness; diff --git a/library/test/src/test/java/com/bumptech/glide/request/transition/ViewAnimationTest.java b/library/test/src/test/java/com/bumptech/glide/request/transition/ViewAnimationTest.java index b195948f44..406e6fd3ff 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/transition/ViewAnimationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/transition/ViewAnimationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.transition; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertFalse; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ViewAnimationTest { private ViewTransition viewAnimation; private ViewAdapter adapter; diff --git a/library/test/src/test/java/com/bumptech/glide/request/transition/ViewPropertyAnimationTest.java b/library/test/src/test/java/com/bumptech/glide/request/transition/ViewPropertyAnimationTest.java index 1e29959884..b3c623f8fd 100644 --- a/library/test/src/test/java/com/bumptech/glide/request/transition/ViewPropertyAnimationTest.java +++ b/library/test/src/test/java/com/bumptech/glide/request/transition/ViewPropertyAnimationTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request.transition; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertFalse; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -19,7 +20,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ViewPropertyAnimationTest { private ViewPropertyTransition.Animator animator; private ViewPropertyTransition animation; diff --git a/library/test/src/test/java/com/bumptech/glide/resize/load/ExifTest.java b/library/test/src/test/java/com/bumptech/glide/resize/load/ExifTest.java index 5d0a4cb654..e9af7ec545 100644 --- a/library/test/src/test/java/com/bumptech/glide/resize/load/ExifTest.java +++ b/library/test/src/test/java/com/bumptech/glide/resize/load/ExifTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.resize.load; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; @@ -16,7 +17,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ExifTest { private ArrayPool byteArrayPool; diff --git a/library/test/src/test/java/com/bumptech/glide/signature/ApplicationVersionSignatureTest.java b/library/test/src/test/java/com/bumptech/glide/signature/ApplicationVersionSignatureTest.java index 1b3d926572..c78dd0be82 100644 --- a/library/test/src/test/java/com/bumptech/glide/signature/ApplicationVersionSignatureTest.java +++ b/library/test/src/test/java/com/bumptech/glide/signature/ApplicationVersionSignatureTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.signature; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -21,7 +22,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ApplicationVersionSignatureTest { @Rule public final KeyTester keyTester = new KeyTester(); private Context context; diff --git a/library/test/src/test/java/com/bumptech/glide/util/ByteBufferUtilTest.java b/library/test/src/test/java/com/bumptech/glide/util/ByteBufferUtilTest.java index 1b8c93665b..ff72ba5933 100644 --- a/library/test/src/test/java/com/bumptech/glide/util/ByteBufferUtilTest.java +++ b/library/test/src/test/java/com/bumptech/glide/util/ByteBufferUtilTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.util; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static org.junit.Assert.assertEquals; import java.io.ByteArrayInputStream; @@ -12,7 +13,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ByteBufferUtilTest { private static final int BUFFER_SIZE = 16384; diff --git a/library/test/src/test/java/com/bumptech/glide/util/ContentLengthInputStreamTest.java b/library/test/src/test/java/com/bumptech/glide/util/ContentLengthInputStreamTest.java index 24bfcb60e6..1d943355e2 100644 --- a/library/test/src/test/java/com/bumptech/glide/util/ContentLengthInputStreamTest.java +++ b/library/test/src/test/java/com/bumptech/glide/util/ContentLengthInputStreamTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.util; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; @@ -18,7 +19,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class ContentLengthInputStreamTest { @Mock private InputStream wrapped; diff --git a/library/test/src/test/java/com/bumptech/glide/util/FixedPreloadSizeProviderTest.java b/library/test/src/test/java/com/bumptech/glide/util/FixedPreloadSizeProviderTest.java index 3600ab841e..46ba8f7a18 100644 --- a/library/test/src/test/java/com/bumptech/glide/util/FixedPreloadSizeProviderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/util/FixedPreloadSizeProviderTest.java @@ -1,5 +1,6 @@ package com.bumptech.glide.util; +import static com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK; import static com.google.common.truth.Truth.assertThat; import org.junit.Test; @@ -8,7 +9,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = ROBOLECTRIC_SDK) public class FixedPreloadSizeProviderTest { // containsExactly doesn't need a return value check. diff --git a/library/test/src/test/java/com/bumptech/glide/util/ViewPreloadSizeProviderTest.java b/library/test/src/test/java/com/bumptech/glide/util/ViewPreloadSizeProviderTest.java index ff0b138710..3a998b7f75 100644 --- a/library/test/src/test/java/com/bumptech/glide/util/ViewPreloadSizeProviderTest.java +++ b/library/test/src/test/java/com/bumptech/glide/util/ViewPreloadSizeProviderTest.java @@ -13,7 +13,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = 18) +@Config(sdk = com.bumptech.glide.RobolectricConstants.ROBOLECTRIC_SDK) public class ViewPreloadSizeProviderTest { private View view;