- returnjmunit and j2meunit are two mobile unit testing projects which are currently merging and are supported in the new release of Netbeans (5.5) - unfortunately these are heavily reliant on the midlet framework extending the Midlet base class and making use of a screen system which differs in some fundamental ways to that of native Blackberry applications. 'bunit' (Blackberry Unit) is based on jmunit but heavily re-written for Blackberry, I'm currently packaging everything into a small library trying to bundle as much possible so the programmer will have to do a minimum amount of setting up to start unit-testing on Blackberry. The image below shows a test of four functions, the first test is created using the code: Assertion a = new Assertion(); public void testfeetToMeters() throws AssertionFailedException { float result = DistanceConversion.feetToMeters(25); a.assertEquals("feetToMeters", 7.62F, result); } This is calling 'assertEquals' in our unit-test library, we pass the name of the test, the correct expected answer and the result of the function we're testing. Sourceforge Project Page |