aspose file tools
The moose likes Testing and the fly likes EasyMock dummy question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Reply Bookmark "EasyMock dummy question" Watch "EasyMock dummy question" New topic
Author

EasyMock dummy question

nlhma nlhmaLastName
Greenhorn

Joined: Dec 05, 2010
Posts: 4
Hi,

I wrote the following small piece of code to get familiar with EasyMock and somehow the unit test always failed (AssertionFailedError: expected:<0> but was: <99>):



I am using EasyMock 3.0, cglib 2.2, objenesis 1.2, asm 3.3, and junit 4.0. Could you guys please help let me know what went wrong with the code?

Thank you very much.
Henri Tremblay
Greenhorn

Joined: May 21, 2009
Posts: 7
That's because you are creating your mock using the static EasyMock.createMock method and then replaying and verifying the mock control.

To simplify your code and make it work you can do the following:



Henri Tremblay
Senior architect
Octo Technology
nlhma nlhmaLastName
Greenhorn

Joined: Dec 05, 2010
Posts: 4
Oh so it is the way EasyMock 3 works? I did it like in my code because I saw some examples from EasyMock 2.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: EasyMock dummy question
 
Similar Threads
Strange bug in a class I wrote (not sure how to explain in title)
A little help with a null pointer exception
java.io.IOException: Premature EOF
Out of bounds exception in code
help convert java code to pseudo code