[Webtest] [webtest][JIRA] Created: (WT-81) Context to be just a field of Step

Denis N. Antonioli (JIRA) webtest@lists.canoo.com
Mon, 22 Aug 2005 11:07:13 +0200 (CEST)


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


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