It's really hard to overstate the significance of this. It's changed the way I write and test code. It's very refreshing to be able to start out with a concrete class and write code that does stuff, rather than code that merely talks about doing stuff.JMock can be used for striking a balance between an accurate specification of a unit's required behavior and a flexible test that allows easy evolution of the code base.
-
Relax: You Can (Mostly) Stop Using Java Interfaces For Testing (5 messages)
- Posted by: Eugene Ciurana
- Posted on: March 09 2010 10:07 EST
Are you tired of turning every non-trivial class into an interface, and then create an "Impl" that actually does the work when mocking objects for testing? Do you know about JMock's ClassImposterizer? It allows you to mock instances without calling the constructor of the mocked class, ultimately helping you write and test your code faster. George Armhold writes:Threaded Messages (5)
- Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing by Jess Holle on March 09 2010 16:21 EST
- Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing by Marc Stock on March 10 2010 03:31 EST
- Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing by Time PassX on March 10 2010 10:53 EST
- Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing by Jon Alvarado on March 10 2010 12:50 EST
-
Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing[ Go to top ]
- Posted by: Jess Holle
- Posted on: March 09 2010 16:21 EST
- in response to Eugene Ciurana
Or you could just use jmockit... -
Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing[ Go to top ]
- Posted by: Marc Stock
- Posted on: March 10 2010 03:31 EST
- in response to Jess Holle
Or you could just use Mockito... -
Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing[ Go to top ]
- Posted by: Time PassX
- Posted on: March 10 2010 10:53 EST
- in response to Eugene Ciurana
or you could use easymock + the class extension. It's been around for years. How is this news? -
Re: Relax: You Can (Mostly) Stop Using Java Interfaces For Testing[ Go to top ]
- Posted by: Jon Alvarado
- Posted on: March 10 2010 12:50 EST
- in response to Eugene Ciurana
I prefer the Unitils http://unitils.com/ mock testing framework. -
Hi,[ Go to top ]
- Posted by: Yrng Weng
- Posted on: June 27 2011 08:20 EDT
- in response to Jon Alvarado
You got a really useful blog I have been here reading for about an hour. pass4sure E20-591 Useful information like this one must be kept and maintained so I will put this one on my bookmark list! pass4sure 642-832 Thanks for this wonderful post and hoping to post more of this blog here. pass4sure 642-437 I am a newbie and your success is very much an inspiration for me.