[Webtest] [webtest][JIRA] Closed: (WT-81) Context to be just a field of Step
Denis N. Antonioli (JIRA)
webtest@lists.canoo.com
Mon, 27 Mar 2006 14:58:49 +0200 (CEST)
[ http://webtest-community.canoo.com/jira/browse/WT-81?page=history ]
Denis N. Antonioli closed WT-81:
--------------------------------
Resolution: Fixed
Fix Version: future versions
Deprecated methods removed in R_1221.
> Context to be just a field of Step
> ----------------------------------
>
> Key: WT-81
> URL: http://webtest-community.canoo.com/jira/browse/WT-81
> Project: WebTest
> Type: Task
> Reporter: Denis N. Antonioli
> Assignee: Denis N. Antonioli
> Fix For: future versions
>
> In the present code, context has an ambivalent status:
> it is defined as a field of Step, with getter and setter, yet it is passed to many methods of Step:
> doExecute(Context),
> execute(Context),
> nullResponseCheck(Context),
> verifyParameters(Context),
> notifyCompleted(Context),
> notifyStarted(Context),
> notifySuccess(Context),
> getStepLabel(Context),
> getStepLabelBrief(Context)
> Furthermore, Step also knows execute() (empty method, inherited from Task) and verifyParameters().
> Discussion on the mailing list ended with:
> Paul King:
> So we end up with either:
> step.setContext(context);
> step.doExecute();
> or (just):
> step.doExecute(context);
> if it wasn't clear before.
> Marc Guillemot:
> I think that the first solution is cleaner, because:
> - the setContext isn't just for tests anymore (generally I dislike it when test purposes force to have public methods which shouldn't be used in a normal case)
> - steps don't need to pass the context to their utility methods or to save it locally: it's a functionnality already provided by the base Step class
> This task proposes hence:
> 1) Context is set for a step with step.setContext(context); this occurs sometime before the call to step.execute()
> 2) Context is dropped from all other methods of Step;
> 3) Methods xxx(Context) are marked as deprecated, converted to
> xxx(Context c) { setContext(c): xxx(); },
> and will be removed from final 1.7.
> 4) This change can (later?) propagate down in the class hierarchy.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://webtest-community.canoo.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira