Strange Brouhaha

Saturday, November 25, 2006

Your Mobile JUnit Tip (and Gripe) of the Day

If you're doing JavaME development (for a cell phone or other small, mobile device), and you're using Sony Ericsson's Mobile JUnit to do your unit testing (and if you're not using it, you're not doing unit testing and you're a bad person), pay attention to the documentation. When they say that Mobile JUnit will attempt to guess the path to your wireless toolkit if you don't specify a path to it, they're not kidding.

The problem--and here's the gripe--is that this information is not included in the whitepaper on Mobile JUnit! It's actually in the Java ME Developer's Guide for Sony Ericsson phones. This is a problem because Mobile JUnit is designed to work with any wireless toolkit, not just Sony Ericsson's, so you might not necessarily think to download Sony Ericsson's documentation, and the MJU whitepaper makes no mention of it. At least, I don't think it does.

The integration with Eclipse (and NetBeans) is limited to creating and editing the tests. You can't create an application launch configuration for Mobile JUnit--which is why they keep saying that you have to use Ant (or the command line) to launch the tests.

Anyway, in your build.xml file, you need to follow the recommendations in the MJU whitepaper/SEMC Developer's Guide, plus add <arg value="--wtk:<PATH>" /> to the java task. (Obviously, you need to replace <PATH> with the proper, non-space-containing path.) When you run the Ant build and select the appropriate target, everything should build and run.


Post a Comment

<< Home