Hi,I am wondering whether I can help with work on issue 84. I would very much appreciate the stubOnly settings on the mocks. Mockito offers great way of partial implementation of interfaces for test purposes. Not having stubOnly option however disqualifies it from using these mocks: when there are thousands of invocations of mocked methods, mockito quickly goes out of memory.I can help in implementing this feature if anyone points me to the right place. I might be overlooking some things, but is it harder than adding MockSettings.stubOnly() and checking the value of it before captureArgumentsFrom() is called in MockHandler?Best,--Hynek--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/GYhzH281DgoJ.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/sEqCm0aZ844J.
find ./test -name '*.java' | xargs perl -i -pe 's/(?<=[a-z])([A-Z])/_\l$1/g if (/void \S+\(\)/)'
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/EgjAyPOsQvcJ.
Hi Brice,
Best,--Hynek--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/iV8Zv5rH8n8J.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/EgjAyPOsQvcJ.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
Thanks for the feedback. Just before I would start making some changes, question about #2 - I have refactored the MockHandlerImpl.handle() on suggestion by Brice (to "tidy up the handle method"). Should I revert the changes then to be as close as possible to the original version?
Best,--Hynek
On Saturday, July 28, 2012 5:40:01 PM UTC+2, szczepiq wrote:Not bad, thanks a lot for contributing :)I've scanned the code, some feedback (sorry I'm late).1. Very cool you got that working - nice dive in the Mockito codebase. Good thinking about the tests and validation!2. I would avoid making so much changes in the MockHandlerImpl. Perhaps your refactorings are making it better but I just won't have time review them soon :/ We should also try to reduce the complexity of MockHandlerImpl, that is try to not put extra stuff there.3. Due to #2, here's my suggestion on how to go about coding it:-pass mock settings to InvocationContainerImpl so that it can create simpler / no-op version of RegisteredInvocations for stubs.-add a new object that validates the verification. This will be used in MockHandlerImpl. It should also include the toString() validation we already have in VerificationDataImpl, thus making VerificationDataImpl simpler.-Not required to implement this feature but might be useful if we want to keep the bar high :P. We could create a public interface for RegisteredInvocations and make them travel with the mock settings. This way users could pass custom implementations of RegisteredInvocations via settings. The stubOnly() feature would use exactly that. We also would have to expose the verification validation somehow.Hope that helps!Cheers!
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/PjhuXdKR6twJ.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
3. Due to #2, here's my suggestion on how to go about coding it:
-pass mock settings to InvocationContainerImpl so that it can create simpler / no-op version of RegisteredInvocations for stubs.
-add a new object that validates the verification. This will be used in MockHandlerImpl. It should also include the toString() validation we already have in VerificationDataImpl, thus making VerificationDataImpl simpler.
-Not required to implement this feature but might be useful if we want to keep the bar high :P. We could create a public interface for RegisteredInvocations and make them travel with the mock settings. This way users could pass custom implementations of RegisteredInvocations via settings. The stubOnly() feature would use exactly that. We also would have to expose the verification validation somehow.
3. Due to #2, here's my suggestion on how to go about coding it:-pass mock settings to InvocationContainerImpl so that it can create simpler / no-op version of RegisteredInvocations for stubs.
-add a new object that validates the verification. This will be used in MockHandlerImpl. It should also include the toString() validation we already have in VerificationDataImpl, thus making VerificationDataImpl simpler.
-Not required to implement this feature but might be useful if we want to keep the bar high :P. We could create a public interface for RegisteredInvocations and make them travel with the mock settings. This way users could pass custom implementations of RegisteredInvocations via settings. The stubOnly() feature would use exactly that. We also would have to expose the verification validation somehow.
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mockito/-/jJOGdrDYRfAJ.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.