This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Testing and the fly likes Spring Junit testing using JMock 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 "Spring Junit testing using JMock" Watch "Spring Junit testing using JMock" New topic
Author

Spring Junit testing using JMock

Anand Jain
Greenhorn

Joined: Jul 27, 2009
Posts: 18
I have a Spring maven project and we are going to use JMock to test service/business/DAO layers of my project as suggested by client.
Can somebody please provide me the good link going through which I can understand and implement it?

I am not clear with the term mock objects. What is the need of mock objects? Why should I use it?Also I have heard of other mocking frameworks like Mockito or EasyMock. Is JMock better than those? or Which one is better to use even? This is just for knowledge sake as I will be using JMock only since it is suggested by the client
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

The official getting started guide and cookbook are good.

All three mock frameworks are good. At the moment, Mockito is somewhat more advanced. All three frameworks are still enhancing though. The next version of jMock catches up.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

This question was also posted on stack overflow.

Please read BeForthrightWhenCrossPostingToOtherSites for why you should disclose when you post to more than one site.
 
 
subject: Spring Junit testing using JMock
 
Similar Threads
Testing the code
Help: problem with EasyMock
Automatic Mocking with Spring framework
testing with mock objects
jmock query