File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Mockit problem for JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mockit problem for JPA" Watch "Mockit problem for JPA" New topic
Author

Mockit problem for JPA

Sudhakar Rao
Ranch Hand

Joined: May 21, 2005
Posts: 36
Hi,
I am newbie to Mockit framework. My application is build on spring mvc, and jpa. The flow is from controller, service layer will call, and my serivce layer will call the DAO layer where I am using JPA's. I want to test my controller using mockit. I tried in the following way but getting null pointer execptions.
I am attaching java file for your refernece. The test class is for controller is as follows.

The exception I am getting is null pointer exception at
ModelAndView acutalModelView=ecpProductionController.getPfgProductionViewResultPage(null, "30415","10-Jul-2011", "01");

The service class is as follows

The DAO class is

Please help me whether I am going in the right direction or not and help me in resolvoing the issue. I have written the test case only for getPfgProductionViewResultPage for the controller.

Any help is appreciated

 
jQuery in Action, 2nd edition
 
subject: Mockit problem for JPA
 
Similar Threads
reCaptcha issue with Spring MVC
Spring exception Neither BindingResult nor plain target object for bean name 'name' a
sax parser with cdata
Inconsistent stack height 2 != 1
Backend validation - a complete example