[qmtest] adding context variables in a target extension class

Steve Byan smb at egenera.com
Thu Nov 20 14:21:26 UTC 2003


On Nov 19, 2003, at 10:04 PM, Mark Mitchell wrote:
> In the CVS version of QMTest, there is no ContextWrapper class any
> more.  Instead, Context has taken the place of both Context and
> ContextWrapper.  However, the basic idea you're using would still work
> in the same way.

Thanks.

> There's no way to set the default set of context properties other than
> the technique you've discovered.  It's not really all that heavyweight;
> I'd be surprised if you could measure any difference when
> creating/destroying the extra Context objects.

I'm sure you're right. It just felt like I had the wrong design for my 
extension, mostly because I haven't yet grokked the design of QMTest's 
inplementation.

> I think that you wouldn't want to have a single Target change the 
> global
> context because that would affect tests running on other targets as
> well.

If I understand ContextWrappers correctly, I'd only be changing the 
context for tests running on instances of my target class, and the 
variables added to the context would not persist past the invocation of 
my RunTest method.

But in the new implementation, that's a good point; I don't want to be 
making modifications to the global context. I'm using QMTest for 
functional testing of a distributed system, so thus far I've only 
considered having a single test target.

I need to pass a bunch of node hostnames associated with a particular 
test target to shell script tests that implement a distributed system 
test case. These hostnames must be parameters to the test harness, so 
as near as I can tell they have to be passed either in the QMTest 
context file or as attributes to a target extension class. I suppose I 
could hack up a Resource class to go reading external config files, but 
the Target class seemed to be the right home for what I want to do.

Does anyone have any suggestions for a better way to accomplish my goal 
of passing a set of hostname parameters associated with a single 
system-under-test to shell-script tests?

Regards,
-Steve
--------
Steve Byan <smb at egenera.com>
Software Architect
Egenera, Inc.
165 Forest Street
Marlboro, MA 01752
(508) 858-3125




More information about the qmtest mailing list