From: Vincent M. <vm...@pi...> - 2003-05-12 17:37:38
|
Hi, I've started migrating my existing project to the new Dynamic Mock API and I have the following questions (maybe this could be the start of a migration guide or user guide?): - what is now replacing the setupDefaultResult() method? Ex: mockRequest.setupDefaultResult(String.class, null); - what's the difference between expect*() and match*()? It seems to me that the verify() will trigger a check to verify that the expect*() calls did actually happen whereas this would not be checked for the match*() ones? Is that correct? - I've started looking at the src\examples\com\mockobjects\examples\dynamic\ SimpleServletTest.java example. It doesn't seem to be finished though and is missing some comments. But that would be the best help for those starting with the new dyna Mock API. Some questions: - I don't understand what's the purpose of the Timer class. Also, it wasn't in the testDoGetOldStyle() method. I think the Timer is muddying the example and should be removed altogether (unless there's something I don't understand!). - What's the point of using the second parameter (i.e. "response") in: new OrderedMock(HttpServletResponse.class, "response"); - At some point, it says: " // Proposed enhancement to allow individual ordering". Is it done? As the http response is an ordered mock, isn't the implemented solution already doing the same as what is in the comments? - Is the ConstraintMatcher[] supposed to be used internally or used by the user? It is not used in the sample servlet test. In other words, how would you translate the following (old style): mockRequest.expectVoid("setAttribute", new Constraint[] { C.eq("result"), C.IS_ANYTHING }); Thanks -Vincent |