public class BaseDataBinderTest<T extends ViewDataBinding> extends ActivityInstrumentationTestCase2<TestActivity>
Modifier and Type | Field and Description |
---|---|
protected T |
mBinder |
protected Class<T> |
mBinderClass |
Constructor and Description |
---|
BaseDataBinderTest(Class<T> binderClass) |
BaseDataBinderTest(Class<T> binderClass,
int orientation) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertField(Class<?> klass,
String fieldName) |
protected void |
assertMethod(Class<?> klass,
String methodName) |
protected void |
assertNoField(String fieldName) |
protected void |
assertPublicField(Class<?> klass,
String fieldName) |
protected T |
getBinder() |
protected T |
initBinder() |
protected T |
initBinder(Runnable init) |
boolean |
isMainThread() |
protected void |
reCreateBinder(Runnable init) |
void |
runTestOnUiThread(Runnable r)
Helper for running portions of a test on the UI thread.
|
protected void |
setUp() |
getActivity, runTest, setActivityInitialTouchMode, setActivityIntent, tearDown
scrubClass, setActivity
getInstrumentation, injectInsrumentation, injectInstrumentation, launchActivity, launchActivityWithIntent, sendKeys, sendKeys, sendRepeatedKeys
protected Class<T extends ViewDataBinding> mBinderClass
protected T extends ViewDataBinding mBinder
protected void setUp() throws Exception
setUp
in class ActivityInstrumentationTestCase2<TestActivity>
Exception
public boolean isMainThread()
protected T getBinder()
protected T initBinder()
public void runTestOnUiThread(Runnable r) throws Throwable
InstrumentationTestCase
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.runTestOnUiThread
in class InstrumentationTestCase
r
- runnable containing test code in the Runnable.run()
methodThrowable
protected void reCreateBinder(Runnable init)
protected void assertMethod(Class<?> klass, String methodName) throws NoSuchMethodException
NoSuchMethodException
protected void assertField(Class<?> klass, String fieldName) throws NoSuchFieldException
NoSuchFieldException
protected void assertPublicField(Class<?> klass, String fieldName) throws NoSuchFieldException
NoSuchFieldException
protected void assertNoField(String fieldName)