-
Caroli on JMock with Test-Driven Development (6 messages)
- Posted by: Nitin Bharti
- Posted on: December 04 2006 13:32 EST
In this article, Paulo Caroli introduces the basics of using JMock, a Mock object framework, in conjunction with Test-Driven Development. To illustrate the technique, he works through a case study, the creation of a cache component by means of test-first development with JMock. Read Using JMock with Test-Driven DevelopmentThreaded Messages (6)
- Re: Caroli on JMock with Test-Driven Development by Ankur Kumar on December 05 2006 02:38 EST
- Re: but will it fit-in to existing web-application frameworks... by Steve Cresswell on December 05 2006 03:51 EST
- Re: Caroli on JMock with Test-Driven Development by Gerard Fernandes on December 05 2006 12:32 EST
-
Re: Caroli on JMock with Test-Driven Development by Steve Freeman on December 06 2006 04:25 EST
- Mock Objects sample code by Paulo Caroli on November 01 2007 02:15 EDT
-
Re: Caroli on JMock with Test-Driven Development by Steve Freeman on December 06 2006 04:25 EST
- Nice aricle by ds fsd on December 06 2006 13:37 EST
-
Re: Caroli on JMock with Test-Driven Development[ Go to top ]
- Posted by: Ankur Kumar
- Posted on: December 05 2006 02:38 EST
- in response to Nitin Bharti
It looks good in the view of TDD, but will it fit-in to existing web-application frameworks (primarily MVC) with so many complex object hierarchies and relationships? -
Re: but will it fit-in to existing web-application frameworks...[ Go to top ]
- Posted by: Steve Cresswell
- Posted on: December 05 2006 03:51 EST
- in response to Ankur Kumar
It looks good in the view of TDD, but will it fit-in to existing web-application frameworks (primarily MVC) with so many complex object hierarchies and relationships?
It fits in very nicely with Spring MVC as the framework includes ready-to-run mock objects for Request, Response, Session objects etc. jmockrunner takes care of EJB / JMS objects and can be used in conjunction with jMock. See http://www.java-answers.com/index.php?topic=36.0 for an example -
Re: Caroli on JMock with Test-Driven Development[ Go to top ]
- Posted by: Gerard Fernandes
- Posted on: December 05 2006 12:32 EST
- in response to Ankur Kumar
It looks good in the view of TDD, but will it fit-in to existing web-application frameworks (primarily MVC) with so many complex object hierarchies and relationships?
JMock is especially useful in large projects with many component sub-systems and with complex relationships between objects both within and from other sub-systems. This is so because with JMock it is possible to ensure that: 1. your tests adhere to system boundaries 2. are real unit tests in that they test exactly one class (all other interacting classes are replaced with mocks). JMock needn't necessarily be used to DRIVE design (TDD). JMock can, in conjunction with JUnit or TestNG, be used to VERIFY design, interface contracts and module functionality. -
Re: Caroli on JMock with Test-Driven Development[ Go to top ]
- Posted by: Steve Freeman
- Posted on: December 06 2006 16:25 EST
- in response to Gerard Fernandes
But jMock is intended to help you drive your design. I suggest you read our article that Paolo has quoted where we talk about using Mocks to guide the discovery of types in your application. -
Mock Objects sample code[ Go to top ]
- Posted by: Paulo Caroli
- Posted on: November 01 2007 14:15 EDT
- in response to Steve Freeman
This article's sample code and its up-to-date version is available at http://www.mocksamples.org/ -
Nice aricle[ Go to top ]
- Posted by: ds fsd
- Posted on: December 06 2006 13:37 EST
- in response to Nitin Bharti
this article gave me a lot of new informations. thanks a lot. http://blog.mnagas.com