public class Robolectric
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Robolectric.AttributeSetBuilder
Deprecated.
Use
AttributeSetBuilder instead. |
Constructor and Description |
---|
Robolectric() |
Modifier and Type | Method and Description |
---|---|
static <T extends android.app.Activity> |
buildActivity(java.lang.Class<T> activityClass) |
static <T extends android.app.Activity> |
buildActivity(java.lang.Class<T> activityClass,
android.content.Intent intent) |
static AttributeSetBuilder |
buildAttributeSet()
Allows for the programmatic creation of an
AttributeSet . |
static <T extends android.app.backup.BackupAgent> |
buildBackupAgent(java.lang.Class<T> backupAgentClass) |
static <T extends android.content.ContentProvider> |
buildContentProvider(java.lang.Class<T> contentProviderClass) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
android.os.Bundle arguments) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
java.lang.Class<? extends android.app.Activity> activityClass) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
java.lang.Class<? extends android.app.Activity> activityClass,
android.os.Bundle arguments) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
java.lang.Class<? extends android.app.Activity> activityClass,
android.content.Intent intent) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
java.lang.Class<? extends android.app.Activity> activityClass,
android.content.Intent intent,
android.os.Bundle arguments) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
android.content.Intent intent) |
static <T extends android.app.Fragment> |
buildFragment(java.lang.Class<T> fragmentClass,
android.content.Intent intent,
android.os.Bundle arguments) |
static <T extends android.app.IntentService> |
buildIntentService(java.lang.Class<T> serviceClass) |
static <T extends android.app.IntentService> |
buildIntentService(java.lang.Class<T> serviceClass,
android.content.Intent intent) |
static <T extends android.app.Service> |
buildService(java.lang.Class<T> serviceClass) |
static <T extends android.app.Service> |
buildService(java.lang.Class<T> serviceClass,
android.content.Intent intent) |
static void |
flushBackgroundThreadScheduler()
Execute all runnables that have been enqueued on the background scheduler.
|
static void |
flushForegroundThreadScheduler()
Execute all runnables that have been enqueued on the foreground scheduler.
|
static Scheduler |
getBackgroundThreadScheduler()
Return the background scheduler.
|
static Scheduler |
getForegroundThreadScheduler()
Return the foreground scheduler (e.g.
|
static <T extends android.app.Activity> |
setupActivity(java.lang.Class<T> activityClass) |
static <T extends android.app.backup.BackupAgent> |
setupBackupAgent(java.lang.Class<T> backupAgentClass) |
static <T extends android.content.ContentProvider> |
setupContentProvider(java.lang.Class<T> contentProviderClass) |
static <T extends android.content.ContentProvider> |
setupContentProvider(java.lang.Class<T> contentProviderClass,
java.lang.String authority) |
static <T extends android.app.IntentService> |
setupIntentService(java.lang.Class<T> serviceClass) |
static <T extends android.app.Service> |
setupService(java.lang.Class<T> serviceClass) |
public static <T extends android.app.Service> ServiceController<T> buildService(java.lang.Class<T> serviceClass)
public static <T extends android.app.Service> ServiceController<T> buildService(java.lang.Class<T> serviceClass, android.content.Intent intent)
public static <T extends android.app.Service> T setupService(java.lang.Class<T> serviceClass)
public static <T extends android.app.IntentService> IntentServiceController<T> buildIntentService(java.lang.Class<T> serviceClass)
public static <T extends android.app.IntentService> IntentServiceController<T> buildIntentService(java.lang.Class<T> serviceClass, android.content.Intent intent)
public static <T extends android.app.IntentService> T setupIntentService(java.lang.Class<T> serviceClass)
public static <T extends android.content.ContentProvider> ContentProviderController<T> buildContentProvider(java.lang.Class<T> contentProviderClass)
public static <T extends android.content.ContentProvider> T setupContentProvider(java.lang.Class<T> contentProviderClass)
public static <T extends android.content.ContentProvider> T setupContentProvider(java.lang.Class<T> contentProviderClass, java.lang.String authority)
public static <T extends android.app.Activity> ActivityController<T> buildActivity(java.lang.Class<T> activityClass)
public static <T extends android.app.Activity> ActivityController<T> buildActivity(java.lang.Class<T> activityClass, android.content.Intent intent)
public static <T extends android.app.Activity> T setupActivity(java.lang.Class<T> activityClass)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, android.os.Bundle arguments)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, java.lang.Class<? extends android.app.Activity> activityClass)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, android.content.Intent intent)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, android.content.Intent intent, android.os.Bundle arguments)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, java.lang.Class<? extends android.app.Activity> activityClass, android.content.Intent intent)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, java.lang.Class<? extends android.app.Activity> activityClass, android.os.Bundle arguments)
public static <T extends android.app.Fragment> FragmentController<T> buildFragment(java.lang.Class<T> fragmentClass, java.lang.Class<? extends android.app.Activity> activityClass, android.content.Intent intent, android.os.Bundle arguments)
public static <T extends android.app.backup.BackupAgent> BackupAgentController<T> buildBackupAgent(java.lang.Class<T> backupAgentClass)
public static <T extends android.app.backup.BackupAgent> T setupBackupAgent(java.lang.Class<T> backupAgentClass)
public static AttributeSetBuilder buildAttributeSet()
Allows for the programmatic creation of an AttributeSet
.
Useful for testing View
classes without the need for creating XML snippets.
public static Scheduler getForegroundThreadScheduler()
Return the foreground scheduler (e.g. the UI thread scheduler).
public static void flushForegroundThreadScheduler()
Execute all runnables that have been enqueued on the foreground scheduler.
public static Scheduler getBackgroundThreadScheduler()
Return the background scheduler.
public static void flushBackgroundThreadScheduler()
Execute all runnables that have been enqueued on the background scheduler.