Skip to content

Commit

Permalink
Make most tests oss-ready
Browse files Browse the repository at this point in the history
  • Loading branch information
tyronen committed May 14, 2015
1 parent 8b280e3 commit e7da690
Show file tree
Hide file tree
Showing 48 changed files with 129 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.facebook.datasource.SettableDataSource;
import com.facebook.drawee.components.DeferredReleaser;
import com.facebook.drawee.interfaces.SettableDraweeHierarchy;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -39,7 +39,7 @@
import static org.mockito.Mockito.*;

/** * Tests for AbstractDraweeController */
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class AbstractDraweeControllerTest {

public static class FakeImageInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -31,7 +31,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class ArrayDrawableTest {
private Drawable mUnderlyingDrawable0;
private Drawable mUnderlyingDrawable1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -26,7 +26,7 @@
/**
* Tests for {@link ForwardingDrawable}
*/
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DrawableUtilsTest {

private final Rect mBounds = mock(Rect.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.graphics.drawable.Drawable;

import com.facebook.common.testing.FakeClock;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -23,7 +23,7 @@

import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class FadeDrawableTest {
private Drawable[] mLayers = new Drawable[] {
DrawableTestUtils.mockDrawable(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -26,7 +26,7 @@
/**
* Tests for {@link ForwardingDrawable}
*/
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class ForwardingDrawableTest {
private Drawable mInnerDrawable;
private FakeForwardingDrawable mDrawable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -22,7 +22,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class MatrixDrawableTest {
private Drawable mUnderlyingDrawable;
private Matrix mMatrix1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -25,7 +25,7 @@
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class RoundedBitmapDrawableTest {
private Resources mResources;
private Bitmap mBitmap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -27,7 +27,7 @@
import static org.mockito.Mockito.*;
import static org.mockito.Matchers.any;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class RoundedColorDrawableTest {

private Canvas mCanvas;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import android.graphics.Color;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -21,7 +21,7 @@
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class RoundedCornersDrawableTest {

private Drawable mUnderlyingDrawable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import android.graphics.RectF;
import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -26,7 +26,7 @@

import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class ScaleTypeDrawableTest {
private Drawable mUnderlyingDrawable = mock(Drawable.class);
private PointF mFocusPoint = new PointF(0.1f, 0.4f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import android.graphics.Matrix;
import android.graphics.Rect;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -24,7 +24,7 @@
/**
* Tests for scale type calculations.
*/
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class ScalingUtilsTest {
private final Matrix mExpectedMatrix = new Matrix();
private final Matrix mActualMatrix = new Matrix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import android.graphics.drawable.Drawable;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -20,7 +20,7 @@

import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class SettableDrawableTest {
private Drawable mUnderlyingDrawable0;
private Drawable mUnderlyingDrawable1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import com.facebook.common.internal.Lists;
import com.facebook.drawee.drawable.AndroidGraphicsTestUtils;
import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class GenericDraweeHierarchyBuilderTest {

private final Drawable mBackgroundDrawable1 = mock(BitmapDrawable.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.facebook.drawee.drawable.RoundedCornersDrawable;
import com.facebook.drawee.drawable.ScaleTypeDrawable;
import com.facebook.drawee.drawable.SettableDrawable;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -39,7 +39,7 @@
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class GenericDraweeHierarchyTest {

private final BitmapDrawable mPlaceholderImage = mock(BitmapDrawable.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

import android.graphics.Color;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class RoundingParamsTest {

private RoundingParams mRoundingParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import android.view.MotionEvent;
import android.view.ViewConfiguration;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -25,7 +25,7 @@
/**
* Tests for {@link GestureDetector}
*/
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class GestureDetectorTest {

private GestureDetector.ClickListener mClickListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.facebook.drawee.drawable.VisibilityCallback;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -28,7 +28,7 @@
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DraweeMocksTest {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
package com.facebook.drawee.view;

import com.facebook.drawee.view.AspectRatioMeasure;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -22,7 +22,7 @@
import static android.view.ViewGroup.LayoutParams;
import static android.view.ViewGroup.LayoutParams.*;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class AspectRatioMeasureTest {

AspectRatioMeasure.Spec mSpec = new AspectRatioMeasure.Spec();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.facebook.drawee.interfaces.DraweeHierarchy;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.drawee.testing.DraweeMocks;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -29,7 +29,7 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DraweeHolderTest {

private DraweeHolder mDraweeHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.facebook.drawee.interfaces.DraweeHierarchy;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.drawee.testing.DraweeMocks;
import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -28,7 +28,7 @@
import static org.mockito.Mockito.*;

/** Unit test for {@link DraweeView}. */
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DraweeViewTest {

private DraweeView<DraweeHierarchy> mDraweeView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.graphics.drawable.Drawable;
import android.view.MotionEvent;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -25,7 +25,7 @@
/**
* Tests for {@link MultiDraweeHolder}
*/
@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class MultiDraweeHolderTest {

MultiDraweeHolder mMultiHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import android.os.Handler;

import com.facebook.testing.robolectric.v2.WithTestDefaultsRunner;
import org.robolectric.RobolectricTestRunner;

import org.junit.Assert;
import org.junit.Before;
Expand All @@ -24,7 +24,7 @@
import org.robolectric.shadows.ShadowLooper;
import org.robolectric.util.Scheduler;

@RunWith(WithTestDefaultsRunner.class)
@RunWith(RobolectricTestRunner.class)
public class HandlerExecutorServiceImplTest {

private AtomicInteger mCounter = new AtomicInteger();
Expand Down
Loading

0 comments on commit e7da690

Please sign in to comment.