public class RuntimeEnvironment
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static android.app.Application |
application |
| Constructor and Description |
|---|
RuntimeEnvironment() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Number |
castNativePtr(long ptr) |
static java.lang.Object |
getActivityThread() |
static int |
getApiLevel() |
static ResourceTable |
getAppResourceTable() |
static ResourceTable |
getCompileTimeResourceTable() |
static java.lang.Thread |
getMainThread()
Retrieves the main thread.
|
static org.robolectric.util.Scheduler |
getMasterScheduler()
Retrieves the current master scheduler.
|
static android.content.pm.PackageManager |
getPackageManager() |
static java.lang.String |
getQualifiers() |
static RobolectricPackageManager |
getRobolectricPackageManager() |
static ResourceTable |
getSystemResourceTable() |
static boolean |
isMainThread()
Tests if the current thread is currently set as the main thread.
|
static boolean |
isMainThread(java.lang.Thread thread)
Tests if the given thread is currently set as the main thread.
|
static void |
setActivityThread(java.lang.Object newActivityThread) |
static void |
setAppResourceTable(ResourceTable appResourceTable) |
static void |
setCompileTimeResourceTable(ResourceTable compileTimeResourceTable) |
static void |
setMainThread(java.lang.Thread newMainThread)
Sets the main thread.
|
static void |
setMasterScheduler(org.robolectric.util.Scheduler masterScheduler)
Sets the current master scheduler.
|
static void |
setQualifiers(java.lang.String newQualifiers) |
static void |
setRobolectricPackageManager(RobolectricPackageManager newPackageManager) |
static void |
setSystemResourceTable(ResourceTable systemResourceTable) |
public static boolean isMainThread(java.lang.Thread thread)
thread - the thread to test.isMainThread()public static boolean isMainThread()
public static java.lang.Thread getMainThread()
setMainThread(Thread),
isMainThread()public static void setMainThread(java.lang.Thread newMainThread)
newMainThread - the new main thread.setMainThread(Thread),
isMainThread()public static java.lang.Object getActivityThread()
public static void setActivityThread(java.lang.Object newActivityThread)
public static android.content.pm.PackageManager getPackageManager()
public static RobolectricPackageManager getRobolectricPackageManager()
public static void setRobolectricPackageManager(RobolectricPackageManager newPackageManager)
public static java.lang.String getQualifiers()
public static void setQualifiers(java.lang.String newQualifiers)
public static int getApiLevel()
public static java.lang.Number castNativePtr(long ptr)
public static org.robolectric.util.Scheduler getMasterScheduler()
Looper, and if the global scheduler option is set it is also used for
the background scheduler and for all other Looperssee org.robolectric.Robolectric#getForegroundThreadScheduler()
see org.robolectric.Robolectric#getBackgroundThreadScheduler()public static void setMasterScheduler(org.robolectric.util.Scheduler masterScheduler)
getMasterScheduler() for details.
Note that this method is primarily intended to be called by the Robolectric core setup code.
Changing the master scheduler during a test will have unpredictable results.masterScheduler - the new master scheduler.see org.robolectric.Robolectric#getForegroundThreadScheduler()
see org.robolectric.Robolectric#getBackgroundThreadScheduler()public static void setSystemResourceTable(ResourceTable systemResourceTable)
public static void setAppResourceTable(ResourceTable appResourceTable)
public static ResourceTable getSystemResourceTable()
public static ResourceTable getAppResourceTable()
public static void setCompileTimeResourceTable(ResourceTable compileTimeResourceTable)
public static ResourceTable getCompileTimeResourceTable()