• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to test the CLDC-compliant application?

 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Wireless Toolkit 2.1 to test the MIDlets... But I just would like to know how to test the applcations that are titled to be pure CLDC applications... Of course, I know that CLDC applcations can have main() method as a gate to the applcations, but if I try to launch the application in WTK, it gives InstantiationException, which seems that WTK cannot instantiante my CLDC application....

Help!
 
Sathya Srinivasan
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure why you want to test the CLDC separately. My understanding is that all the J2ME-based applications are typically run in a container - which is typically the device's Application Management Software.

This is typically because the AMS can pass appropriate initialization parameters based on the specific device where the application is running (like the protocols that are available for the device, etc.).

This is why the main() method is disabled (by making the AMS or the simulator throw an InstantiationException), because if invoked using this mechanism, these initialization parameters will not be set, and hence, the application may not behave as expected.

This is similar to running a Servlet directly. You can very well have a main() method in a Servlet. But what is the use calling it? Only when the Servlet is run in a container, the container can set the appropriate path, context, session, etc.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sathya,
I can see that what you said is reasonable and it is what it should be... But I just would like to know if there is some other reason that CLDC specification mandate the use of main() method as the execution point of CLDC-compliant application... Why does it need main() method, while MIDlet's AMS is all we need for a J2ME application?

Thanks a lot for your great explanation above...
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem as Ko Ko Naing's - just don't know how to run and test out the CLDC application. Supposed there is a way to test it out since the Sun website also provides some CLDC examples:
http://developers.sun.com/techtopics/mobility/configurations/samples/index.html. How to run those examples?
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alibabra Sanjie:
I have the same problem as Ko Ko Naing's - just don't know how to run and test out the CLDC application. Supposed there is a way to test it out since the Sun website also provides some CLDC examples:
http://developers.sun.com/techtopics/mobility/configurations/samples/index.html. How to run those examples?


Fortunately, I found the link provided by Alibabra is pretty useful for me as well... But if we can figure out how to test them, it would be really great for us...

But for now, let's wait for some experts to reply us...
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the sample of "CDC and Foundation Profile" gives us the hint. Maybe we should follow the similar steps, but using the CLDC instead of CDC, use the kmv instead of cmv, use the CLDC libraries and class path, instead of CDC to test out the CLDC applications.
[ August 23, 2004: Message edited by: Alibabra Sanjie ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alibabra Sanjie:
I believe that the sample of "CDC and Foundation Profile" gives us the hint. Maybe we should follow the same steps, but using the CLDC instead of CDC, use the kmv instead of cmv, use the CLDC libraries and class path, instead of CDC to test out the CLDC applications.


But I have no idea about them... well, I should at least have a look at them...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic