提交 2293cb27 编写于 作者: S Sam Judd

Explicitly set JUnit4 runner for junit tests.

上级 a2f7668d
......@@ -2,6 +2,8 @@ package com.bumptech.glide.load;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.util.ArrayList;
......@@ -14,6 +16,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class MultiTransformationTest {
@Test
public void testReturnsConcatenatedTransformationIds() {
......
......@@ -4,6 +4,8 @@ import com.bumptech.glide.Priority;
import com.bumptech.glide.load.model.GlideUrl;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.InOrder;
import java.io.ByteArrayInputStream;
......@@ -21,6 +23,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class HttpUrlFetcherTest {
private HttpURLConnection urlConnection;
private HttpUrlFetcher fetcher;
......
......@@ -3,11 +3,14 @@ package com.bumptech.glide.load.data.resource;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.ByteArrayFetcher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.InputStream;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class ByteArrayFetcherTest {
@Test
......
......@@ -9,6 +9,8 @@ import com.bumptech.glide.load.resource.transcode.ResourceTranscoder;
import com.bumptech.glide.tests.KeyAssertions;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
......@@ -27,6 +29,7 @@ import static org.mockito.Mockito.when;
* and SHA-1 disk cache key are different on any difference in ID or existence of a certain workflow part.
* Also checking whether the equals method is symmetric.
*/
@RunWith(JUnit4.class)
public class EngineKeyTest {
private Harness harness;
......
......@@ -3,6 +3,8 @@ package com.bumptech.glide.load.engine;
import com.bumptech.glide.load.Key;
import com.bumptech.glide.tests.KeyAssertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
......@@ -14,6 +16,7 @@ import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class OriginalKeyTest {
@Test
......
......@@ -3,6 +3,8 @@ package com.bumptech.glide.load.engine.cache;
import com.bumptech.glide.load.Key;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
......@@ -11,6 +13,7 @@ import java.util.regex.Pattern;
import static org.junit.Assert.assertTrue;
@RunWith(JUnit4.class)
public class KeyGeneratorTest {
private SafeKeyGenerator keyGenerator;
private int nextId;
......
......@@ -3,6 +3,8 @@ package com.bumptech.glide.load.engine.cache;
import com.bumptech.glide.util.LruCache;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
......@@ -17,6 +19,7 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class LruCacheTest {
// 1MB
private static final int SIZE = 2;
......
......@@ -4,6 +4,8 @@ import android.content.ComponentCallbacks2;
import com.bumptech.glide.load.Key;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
......@@ -17,6 +19,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class LruResourceCacheTest {
private static class TrimClearMemoryCacheHarness {
LruResourceCache resourceCache = new LruResourceCache(100);
......
......@@ -4,6 +4,8 @@ import com.bumptech.glide.load.engine.Resource;
import com.bumptech.glide.load.resource.NullResourceEncoder;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.ByteArrayOutputStream;
......@@ -11,6 +13,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class NullResourceEncoderTest {
private NullResourceEncoder<Object> encoder;
......
......@@ -5,6 +5,8 @@ import com.bumptech.glide.load.data.HttpUrlFetcher;
import com.bumptech.glide.load.model.GlideUrl;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.InputStream;
......@@ -12,6 +14,7 @@ import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class HttpUrlGlideUrlLoaderTest {
private HttpUrlGlideUrlLoader loader;
private GlideUrl model;
......
......@@ -2,12 +2,15 @@ package com.bumptech.glide.load.model.stream;
import com.bumptech.glide.load.data.DataFetcher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.InputStream;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@RunWith(JUnit4.class)
public class StreamByteArrayLoaderTest {
@Test
......
......@@ -2,6 +2,8 @@ package com.bumptech.glide.load.resource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.ByteArrayInputStream;
import java.io.IOException;
......@@ -9,6 +11,7 @@ import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
@RunWith(JUnit4.class)
public class NullDecoderTest {
private NullDecoder decoder;
......
......@@ -2,6 +2,8 @@ package com.bumptech.glide.load.resource;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.ByteArrayOutputStream;
......@@ -9,6 +11,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class NullResourceEncoderTest {
@Test
......
......@@ -2,9 +2,12 @@ package com.bumptech.glide.load.resource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class SimpleResourceTest {
private Anything object;
private SimpleResource resource;
......
......@@ -2,10 +2,13 @@ package com.bumptech.glide.load.resource;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class UnitTransformationTest {
@Test
......
package com.bumptech.glide.load.resource.bitmap;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.ByteArrayInputStream;
import java.io.IOException;
......@@ -9,6 +11,7 @@ import java.io.InputStream;
import static com.bumptech.glide.load.resource.bitmap.ImageHeaderParser.ImageType;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class ImageHeaderParserTest {
private static final byte[] PNG_HEADER_WITH_IHDR_CHUNK = new byte[] {(byte) 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a,
......
package com.bumptech.glide.load.resource.bytes;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class BytesResourceTest {
@Test
......
......@@ -3,12 +3,15 @@ package com.bumptech.glide.load.resource.file;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.File;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class FileDecoderTest {
private FileDecoder decoder;
......
......@@ -2,11 +2,14 @@ package com.bumptech.glide.load.resource.file;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.File;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class FileResourceTest {
private File file;
......
......@@ -4,6 +4,8 @@ import com.bumptech.glide.load.ResourceDecoder;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.ByteArrayInputStream;
import java.io.File;
......@@ -18,6 +20,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class FileToStreamDecoderTest {
private ResourceDecoder<InputStream, Object> streamDecoder;
......
......@@ -4,6 +4,8 @@ import com.bumptech.glide.Priority;
import com.bumptech.glide.gifdecoder.GifDecoder;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
......@@ -11,6 +13,7 @@ import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifFrameModelLoaderTest {
private GifFrameModelLoader loader;
private GifDecoder decoder;
......
......@@ -5,6 +5,8 @@ import com.bumptech.glide.load.engine.Resource;
import com.bumptech.glide.load.model.ImageVideoWrapper;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
......@@ -19,6 +21,7 @@ import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifBitmapStreamResourceDecoderTest {
ResourceDecoder<ImageVideoWrapper, GifBitmapWrapper> gifBitmapDecoder;
private GifBitmapWrapperStreamResourceDecoder decoder;
......
......@@ -5,12 +5,15 @@ import com.bumptech.glide.load.ResourceEncoder;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifBitmapWrapperResourceEncoderTest {
private ResourceEncoder<Bitmap> bitmapEncoder;
private ResourceEncoder<GifDrawable> gifEncoder;
......
......@@ -5,12 +5,15 @@ import com.bumptech.glide.load.engine.Resource;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifBitmapWrapperResourceTest {
private GifBitmapWrapper data;
private GifBitmapWrapperResource resource;
......
......@@ -4,11 +4,14 @@ import com.bumptech.glide.load.ResourceDecoder;
import com.bumptech.glide.load.model.ImageVideoWrapper;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifBitmapWrapperStreamResourceDecoderTest {
ResourceDecoder<ImageVideoWrapper, GifBitmapWrapper> gifBitmapDecoder;
......
......@@ -4,11 +4,14 @@ import android.graphics.Bitmap;
import com.bumptech.glide.load.engine.Resource;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifBitmapWrapperTest {
@Test
......
......@@ -5,11 +5,14 @@ import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.bumptech.glide.tests.Util;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertArrayEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class GifDrawableBytesTranscoderTest {
private GifDrawableBytesTranscoder transcoder;
private GifDrawable gifDrawable;
......
......@@ -2,12 +2,15 @@ package com.bumptech.glide.load.resource.transcode;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.File;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class TranscoderRegistryTest {
private TranscoderRegistry factories;
......
......@@ -2,10 +2,13 @@ package com.bumptech.glide.load.resource.transcode;
import com.bumptech.glide.load.engine.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class UnitTranscoderTest {
@Test
......
......@@ -3,6 +3,8 @@ package com.bumptech.glide.manager;
import com.bumptech.glide.request.Request;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
......@@ -11,6 +13,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class RequestTrackerTest {
private RequestTracker tracker;
......
......@@ -7,6 +7,8 @@ import com.bumptech.glide.load.model.ModelLoader;
import com.bumptech.glide.load.resource.transcode.ResourceTranscoder;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.File;
......@@ -14,6 +16,7 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class ChildLoadProviderTest {
private ChildLoadHarness harness;
......
......@@ -2,12 +2,15 @@ package com.bumptech.glide.provider;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class DataLoadProviderRegistryTest {
private DataLoadProviderRegistry factory;
......
......@@ -2,6 +2,8 @@ package com.bumptech.glide.request;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.InOrder;
import static org.junit.Assert.assertFalse;
......@@ -13,6 +15,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class ThumbnailRequestCoordinatorTest {
private Request full;
private Request thumb;
......
......@@ -2,9 +2,12 @@ package com.bumptech.glide.request.target;
import com.bumptech.glide.request.animation.GlideAnimation;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.mockito.Mockito.mock;
@RunWith(JUnit4.class)
public class SimpleTargetTest {
@Test(expected = IllegalArgumentException.class)
......
......@@ -2,10 +2,13 @@ package com.bumptech.glide.signature;
import com.bumptech.glide.tests.KeyAssertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
@RunWith(JUnit4.class)
public class MediaStoreSignatureTest {
@Test
......
......@@ -2,10 +2,13 @@ package com.bumptech.glide.signature;
import com.bumptech.glide.tests.KeyAssertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
@RunWith(JUnit4.class)
public class StringSignatureTest {
@Test
......
......@@ -3,6 +3,8 @@ package com.bumptech.glide.util;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.IOException;
import java.io.InputStream;
......@@ -19,6 +21,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(JUnit4.class)
public class ExceptionCatchingInputStreamTest {
private InputStream wrapped;
......
Subproject commit fb30e31469966bf2b9960a736735bb6380cbca39
Subproject commit 740db90bd91a04aa6dff6e450c10755d130dded4
......@@ -4,6 +4,8 @@ import com.bumptech.glide.gifdecoder.test.GifBytesTestUtil;
import com.bumptech.glide.gifdecoder.test.TestUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.IOException;
import java.nio.ByteBuffer;
......@@ -17,6 +19,7 @@ import static org.junit.Assert.assertNull;
/**
* Tests for {@link com.bumptech.glide.gifdecoder.GifHeaderParser}.
*/
@RunWith(JUnit4.class)
public class GifHeaderParserTest {
private GifHeaderParser parser;
......
package com.bumptech.glide.gifdecoder.test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.nio.ByteBuffer;
import java.util.Arrays;
......@@ -10,6 +12,7 @@ import static org.junit.Assert.assertArrayEquals;
/**
* Tests for {@link com.bumptech.glide.gifdecoder.test.GifBytesTestUtil}.
*/
@RunWith(JUnit4.class)
public class GifBytesTestUtilTest {
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册