Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
sadanala
Posts: 59
Registered: 03-10-2009

Re: How to do unit testing my Blackberry Application

From where i can download entire BUnit?

 

From this url "http://sourceforge.net/projects/b-unittesting/" i downloaded zip file which contains only src folder. how to make use of that...

Please use plain text.
Developer
dpreussler
Posts: 212
Registered: 07-18-2008

Re: How to do unit testing my Blackberry Application

the source contains everything you need.

there is no magic :smileywink:

 

jfisher\

contains an application with screen for showing results including:

 

DistanceConversion.java

is the class they test

 

DistanceConversionTest.java

contains the test code

 

unittestApp.java

show how the call the test

 

 

jmunit\

contains "unittesting framework" classes 

 

 

If your problem was solved, please mark answer as "Accepted solution"
If your want to thank, click the "kudo" symbol
___________
visit me: http://mobilejavadevelopment.blogspot.com/
visit the Berlin BlackBerry Developer Group: http://berlinblackberrydevelopers.blogspot.com/
Please use plain text.
New Developer
sadanala
Posts: 59
Registered: 03-10-2009

Re: How to do unit testing my Blackberry Application

Hi Thank you very much for your kind support. i'm able to test my application using bunit.
Please use plain text.
Visitor
TheKernal
Posts: 1
Registered: 03-12-2010
My Carrier: AIRTEL

Re: How to do unit testing my Blackberry Application

Hello,

 

 

 
Thanks and Regards
Rajiv Sharma
Please use plain text.
Regular Contributor
lyhoanghai
Posts: 71
Registered: 03-24-2010
My Carrier: Vodaphone

Re: How to do unit testing my Blackberry Application

Just copy bunit source code to your project

(I prefer to create a new source folder named test for it.)

 

Have a look at jfisher.logic.test.unittestApp and run this class (it contains a main() function) You will know how to test your application immediately,

- DistanceConversion is a sample class

- DistanceConversionTest is the testing class.

 

 

 

Please use plain text.
Regular Contributor
lyhoanghai
Posts: 71
Registered: 03-24-2010
My Carrier: Vodaphone

Re: How to do unit testing my Blackberry Application

There is one problem :

In project there are 2 main() method:

- main() of bunit

- main() of our application.

 

Is there any quick way to choose which main() method is executed ?

 

Thanks

Please use plain text.
Visitor
GalR
Posts: 1
Registered: 08-25-2010

Re: How to do unit testing my Blackberry Application

Yes there is.

You can define an Alternate Entry Point in the application descriptor xml and add an application argument (I used "bunit" for example).

Then, in the main() of my application I have the following code:

 

 

if (args.length == 1 && args[0].equals("bunit")) {
// Unit tests
       unittestApp instance = new unittestApp();
       instance.enterEventDispatcher();
}

 

 

Now, on the blackberry home screen I have an additional application icon for unit tests.

Please use plain text.
Contributor
vishalspatil
Posts: 38
Registered: 07-14-2010

Re: How to do unit testing my Blackberry Application

Hi,

 

Is there any tool which gives code coverage information based on unit test covered in bbunit?

 

e.g. Clover, Eclemma etc tools refers junit test results and gives code coverage information.



Please use plain text.