Android APIs
public abstract class

BaseRecyclerViewInstrumentationTest

extends ActivityInstrumentationTestCase2<TestActivity>
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ android.test.InstrumentationTestCase
         ↳ android.test.ActivityTestCase
           ↳ android.test.ActivityInstrumentationTestCase2<android.support.v7.widget.TestActivity>
             ↳ android.support.v7.widget.BaseRecyclerViewInstrumentationTest
Known Direct Subclasses

Summary

Nested Classes
interface BaseRecyclerViewInstrumentationTest.AttachDetachCountingAdapter  
class BaseRecyclerViewInstrumentationTest.ViewAttachDetachCounter  
Fields
protected AdapterHelper mAdapterHelper
protected RecyclerView mRecyclerView
Public Constructors
BaseRecyclerViewInstrumentationTest()
BaseRecyclerViewInstrumentationTest(boolean debug)
Public Methods
Rect getDecoratedRecyclerViewBounds()
boolean isMainThread()
void removeRecyclerView()
boolean requestFocus(View view)
void requestLayoutOnUIThread(View view)
void runTestOnUiThread(Runnable r)
Helper for running portions of a test on the UI thread.
void scrollBy(int dt)
void setRecyclerView(RecyclerView recyclerView)
void setRecyclerView(RecyclerView recyclerView, boolean assignDummyPool, boolean addPositionCheckItemAnimator)
void setRecyclerView(RecyclerView recyclerView, boolean assignDummyPool)
Protected Methods
FrameLayout getRecyclerViewContainer()
void tearDown()
Make sure all resources are cleaned up and garbage collected before moving on to the next test.
[Expand]
Inherited Methods
From class android.test.ActivityInstrumentationTestCase2
From class android.test.ActivityTestCase
From class android.test.InstrumentationTestCase
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test

Fields

protected AdapterHelper mAdapterHelper

protected RecyclerView mRecyclerView

Public Constructors

public BaseRecyclerViewInstrumentationTest ()

public BaseRecyclerViewInstrumentationTest (boolean debug)

Public Methods

public Rect getDecoratedRecyclerViewBounds ()

public boolean isMainThread ()

public void removeRecyclerView ()

Throws
Throwable

public boolean requestFocus (View view)

public void requestLayoutOnUIThread (View view)

public void runTestOnUiThread (Runnable r)

Helper for running portions of a test on the UI thread. Note, in most cases it is simpler to annotate the test method with UiThreadTest, which will run the entire test method on the UI thread. Use this method if you need to switch in and out of the UI thread to perform your test.

Parameters
r runnable containing test code in the run() method
Throws
Throwable

public void scrollBy (int dt)

public void setRecyclerView (RecyclerView recyclerView)

Throws
Throwable

public void setRecyclerView (RecyclerView recyclerView, boolean assignDummyPool, boolean addPositionCheckItemAnimator)

Throws
Throwable

public void setRecyclerView (RecyclerView recyclerView, boolean assignDummyPool)

Throws
Throwable

Protected Methods

protected FrameLayout getRecyclerViewContainer ()

protected void tearDown ()

Make sure all resources are cleaned up and garbage collected before moving on to the next test. Subclasses that override this method should make sure they call super.tearDown() at the end of the overriding method.

Throws
Exception