|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
positron.TestCase
public abstract class TestCase
Field Summary | |
---|---|
static int |
ALT
KeyEvent.KEYCODE_ALT |
static int |
BACK
KeyEvent.KEYCODE_BACK |
static int |
CALL
KeyEvent.KEYCODE_CALL |
static int |
CAMERA
KeyEvent.KEYCODE_CAMERA |
static int |
CAP
KeyEvent.KEYCODE_CAP |
static int |
CENTER
KeyEvent.KEYCODE_DPAD_CENTER |
static int |
CLEAR
KeyEvent.KEYCODE_CLEAR |
static int |
CLICK
KeyEvent.KEYCODE_DPAD_CENTER |
static int |
DOWN
KeyEvent.KEYCODE_DPAD_DOWN |
static int |
ENDCALL
KeyEvent.KEYCODE_ENDCALL |
static int |
ENVELOPE
KeyEvent.KEYCODE_ENVELOPE |
static int |
EXPLORER
KeyEvent.KEYCODE_EXPLORER |
static int |
HOME
KeyEvent.KEYCODE_HOME |
static int |
LEFT
KeyEvent.KEYCODE_DPAD_LEFT |
static int |
NEWLINE
KeyEvent.KEYCODE_NEWLINE |
static int |
NUM
KeyEvent.KEYCODE_NUM |
static int |
POWER
KeyEvent.KEYCODE_POWER |
static int |
RIGHT
KeyEvent.KEYCODE_DPAD_RIGHT |
static int |
SOFT_LEFT
KeyEvent.KEYCODE_SOFT_LEFT |
static int |
SOFT_RIGHT
KeyEvent.KEYCODE_SOFT_RIGHT |
static int |
SYM
KeyEvent.KEYCODE_SYM |
static int |
TAB
KeyEvent.KEYCODE_TAB |
static int |
UP
KeyEvent.KEYCODE_DPAD_UP |
static int |
VOLUME_DOWN
KeyEvent.KEYCODE_VOLUME_UP |
static int |
VOLUME_UP
KeyEvent.KEYCODE_VOLUME_DOWN |
Constructor Summary | |
---|---|
TestCase()
|
|
TestCase(String name)
|
Method Summary | ||
---|---|---|
protected List<Activity> |
activities()
Get all the unfinished activities in the target package, most recent first. |
|
protected Activity |
activity()
Get the most recent unfinished activity in the target package. |
|
protected void |
addMonitor(Instrumentation.ActivityMonitor monitor)
|
|
protected Instrumentation.ActivityMonitor |
addMonitor(IntentFilter filter,
Instrumentation.ActivityResult result,
boolean block)
|
|
protected Instrumentation.ActivityMonitor |
addMonitor(String cls,
Instrumentation.ActivityResult result,
boolean block)
|
|
protected
|
at(Class<T> asA,
Object from,
String path)
|
|
protected
|
at(Class<T> asA,
String path)
|
|
protected Object |
at(String path)
|
|
protected void |
backup()
|
|
protected void |
backup(String database)
|
|
protected boolean |
booleanAt(String path)
|
|
protected void |
callActivityOnCompleteThaw(Activity activity,
Bundle icicle)
|
|
protected void |
callActivityOnCreate(Activity activity,
Bundle icicle)
|
|
protected void |
callActivityOnFreeze(Activity activity,
Bundle outState)
|
|
protected void |
callActivityOnNewIntent(Activity activity,
Intent intent)
|
|
protected void |
callActivityOnPause(Activity activity)
|
|
protected void |
callActivityOnPostCreate(Activity activity,
Bundle icicle)
|
|
protected void |
callActivityOnRestart(Activity activity)
|
|
protected void |
callActivityOnResume(Activity activity)
|
|
protected void |
callActivityOnStart(Activity activity)
|
|
protected void |
callApplicationOnCreate(Application app)
|
|
protected boolean |
checkMonitorHit(Instrumentation.ActivityMonitor monitor,
int minHits)
|
|
protected void |
click()
sendKeyDownUp(KEYCODE_DPAD_CENTER) |
|
protected double |
doubleAt(String path)
|
|
protected Bitmap |
dupWindowBitmap(Activity activity)
dupWindowBitmapSync, resuming momentarily if necessary. |
|
protected Bitmap |
dupWindowBitmapSync(Activity activity)
|
|
protected void |
execSql(String database,
int... scriptsAsRawResources)
|
|
protected Instrumentation.ActivityResult |
execStartActivity(ApplicationContext who,
IBinder token,
Activity target,
Intent intent,
int requestCode)
|
|
protected void |
finish()
finish(activity()), resuming momentarily as needed. |
|
protected void |
finish(Activity activity)
Finish the given activity by calling finish() on the main thread. |
|
protected void |
finish(int resultCode,
Bundle results)
|
|
protected void |
finishAll()
finish() all unfinished activities; useful in tearDown(). |
|
protected void |
getAllocCounts(Bundle results)
|
|
protected Context |
getContext()
|
|
protected Context |
getTargetContext()
|
|
protected int |
intAt(String path)
|
|
protected void |
invokeMenuAction(Activity targetActivity,
int id,
int flag)
invokeMenuActionSync, resuming momentarily if necessary. |
|
protected void |
invokeMenuActionSync(Activity targetActivity,
int id,
int flag)
|
|
protected boolean |
isProfiling()
|
|
protected Activity |
newActivity(ClassLoader cl,
String className,
Intent intent)
|
|
protected Application |
newApplication(ClassLoader cl,
String className)
|
|
protected void |
onCreate(Bundle arguments)
|
|
protected void |
onDestroy()
|
|
protected boolean |
onException(Object obj,
Throwable e)
|
|
protected void |
onStart()
|
|
protected void |
pause()
Pause execution of the target package. |
|
protected boolean |
paused()
Is the target package paused? |
|
protected void |
pauseNow()
Like pause, but do not implicitly call waitForIdleSync(). |
|
protected void |
press(Object... keys)
sendKeyDownUpSync on all keys in order, resuming momentarily if necessary. |
|
protected void |
removeMonitor(Instrumentation.ActivityMonitor monitor)
|
|
protected void |
restore()
|
|
protected void |
restore(String database)
|
|
protected void |
resume()
Resume executing the target package if it has been paused. |
|
protected void |
runOnMainSync(Runnable runner)
|
|
protected void |
sendCharacter(int keyCode)
sendCharacterSync, resuming momentarily if necessary. |
|
protected void |
sendCharacterSync(int keyCode)
|
|
protected void |
sendKey(KeyEvent event)
sendKeySync, resuming momentarily if necessary. |
|
protected void |
sendKeyDownUp(int key)
sendKeyDownUpSync, resuming momentarily if necessary. |
|
protected void |
sendKeyDownUpSync(int key)
|
|
protected void |
sendKeySync(KeyEvent event)
|
|
protected void |
sendString(String text)
sendStringSync, resuming momentarily if necessary. |
|
protected void |
sendStringSync(String text)
|
|
void |
setInstrumentation(Positron positron)
|
|
protected void |
start()
|
|
protected Activity |
startActivity(Intent intent)
startActivitySync, resuming momentarily if necessary. |
|
protected Activity |
startActivitySync(Intent intent)
|
|
protected Activity |
startActivitySync(String className)
Shortcut to startActivitySync the named class in the target context. |
|
protected void |
startAllocCounting()
|
|
protected void |
startProfiling()
|
|
protected void |
stopAllocCounting()
|
|
protected void |
stopProfiling()
|
|
protected String |
stringAt(String path)
|
|
protected void |
tearDown()
finishAll(); |
|
protected View |
viewAt(String path)
|
|
protected void |
waitForIdle()
waitForIdleSync, resuming momentarily if necessary. |
|
protected void |
waitForIdle(Runnable recipient)
|
|
protected void |
waitForIdleSync()
|
|
protected Activity |
waitForMonitor(Instrumentation.ActivityMonitor monitor)
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CLICK
public static final int CENTER
public static final int UP
public static final int DOWN
public static final int LEFT
public static final int RIGHT
public static final int BACK
public static final int CALL
public static final int CAMERA
public static final int CAP
public static final int CLEAR
public static final int ENDCALL
public static final int ENVELOPE
public static final int EXPLORER
public static final int ALT
public static final int HOME
public static final int NEWLINE
public static final int NUM
public static final int POWER
public static final int SOFT_LEFT
public static final int SOFT_RIGHT
public static final int SYM
public static final int TAB
public static final int VOLUME_UP
public static final int VOLUME_DOWN
Constructor Detail |
---|
public TestCase(String name)
public TestCase()
Method Detail |
---|
public void setInstrumentation(Positron positron)
protected void tearDown() throws Exception
tearDown
in class TestCase
Exception
protected Activity activity()
protected List<Activity> activities()
protected void finish(Activity activity)
protected void finish()
protected void finishAll()
protected void pause()
protected void pauseNow()
protected void resume()
protected boolean paused()
protected Activity startActivitySync(String className)
className
- fully-qualified class name of the action to start.protected Bitmap dupWindowBitmap(Activity activity)
protected void invokeMenuAction(Activity targetActivity, int id, int flag)
protected void sendCharacter(int keyCode)
protected void sendKey(KeyEvent event)
protected void sendKeyDownUp(int key)
protected void click()
protected void press(Object... keys)
keys
- A mixture of ints and Strings. ints are sent with sendKeyDownUpSync,
Strings are send with sendStringSync.
IllegalArgumentException
- if something other than an int or String was passed.protected <T> T at(Class<T> asA, Object from, String path)
protected <T> T at(Class<T> asA, String path)
protected Object at(String path)
protected View viewAt(String path)
protected boolean booleanAt(String path)
protected double doubleAt(String path)
protected int intAt(String path)
protected String stringAt(String path)
protected void sendString(String text)
protected Activity startActivity(Intent intent)
protected void waitForIdle()
protected void addMonitor(Instrumentation.ActivityMonitor monitor)
protected Instrumentation.ActivityMonitor addMonitor(IntentFilter filter, Instrumentation.ActivityResult result, boolean block)
protected Instrumentation.ActivityMonitor addMonitor(String cls, Instrumentation.ActivityResult result, boolean block)
protected void callActivityOnCompleteThaw(Activity activity, Bundle icicle)
protected void callActivityOnCreate(Activity activity, Bundle icicle)
protected void callActivityOnFreeze(Activity activity, Bundle outState)
protected void callActivityOnNewIntent(Activity activity, Intent intent)
protected void callActivityOnPause(Activity activity)
protected void callActivityOnPostCreate(Activity activity, Bundle icicle)
protected void callActivityOnRestart(Activity activity)
protected void callActivityOnResume(Activity activity)
protected void callActivityOnStart(Activity activity)
protected void callApplicationOnCreate(Application app)
protected boolean checkMonitorHit(Instrumentation.ActivityMonitor monitor, int minHits)
protected Bitmap dupWindowBitmapSync(Activity activity)
protected Instrumentation.ActivityResult execStartActivity(ApplicationContext who, IBinder token, Activity target, Intent intent, int requestCode)
protected void finish(int resultCode, Bundle results)
protected void getAllocCounts(Bundle results)
protected Context getContext()
protected Context getTargetContext()
protected void invokeMenuActionSync(Activity targetActivity, int id, int flag)
protected boolean isProfiling()
protected Activity newActivity(ClassLoader cl, String className, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException
InstantiationException
IllegalAccessException
ClassNotFoundException
protected Application newApplication(ClassLoader cl, String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException
InstantiationException
IllegalAccessException
ClassNotFoundException
protected void onCreate(Bundle arguments)
protected void onDestroy()
protected boolean onException(Object obj, Throwable e)
protected void onStart()
protected void removeMonitor(Instrumentation.ActivityMonitor monitor)
protected void runOnMainSync(Runnable runner)
protected void sendCharacterSync(int keyCode)
protected void sendKeyDownUpSync(int key)
protected void sendKeySync(KeyEvent event)
protected void sendStringSync(String text)
protected void start()
protected Activity startActivitySync(Intent intent)
protected void startAllocCounting()
protected void startProfiling()
protected void stopAllocCounting()
protected void stopProfiling()
protected void waitForIdle(Runnable recipient)
protected void waitForIdleSync()
protected Activity waitForMonitor(Instrumentation.ActivityMonitor monitor)
protected void backup()
protected void backup(String database)
protected void execSql(String database, int... scriptsAsRawResources)
protected void restore()
protected void restore(String database)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |