From: veny <ve...@p2...> - 2003-09-17 02:24:56
|
Hi Steve, Thanks for your reply. What i actually meant was that i want my mock class to take in expectation of a method being called and verify whether the method has been called at the end (i.e. when .verify() method is called). I understand dynamic.Mock.expect(String methodName) does that. I cant use dynamic.Mock as the dynamic.Mock can only mock an interface, but i need to mock a class implementation. So my issue is how to write my mock class that so that it can perform a function like dynamic.Mock.expect(String methodName)? Any idea? Thanks lots. Veny -----Original Message----- From: Steve Freeman [mailto:st...@m3...] Sent: Tuesday, September 16, 2003 3:09 PM To: ve...@p2... Cc: 'Francois Beausoleil'; MockObject users (E-mail); MockObjects devs (E-mail) Subject: Re: [MO-java-users] RE: [MO-java-dev] creating a dynamic mock error - com.packagename.classname is not an interface. veny wrote: > I have another question thought. How should i write the equivalent of > methods 'dynamic.Mock.expect(String methodName)' and > 'dynamic.Mock.expectAndReturn(String methodName, java.lang.Object obj)' in > own Mock object? If you mean when writing a mock object using the dynamic libraries, then no. The Dynamic Mock will do the work. If you mean, when writing your own mock objects from scratch, then you should write some kind of expectation, but how you write that is up to you. S. |