wood burning stoves*
The moose likes Testing and the fly likes how to write junit for list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "how to write junit for list" Watch "how to write junit for list" New topic
Author

how to write junit for list

Jenifer Rajakumar
Ranch Hand

Joined: Oct 31, 2013
Posts: 34
Hi

Iam very new to junit please guide me and put fundamentals.i tried bit but iam getting error

my code:


junit code i tried


myerror


i don't know it is correct please teach me. in same senoiro iam having 4 test cases please guide me and give foundation
Flaz Four
Greenhorn

Joined: Nov 08, 2013
Posts: 6

Hi,

Just add (), it should be fine



Jenifer Rajakumar
Ranch Hand

Joined: Oct 31, 2013
Posts: 34
Hi


I tried bit

not iam getting error


Please Guide me
Flaz Four
Greenhorn

Joined: Nov 08, 2013
Posts: 6

It seems that testGetInitiateSearchEntities should be declared as public.

Like this

Jenifer Rajakumar
Ranch Hand

Joined: Oct 31, 2013
Posts: 34
Thanks

Now that error solved.

now i tried some thing please check
java code

my junit code


Now iam getting error



From this error i came to know i didn't initialize object, but i didn't know what. please guide me
Flaz Four
Greenhorn

Joined: Nov 08, 2013
Posts: 6

First of all, find what object has null value. The simplest way is printing object, for example


Try it before initialization and after initialization.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to write junit for list
 
Similar Threads
How to write test case for if condition
How to write a JUnit test for List?
how to execute testcase
Mock a new operator
Class being found by classloader but NoClassDefFoundError on newInstance() method