| java.lang.Object com.sun.midp.i3test.TestCase com.sun.midp.main.TestMIDletControllerEventProducer
TestMIDletControllerEventProducer | public class TestMIDletControllerEventProducer extends TestCase implements MIDletControllerEventConsumer(Code) | | Unit tests for the MIDletControllerEventProducer class. This class, and
event producer classes in general, don't have much logic. However, they do
implement the mapping between specific data and generic event fields (e.g.,
intParam1 or stringParam2) which is important to test.
|
Method Summary | |
public void | handleActivateAllEvent() Process an ACTIVATE_ALL_EVENT. | public void | handleDestroyAllEvent() Process a SHUTDOWN_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
It simply calls "shutdown()". | public void | handleDisplayBackgroundRequestEvent(int midletIsolateId, int midletDisplayId) Process a background request event. | public void | handleDisplayCreateNotifyEvent(int midletIsolateId, int midletDisplayId, String midletClassName) Process a Display created notification. | public void | handleDisplayForegroundRequestEvent(int midletIsolateId, int midletDisplayId, boolean isAlert) Process a foreground request event. | public void | handleDisplayPreemptStartEvent(int midletIsolateId, int midletDisplayId) Process a "display preempt start" event.
Set the foreground to a given display if a certain display
has the foreground. | public void | handleDisplayPreemptStopEvent(int midletIsolateId, int midletDisplayId) Process a "display preempt stop" event.
Set the foreground to a given display if a certain display
has the foreground. | public void | handleFatalErrorNotifyEvent(int midletIsolateId, int midletDisplayId) Processes FATAL_ERROR_NOTIFICATION. | public void | handleMIDletActiveNotifyEvent(int midletSuiteId, String midletClassName) Process a MIDlet active notification
MIDletControllerEventConsumer I/F method. | public void | handleMIDletCreateNotifyEvent(int midletSuiteId, String midletClassName, int midletIsolateId, int midletExternalAppId, String midletDisplayName) Process a MIDlet created notification. | public void | handleMIDletDestroyNotifyEvent(int midletSuiteId, String midletClassName) Process a MIDlet destroyed event. | public void | handleMIDletDestroyRequestEvent(int midletIsolateId, int midletDisplayId) Process a MIDlet destroy request event. | public void | handleMIDletForegroundSelectEvent(int onlyFromLaunched) Process a select foreground event by putting the foreground selector
MIDlet in the foreground. | public void | handleMIDletForegroundTransferEvent(int originMIDletSuiteId, String originMIDletClassName, int targetMIDletSuiteId, String targetMIDletClassName) Process an event to transition the foreground from a current display
to a target MIDlet by ID and classname. | public void | handleMIDletPauseNotifyEvent(int midletSuiteId, String midletClassName) Process a MIDlet paused notification. | public void | handleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName) Processes a MIDLET_RESUME_REQUEST event. | public void | handleMIDletRsPauseNotifyEvent(int midletSuiteId, String midletClassName) Handles notification event of MIDlet resources pause. | public void | handleMIDletStartErrorEvent(int midletSuiteId, String midletClassName, int midletExternalAppId, int error, String details) Process a MIDlet start error event. | public void | handlePauseAllEvent() Process a PAUSE_ALL_EVENT. | public void | handleSetForegroundByNameRequestEvent(int midletSuiteId, String midletClassName) Processes SET_FOREGROUND_BY_NAME_REQUEST event. | public void | runTests() Runs all tests. | void | setUp() Initializes the test fixture with random data, creates the stub event
queue, and creates the MIDletControllerEventProducer under test. | void | tearDown() Nulls out the stub event queue and the event producer. | void | testDisplayBackgroundRequestEvent() Tests sendDisplayBackgroundRequestEvent(). | void | testDisplayCreateNotifyEvent() Tests sendDisplayCreateNotifyEvent(). | void | testDisplayForegroundRequestEvent() Tests sendDisplayForegroundRequestEvent(). | void | testDisplayPreemptEvents() Tests sendDisplayPreemptStartEvent() and
sendDisplayPreemptStopEvent(). | void | testMIDletActiveNotifyEvent() Tests sendMIDletActiveNotifyEvent(). | void | testMIDletCreateNotifyEvent() Tests sendMIDletCreateNotifyEvent(). | void | testMIDletDestroyNotifyEvent() Tests sendMIDletDestroyNotifyEvent(). | void | testMIDletDestroyRequestEvent() Tests sendMIDletDestroyRequestEvent(). | void | testMIDletForegroundTransferEvent() Tests sendMIDletForegroundTransferEvent(). | void | testMIDletPauseNotifyEvent() Tests sendMIDletPauseNotifyEvent(). | void | testMIDletResumeRequest() Tests sendMIDletResumeRequest(). | void | testMIDletStartErrorEvent() Tests sendMIDletStartErrorEvent(). |
SUITE_ID | final static int SUITE_ID(Code) | | |
TARGET_CLASS_NAME | final static String TARGET_CLASS_NAME(Code) | | |
TARGET_SUITE_ID | final static int TARGET_SUITE_ID(Code) | | |
amsIsolateId | int amsIsolateId(Code) | | |
currentIsolateId | int currentIsolateId(Code) | | |
displayId2 | int displayId2(Code) | | |
externalId | int externalId(Code) | | |
handleActivateAllEvent | public void handleActivateAllEvent()(Code) | | Process an ACTIVATE_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
|
handleDestroyAllEvent | public void handleDestroyAllEvent()(Code) | | Process a SHUTDOWN_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
It simply calls "shutdown()". In future it shall be merged with
"shutdown()" and substitute it.
|
handleDisplayBackgroundRequestEvent | public void handleDisplayBackgroundRequestEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a background request event.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleDisplayCreateNotifyEvent | public void handleDisplayCreateNotifyEvent(int midletIsolateId, int midletDisplayId, String midletClassName)(Code) | | Process a Display created notification.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display Parameters: midletClassName - Class name of the MIDlet that owns the display |
handleDisplayForegroundRequestEvent | public void handleDisplayForegroundRequestEvent(int midletIsolateId, int midletDisplayId, boolean isAlert)(Code) | | Process a foreground request event.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display Parameters: isAlert - true if the current displayable is an Alert |
handleDisplayPreemptStartEvent | public void handleDisplayPreemptStartEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a "display preempt start" event.
Set the foreground to a given display if a certain display
has the foreground. Used to start preempting.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleDisplayPreemptStopEvent | public void handleDisplayPreemptStopEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a "display preempt stop" event.
Set the foreground to a given display if a certain display
has the foreground. Used to end preempting.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleFatalErrorNotifyEvent | public void handleFatalErrorNotifyEvent(int midletIsolateId, int midletDisplayId)(Code) | | Processes FATAL_ERROR_NOTIFICATION.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending isolate Parameters: midletDisplayId - ID of the sending Display |
handleMIDletActiveNotifyEvent | public void handleMIDletActiveNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Process a MIDlet active notification
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletCreateNotifyEvent | public void handleMIDletCreateNotifyEvent(int midletSuiteId, String midletClassName, int midletIsolateId, int midletExternalAppId, String midletDisplayName)(Code) | | Process a MIDlet created notification.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet Parameters: midletIsolateId - isolate ID of the sending MIDlet Parameters: midletExternalAppId - ID of given by an external applicationmanager Parameters: midletDisplayName - name to show the user |
handleMIDletDestroyNotifyEvent | public void handleMIDletDestroyNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Process a MIDlet destroyed event.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletDestroyRequestEvent | public void handleMIDletDestroyRequestEvent(int midletIsolateId, int midletDisplayId)(Code) | | Process a MIDlet destroy request event.
MIDletControllerEventConsumer I/F method.
Parameters: midletIsolateId - isolate ID of the sending Display Parameters: midletDisplayId - ID of the sending Display |
handleMIDletForegroundSelectEvent | public void handleMIDletForegroundSelectEvent(int onlyFromLaunched)(Code) | | Process a select foreground event by putting the foreground selector
MIDlet in the foreground.
MIDletControllerEventConsumer I/F method.
|
handleMIDletForegroundTransferEvent | public void handleMIDletForegroundTransferEvent(int originMIDletSuiteId, String originMIDletClassName, int targetMIDletSuiteId, String targetMIDletClassName)(Code) | | Process an event to transition the foreground from a current display
to a target MIDlet by ID and classname. If the source display
does not currently own the foreground the request is ignored.
If the target MIDlet is found in the active list then it it set
as the foreground. If not found, then it should be added as
the next display to get the foreground (when it asks).
MIDletControllerEventConsumer I/F method.
Parameters: originMIDletSuiteId - ID of MIDlet from whichto take forefround ownership away, Parameters: originMIDletClassName - Name of MIDlet from whichto take forefround ownership away Parameters: targetMIDletSuiteId - ID of MIDletto give forefround ownership to, Parameters: targetMIDletClassName - Name of MIDletto give forefround ownership to |
handleMIDletPauseNotifyEvent | public void handleMIDletPauseNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Process a MIDlet paused notification.
MIDletControllerEventConsumer I/F method.
TBD: param midletProxy proxy with information about MIDlet
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletResumeRequestEvent | public void handleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName)(Code) | | Processes a MIDLET_RESUME_REQUEST event.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletRsPauseNotifyEvent | public void handleMIDletRsPauseNotifyEvent(int midletSuiteId, String midletClassName)(Code) | | Handles notification event of MIDlet resources pause.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet |
handleMIDletStartErrorEvent | public void handleMIDletStartErrorEvent(int midletSuiteId, String midletClassName, int midletExternalAppId, int error, String details)(Code) | | Process a MIDlet start error event.
Notify from last to first added to allow the listener to
remove itself without causing a missed notification.
MIDletControllerEventConsumer I/F method.
Parameters: midletSuiteId - ID of the MIDlet suite Parameters: midletClassName - Class name of the MIDlet Parameters: midletExternalAppId - ID of given by an external applicationmanager Parameters: error - start error code Parameters: details - start error details |
handlePauseAllEvent | public void handlePauseAllEvent()(Code) | | Process a PAUSE_ALL_EVENT.
MIDletControllerEventConsumer I/F method.
|
handleSetForegroundByNameRequestEvent | public void handleSetForegroundByNameRequestEvent(int midletSuiteId, String midletClassName)(Code) | | Processes SET_FOREGROUND_BY_NAME_REQUEST event.
Set specified MIDlet to foreground.
Parameters: midletSuiteId - MIDlet's suite ID Parameters: midletClassName - MIDlet's class name |
runTests | public void runTests() throws Throwable(Code) | | Runs all tests. If a test throw a NullPointerException,
the most likely cause is that the listener has not registered with
the event queue for that event type.
|
setUp | void setUp()(Code) | | Initializes the test fixture with random data, creates the stub event
queue, and creates the MIDletControllerEventProducer under test.
|
tearDown | void tearDown()(Code) | | Nulls out the stub event queue and the event producer.
|
testDisplayBackgroundRequestEvent | void testDisplayBackgroundRequestEvent()(Code) | | Tests sendDisplayBackgroundRequestEvent().
|
testDisplayCreateNotifyEvent | void testDisplayCreateNotifyEvent()(Code) | | Tests sendDisplayCreateNotifyEvent().
|
testDisplayForegroundRequestEvent | void testDisplayForegroundRequestEvent()(Code) | | Tests sendDisplayForegroundRequestEvent().
|
testDisplayPreemptEvents | void testDisplayPreemptEvents()(Code) | | Tests sendDisplayPreemptStartEvent() and
sendDisplayPreemptStopEvent().
|
testMIDletActiveNotifyEvent | void testMIDletActiveNotifyEvent()(Code) | | Tests sendMIDletActiveNotifyEvent().
|
testMIDletCreateNotifyEvent | void testMIDletCreateNotifyEvent()(Code) | | Tests sendMIDletCreateNotifyEvent().
|
testMIDletDestroyNotifyEvent | void testMIDletDestroyNotifyEvent()(Code) | | Tests sendMIDletDestroyNotifyEvent().
|
testMIDletDestroyRequestEvent | void testMIDletDestroyRequestEvent()(Code) | | Tests sendMIDletDestroyRequestEvent().
|
testMIDletForegroundTransferEvent | void testMIDletForegroundTransferEvent()(Code) | | Tests sendMIDletForegroundTransferEvent().
|
testMIDletPauseNotifyEvent | void testMIDletPauseNotifyEvent()(Code) | | Tests sendMIDletPauseNotifyEvent().
|
testMIDletResumeRequest | void testMIDletResumeRequest()(Code) | | Tests sendMIDletResumeRequest().
|
testMIDletStartErrorEvent | void testMIDletStartErrorEvent()(Code) | | Tests sendMIDletStartErrorEvent().
|
Methods inherited from com.sun.midp.i3test.TestCase | public void assertEquals(Object expected, Object actual)(Code)(Java Doc) public void assertEquals(String message, Object expected, Object actual)(Code)(Java Doc) public void assertEquals(int expected, int actual)(Code)(Java Doc) public void assertEquals(String message, int expected, int actual)(Code)(Java Doc) public void assertFalse(boolean condition)(Code)(Java Doc) public void assertFalse(String message, boolean condition)(Code)(Java Doc) public void assertNotNull(Object object)(Code)(Java Doc) public void assertNotNull(String message, Object object)(Code)(Java Doc) public void assertNotSame(Object expected, Object actual)(Code)(Java Doc) public void assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertNull(Object object)(Code)(Java Doc) public void assertNull(String message, Object object)(Code)(Java Doc) public void assertSame(Object expected, Object actual)(Code)(Java Doc) public void assertSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertTrue(String message, boolean condition)(Code)(Java Doc) public void assertTrue(boolean condition)(Code)(Java Doc) public void declare(String testName)(Code)(Java Doc) public void fail()(Code)(Java Doc) public void fail(String message)(Code)(Java Doc) protected SecurityToken getSecurityToken()(Code)(Java Doc) protected boolean getVerbose()(Code)(Java Doc) public void info(String s)(Code)(Java Doc) abstract public void runTests() throws Throwable(Code)(Java Doc)
|
|
|