FileDocCategorySizeDatePackage
PauseTest.javaAPI DocphoneME MR2 API (J2ME)2816Wed May 02 18:00:00 BST 2007None

PauseTest

public class PauseTest extends MIDlet
III (Integrated Internal Interface) testing stand-alone MIDlet.

(Omit source code)

Fields Summary
boolean
firstTime
boolean
suspended
private static SecurityToken
myToken
Security token to allow access to implementation APIs
private EventQueue
myQ
Constructors Summary
public PauseTest()


      
	myQ = EventQueue.getEventQueue(myToken);
    
Methods Summary
public voiddestroyApp(boolean unconditional)

	System.out.println("destroyApp() called");
    
public voidpauseApp()

	suspended = true;
	System.out.println("pauseApp() called");

	UnitTestEvent resumeEvent
		= new UnitTestEvent(EventTypes.SYSTEM_EVENT);
	resumeEvent.intParam1 = (EventTypes.RESUME_ALL);

	/* generate Resume Event */
	myQ.post(resumeEvent);
    
public voidstartApp()

	if (firstTime) {
	    firstTime = false;
	}
	UnitTestEvent suspendEvent
		= new UnitTestEvent(EventTypes.SYSTEM_EVENT);
	suspendEvent.intParam1 = (EventTypes.SUSPEND_ALL);

	if (!suspended) {
	    System.out.println("startApp() called on startup");
	    /* generate Suspend Event */
	    myQ.post(suspendEvent);
	} else {
	    System.out.println("PASSED: startApp() called on resume");
	    notifyDestroyed();
	}