From: mark m. <ma...@et...> - 2002-05-22 21:25:29
|
Hello all, I am relatively new to the world of Mock Objects and have come across your implementation. I found a good reason to use the MockAttributes and MockAttribute classes and found that the implementations are a bit limiting. For example MockAttributes' get(String name) method does not use the name parameter at all and returns the first item found in an ArrayList. It also removes that item from ArrayList. I was wondering if this limited implementation was intended (based on some Mock Object Philosophy that I am unaware of) or was just choosen because it got the job done quickly. If it was the latter, I think I might be interested in providing patches if people would find them useful. thanks in advance... mark |
From: <Vin...@ge...> - 2002-05-23 19:36:59
|
I don't know anything about the naming stuff, but you're welcome to send a patch to enhance the functionality of the mock. I think some guy somewhere will find the time to review it and apply it if it makes sense :-) Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > mark mascolino > Sent: Wednesday, May 22, 2002 5:30 PM > To: moc...@li... > Subject: [MO-java-dev] MockAttributes > > > > Hello all, > > I am relatively new to the world of Mock Objects and have > come across your > implementation. I found a good reason to use the MockAttributes and > MockAttribute classes and found that the implementations are > a bit limiting. > For example MockAttributes' get(String name) method does not > use the name > parameter at all and returns the first item found in an > ArrayList. It also > removes that item from ArrayList. > > I was wondering if this limited implementation was intended > (based on some > Mock Object Philosophy that I am unaware of) or was just > choosen because it > got the job done quickly. If it was the latter, I think I might be > interested in providing patches if people would find them useful. > > thanks in advance... > mark > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > |
From: Jeff M. <je...@mk...> - 2002-05-27 09:27:24
Attachments:
MockAttributes.java
|
The idea is to try and separate the data which is used by the class your testing and the data created/manipulated by the class your testing. Also using a list lets you know more about what is actually happening if the get(String name) did a lookup to return a value you could make the call 1000 times instead of once an not know about it. If you provide a list you eventually run out of things in the list to return and the test fails. There is now a class called ReturnObjectList which formalizes this process ReturnObjectList list = new ReturnObjectList("a list of stuff"); ... list.addObjectToReturn(...); ... return list.nextObjectToReturn(); MockAttributes should be changed to use this. I'm happy to change it but since I'm in the middle of an office move committing it to cvs is a little convoluted. What should be done is to name the argument to get method an expected one. Actually I'll just attach the changes (not in diff format as I can't see cvs :( ). What needs to be done though is to On Wed, 2002-05-22 at 22:29, mark mascolino wrote: > > Hello all, > > I am relatively new to the world of Mock Objects and have come across your > implementation. I found a good reason to use the MockAttributes and > MockAttribute classes and found that the implementations are a bit limiting. > For example MockAttributes' get(String name) method does not use the name > parameter at all and returns the first item found in an ArrayList. It also > removes that item from ArrayList. > > I was wondering if this limited implementation was intended (based on some > Mock Object Philosophy that I am unaware of) or was just choosen because it > got the job done quickly. If it was the latter, I think I might be > interested in providing patches if people would find them useful. > > thanks in advance... > mark > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- |