07-21-2009 10:14 AM
07-21-2009 10:17 AM
07-21-2009 10:54 AM
I'm also using normal junit tests and try to split my BlackBerry code from pure java code.
There a lot of simulator based frameworks around. An alternative to j2meunit would be B-Unit: http://sourceforge.net/projects/b-unittesting/ which is based on RIM CLDC application.
07-21-2009 11:05 AM
Hi,
Thank you very much for quick reply.
Can you please tell me how to work with bunit?
07-21-2009 11:23 AM
There was a session at last years BlackBerry developer conference about it.
Here are some of the points from the slide about bunit:
example:
public void test(int testNumber) throws Throwable
{
switch (testNumber)
{
case 0:
testDoSomethingThatShouldBeTested();
break;
}
}
Just use normal assert methods in your tests:
see link
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.
07-21-2009 11:34 AM
07-21-2009 12:01 PM - last edited on 07-21-2009 02:54 PM
+1 to using regular junit and separating as much code as possible into a pure java module.
BlackBerry platform lacks reflection. Leaving the responsibility for enlisting tests to the developer. This is a lot of over-head and can lead to a stituation where tests don't get executed on "run all".
Compared to a desktop computer, the BlackBerry platform is slow. In XML parsing, the simulator can be 2 times or even 3 times faster than a Bold device. However, this is still slow compared to a desktop computer which is over 10 times faster than a Bold device in XML parsing.
On the desktop it's possible to write test harnesses using latest JAVA language syntax, and a much bigger API.
As an added bonus -which may or may not be important in a specific project- the pure java code is portable to other phones, webapp, desktop app, etc.
Cheers, Barak.
07-21-2009 12:04 PM
I want to test blackberry application and its completely RIM specific api.
07-22-2009 12:53 AM
Hi,
If not bunit means is there any other tool which i can do unit testing my blackberry application(Using RIM API)?
Please update me soon, as it is very urgent.
07-22-2009 02:55 AM
We used BUnit for specific test and had no problems.
That the project is not active isn't much a problem, it was build on a different unit-testing framework (jmunit) which still exists.
Give it a try.