Java Doc for TestMIDletControllerEventProducer.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » main » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.main 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
final static  StringCLASS_NAME
    
final static  StringDISPLAY_NAME
    
final static  StringERROR_DETAILES
    
final static  intSUITE_ID
    
final static  StringTARGET_CLASS_NAME
    
final static  intTARGET_SUITE_ID
    
 intamsIsolateId
    
 intcurrentIsolateId
    
 intdisplayId
    
 intdisplayId2
    
 interrorCode
    
 intexternalId
    
 MIDletControllerEventListenerlistener
    
 MIDletControllerEventProducerproducer
    
 EventQueuequeue
    
 Randomrand
    


Method Summary
public  voidhandleActivateAllEvent()
     Process an ACTIVATE_ALL_EVENT.
public  voidhandleDestroyAllEvent()
     Process a SHUTDOWN_ALL_EVENT. MIDletControllerEventConsumer I/F method. It simply calls "shutdown()".
public  voidhandleDisplayBackgroundRequestEvent(int midletIsolateId, int midletDisplayId)
     Process a background request event.
public  voidhandleDisplayCreateNotifyEvent(int midletIsolateId, int midletDisplayId, String midletClassName)
     Process a Display created notification.
public  voidhandleDisplayForegroundRequestEvent(int midletIsolateId, int midletDisplayId, boolean isAlert)
     Process a foreground request event.
public  voidhandleDisplayPreemptStartEvent(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  voidhandleDisplayPreemptStopEvent(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  voidhandleFatalErrorNotifyEvent(int midletIsolateId, int midletDisplayId)
     Processes FATAL_ERROR_NOTIFICATION.
public  voidhandleMIDletActiveNotifyEvent(int midletSuiteId, String midletClassName)
     Process a MIDlet active notification MIDletControllerEventConsumer I/F method.
public  voidhandleMIDletCreateNotifyEvent(int midletSuiteId, String midletClassName, int midletIsolateId, int midletExternalAppId, String midletDisplayName)
     Process a MIDlet created notification.
public  voidhandleMIDletDestroyNotifyEvent(int midletSuiteId, String midletClassName)
     Process a MIDlet destroyed event.
public  voidhandleMIDletDestroyRequestEvent(int midletIsolateId, int midletDisplayId)
     Process a MIDlet destroy request event.
public  voidhandleMIDletForegroundSelectEvent(int onlyFromLaunched)
     Process a select foreground event by putting the foreground selector MIDlet in the foreground.
public  voidhandleMIDletForegroundTransferEvent(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  voidhandleMIDletPauseNotifyEvent(int midletSuiteId, String midletClassName)
     Process a MIDlet paused notification.
public  voidhandleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName)
     Processes a MIDLET_RESUME_REQUEST event.
public  voidhandleMIDletRsPauseNotifyEvent(int midletSuiteId, String midletClassName)
     Handles notification event of MIDlet resources pause.
public  voidhandleMIDletStartErrorEvent(int midletSuiteId, String midletClassName, int midletExternalAppId, int error, String details)
     Process a MIDlet start error event.
public  voidhandlePauseAllEvent()
     Process a PAUSE_ALL_EVENT.
public  voidhandleSetForegroundByNameRequestEvent(int midletSuiteId, String midletClassName)
     Processes SET_FOREGROUND_BY_NAME_REQUEST event.
public  voidrunTests()
     Runs all tests.
 voidsetUp()
     Initializes the test fixture with random data, creates the stub event queue, and creates the MIDletControllerEventProducer under test.
 voidtearDown()
     Nulls out the stub event queue and the event producer.
 voidtestDisplayBackgroundRequestEvent()
     Tests sendDisplayBackgroundRequestEvent().
 voidtestDisplayCreateNotifyEvent()
     Tests sendDisplayCreateNotifyEvent().
 voidtestDisplayForegroundRequestEvent()
     Tests sendDisplayForegroundRequestEvent().
 voidtestDisplayPreemptEvents()
     Tests sendDisplayPreemptStartEvent() and sendDisplayPreemptStopEvent().
 voidtestMIDletActiveNotifyEvent()
     Tests sendMIDletActiveNotifyEvent().
 voidtestMIDletCreateNotifyEvent()
     Tests sendMIDletCreateNotifyEvent().
 voidtestMIDletDestroyNotifyEvent()
     Tests sendMIDletDestroyNotifyEvent().
 voidtestMIDletDestroyRequestEvent()
     Tests sendMIDletDestroyRequestEvent().
 voidtestMIDletForegroundTransferEvent()
     Tests sendMIDletForegroundTransferEvent().
 voidtestMIDletPauseNotifyEvent()
     Tests sendMIDletPauseNotifyEvent().
 voidtestMIDletResumeRequest()
     Tests sendMIDletResumeRequest().
 voidtestMIDletStartErrorEvent()
     Tests sendMIDletStartErrorEvent().

Field Detail
CLASS_NAME
final static String CLASS_NAME(Code)



DISPLAY_NAME
final static String DISPLAY_NAME(Code)



ERROR_DETAILES
final static String ERROR_DETAILES(Code)



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)



displayId
int displayId(Code)



displayId2
int displayId2(Code)



errorCode
int errorCode(Code)



externalId
int externalId(Code)



listener
MIDletControllerEventListener listener(Code)



producer
MIDletControllerEventProducer producer(Code)



queue
EventQueue queue(Code)



rand
Random rand(Code)





Method Detail
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)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.