Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EasyMock dummy question

 
nlhma nlhmaLastName
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
nlhma nlhmaLastName
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh so it is the way EasyMock 3 works? I did it like in my code because I saw some examples from EasyMock 2.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic