I’m trying to work through an article (http://martinfowler.com/articles/mocksArentStubs.html) on mocking with pseudocode in it that I’m implementing, but I’m having trouble finding once (and eq, returnValue, etc.).
I first wanted to use jMock 2.5.1, but it’s too recent compared to the article. Then I tried jMock 1.2.0. I can’t find where to get once.
I’ve grep’d through jMock, EasyMock and Hamcrest sources so far without having found once as an indentifier of any sort.
Googling for returnValue let alone once hasn’t been very helpful either: code that uses these symbols is uniformly posted without import statements.
Thanks for any direction you can give me.
jMock will contain the functionality to perform once but it may not actually contain the static method once. I believe the jMock equivalence will be one.
If you are looking at pseudocode for a static method once, it is more than likely coming from EasyMock. EasyMock definitely has the static method once to describe the situation where an expected mock object method call should happen once and only once.