I've been thinking about this and I find it a little inconsistent. We're
calling addCommand() for all data that need to be passed to the server
side. However, we don't call this for the id. Instead we call
setUniqueId() (BTW, am I wrong in thinking that an id is always unique -
Otherwise, what's the point?).
I would have thought the id to be some data for the server side too.
With your nice refactoring you have separated user data from cactus data
in the request (which is good). Maybe we go one step further and add a
class containing all cactus-related data of the request.
For example:
WebRequest.setRequestCommands(RequestCommandData)
RequestCommandData
{
setTestClassName()
setTestMethodName()
setAutoSession()
setUniqueId()
[...]
getTestClassName()
[...]
saveToRequest()
loadFromRequest()
}
Now, thinking about it, we may want to consider the id as an intrinsic
field for a WebRequest instead of a command data. However, I don't think
we're using it for anything else than a command data, so we might not
overdesign it and put it in the command data?
This leads the path for a future ResponseCommandData class.
BTW, is "Command" the right word?
It's rather some internal data. Something like "setInternalData(),
RequestInternalData, ResponseInternalData". But there's must be a better
name than "internal" for sure... :-)
What do you all think?
Thanks
-Vincent
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 22 June 2003 04:51
> To: [EMAIL PROTECTED]
> Subject: cvs commit: jakarta-
> cactus/framework/src/java/share/org/apache/cactus
> AbstractWebServerTestCase.java
>
[snip]
> -
theRequest.addParameter(HttpServiceDefinition.CLASS_NAME_PARAM,
> - this.getClass().getName(), WebRequest.GET_METHOD);
> -
> theRequest.addParameter(HttpServiceDefinition.METHOD_NAME_PARAM,
> - this.getCurrentTestMethod(), WebRequest.GET_METHOD);
> -
> theRequest.addParameter(HttpServiceDefinition.AUTOSESSION_NAME_PARAM,
> - theRequest.getAutomaticSession() ? "true" : "false",
> - WebRequest.GET_METHOD);
> + addCactusCommand(HttpServiceDefinition.CLASS_NAME_PARAM,
> +
this.getClass().getName(),
> + theRequest);
> +
addCactusCommand(HttpServiceDefinition.METHOD_NAME_PARAM,
> +
this.getCurrentTestMethod(),
> + theRequest);
> +
addCactusCommand(HttpServiceDefinition.AUTOSESSION_NAME_PARAM,
> +
theRequest.getAutomaticSession() ?
> "true" : "false",
> + theRequest);
> +
> + theRequest.setUniqueId(generateUniqueId());
[snip]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]