From: veny <ve...@p2...> - 2003-09-12 01:39:24
|
Hi all, I am new to mockobject and looking through the DynaMock class. Could somebody give me some idea, what does the following methods in com.mockobjects.dynamic.Mock class do? expectAndReturn(java.lang.String methodName, ConstraintMatcher args, java.lang.Object result) expectAndReturn(java.lang.String methodName, java.lang.Object singleEqualArg, boolean result) I understand the above methods is setting the return value for the named method. But some questions: - How does ConstraintMatcher works? - For the second method, what is the use of parameter singleEqualArg? - These methods are name expectAndReturn, does it implies that if the named method is not called, it will throw an error? - How bout if the codes have methods overloading, how does expectAndReturn know which method i am referring to? matchAndReturn(java.lang.String methodName, java.lang.Object result) How is this different from expectAndReturn? The javadoc has rather limited explanation, any recommendation to sites that have sample or more detailed explanation? Thanks lots. Veny |