[Webtest] Re: [dev] refactoring

Denis N. Antonioli webtest@lists.canoo.com
Thu, 25 Aug 2005 21:35:43 +0200


I've created a task in jira for this: <http://webtest-=20
community.canoo.com/jira/browse/WT-81>.

Is there any comment on it?

Best
     dna

On 4 ao=FBt 05, at 19:12, Marc Guillemot wrote:

>> So we end up with either:
>>    step.setContext(context);
>>    step.doExecute();
>> or (just):
>>    step.doExecute(context);
>> if it wasn't clear before.
>>
>
> I think that the first solution is cleaner, because:
> - the setContext isn't just for tests anymore (generally I dislike =20
> it when test purposes force to have public methods which shouldn't =20
> be used in a normal case)
> - steps don't need to pass the context to their utility methods or =20
> to save it locally: it's a functionnality already provided by the =20
> base Step class
>
> This would make it just like Project or Target for each Ant Task or =20=

> like a ServletContext for a Servlet.
>
> One step further my prefered solution would be to set the context =20
> while the steps are added to the webtest and just to call execute() =20=

> on each of them from the Engine (which would calls doExecute() for =20
> Steps). This would allow to handle Webtest and non-Webtest exactly =20
> the same at this place.
>
> Marc.


--=20
Education was like a posthole digger, a good tool, very expensive,
but worthless unless you needed postholes dug.
   -- Chris Offutt, "The Good Brother"