Issue 347 in mockito: timeout with never

404 views
Skip to first unread message

moc...@googlecode.com

unread,
Jun 1, 2012, 11:24:24 AM6/1/12
to mocki...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 347 by botismar...@gmail.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

It doesn't have any sense to use timeout with atMost. Considering that
never is equivalent to atMost(0), I think it doesn't make sense either to
allow combinations of timeout and never either.

moc...@googlecode.com

unread,
Jun 1, 2012, 3:43:05 PM6/1/12
to mocki...@googlegroups.com
Updates:
Labels: -Priority-Medium Priority-Low

Comment #1 on issue 347 by szcze...@gmail.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

Good point. Next time we make some changes in the area we might look at it
and see what can be done to improve it. I'd say it's not a high priority
item.

moc...@googlecode.com

unread,
Aug 24, 2012, 9:05:28 AM8/24/12
to mocki...@googlegroups.com

Comment #2 on issue 347 by syva...@yahoo.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

It would be nice to have the following functionality:
verify(a.b(), timeout(x).never()): verify that b is not called within x ms.
verify(a.b(), timeout(x).atMost(y)): verify that b is not called more than
y times within x ms.

I agree timeout might be incorrect term here, as we are not waiting for the
condition to become true. Instead we are waiting to see that it stays true.
Unfortunately I cannot come up with any good term for that.

moc...@googlecode.com

unread,
Aug 24, 2012, 12:43:54 PM8/24/12
to mocki...@googlegroups.com

Comment #3 on issue 347 by brice.du...@gmail.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

Hi

The meaning of what you try to achieve is interesting, what
about 'during(x).atMost(y)' ?

moc...@googlecode.com

unread,
Aug 25, 2012, 8:36:31 AM8/25/12
to mocki...@googlegroups.com

Comment #4 on issue 347 by szcze...@gmail.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

I think I'm ok with adding something like during(). I assume It would
always wait until the end of the timeout, whereas timeout() has a chance to
bail out early.

Thanks for the suggestion!

moc...@googlecode.com

unread,
Aug 27, 2012, 3:36:31 AM8/27/12
to mocki...@googlegroups.com

Comment #5 on issue 347 by syva...@yahoo.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

Excellent idea Brice, 'during' sounds very clear!

moc...@googlecode.com

unread,
Jul 31, 2013, 11:35:23 AM7/31/13
to mocki...@googlegroups.com

Comment #6 on issue 347 by PimTe...@gmail.com: timeout with never
http://code.google.com/p/mockito/issues/detail?id=347

I've now put up patches to fix this: there's a pull request deprecating
timeout().never() at https://github.com/mockito/mockito/pull/14, and
another pull request adding an after() method that provides the
functionality you'd expect from timeout() here at
https://github.com/mockito/mockito/pull/16

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

moc...@googlecode.com

unread,
Sep 29, 2014, 9:03:02 AM9/29/14
to mocki...@googlegroups.com
Updates:
Status: Fixed
Labels: Milestone-Release1.10.0

Comment #7 on issue 347 by szcze...@gmail.com: timeout with never
https://code.google.com/p/mockito/issues/detail?id=347

(No comment was entered for this change.)
Reply all
Reply to author
Forward
0 new messages