If you're a Java developer, you're familiar with the JUnit project, an open source unit testing framework for Java. With JUnit you write simple classes (test cases) that have a number of methods that use assertions to test various aspects of your code. The only question is that you need to run J2ME test differently.
CLDCUnit can be used as original JUnit when running tests with Java J2SE. Simply create regular JUnit test that extends junit.framework.TestCase and run in Eclipse or Maven.
Because Java 2 Micro Edition (J2ME) dos not have reflection API CLDCUnit needs aditional step to build process that will create reflection data. Bytecode instrumentation is used. Result of the build can be executed on real device.
CLDCUnit project is created by MicroEmulator Team member.
See how it is used to test MicroEmulator in microemu-test-midlet
Use UnitTest library adapted for JavaME. And run the application in MicroEmulator. The only benefit of this approach is ability to run the same tests on real device.
J2MEUnit is a Java 2 Micro Edition (J2ME) library containing a unit testing framework for J2ME applications.
Significant part of application code is not related to UI presentation and can be executed without MIDlet's. Usually this is persistence communications and calculation layers of application.
If you selected MVC design pattern then Model is the perfect target for testing with MicroEmulator. In any case probably your complex application already contains multiple modules (jars) that are finally linked to with MIDlet in application. Test them separately before you build MIDlet.
Build and run UnitTests that are executing you application logic with microemulator-2.0.jar in you classpath. All classes that are using Generic Connection Framework will run perfectly under J2SE without initialization. This way it is much simple to integrate tests into automatic build process and is easier to test complex scenarios.
Don't forget that you will have added benefits of reporting and coverage that comes with standard tools like Eclipse, Emma, Clove.