Re: [Http-webtest-general] Re: perl objects in HTTP::WebTest
Brought to you by:
m_ilya,
richardanderson
From: Gerry F. <ga...@cs...> - 2003-04-14 12:03:06
|
Illya, Sorry I haven't responded - I got sidetracked for a week. I think it's good enough for me to know that this should be working; I assume I just have a bug in my code. I'd rather not waste your time trying to debug my code (although if you're interested, I'm quite willing to mail it all to you). I hadn't looked into plugins yet. Perhaps that's the way I should be going, since the more time I spend at this, the more code I write in the on_response hook. I guess that's where I'll head now... Thanks for your help. Gerry On Fri, 04 Apr 2003 00:05:24 +0400 Ilya Martynov <il...@ma...> wrote: > >>>>> On Thu, 3 Apr 2003 09:46:41 -0500, Gerry Finkel > ><ga...@cs...> said: > > GF> All, > GF> [..snip..] > > GF> I have a base class called TestCase. Extended from that is a class > GF> for a specific page/servlet that I'm interacting with. I seem to > GF> be corrupting some data (specifically my URL) after several > GF> gets/posts are sent to the servlet. > > GF> Below is several chunks of code which I hope will explain what I'm > GF> doing. There's a comment in the leftmost column where I see the > GF> problem. Each of my classes have genFunc() methods for generating > GF> arrays of URLs which generate the queries I need. I do things like > > GF> my $numlist = Csf::ListMgmt->new(); > GF> $webtest->run_tests($numlist->genGetWholeList($listid)); > > GF> to generate my test runs. > > GF> I guess my main question is, is it safe to reference $self inside > GF> on_request? And can I say things like $self->anotherMethod() > GF> inside on_request? Is this just a bad thing to do? > > There is nothing wrong with it. You have a closure and unless Perl has > a bug it should work just as you expect it to work: i.e when > HTTP::WebTest calls it you get your Csf::ListMgmt object inside of > your on_request handler and you should be able to call its methods. > > Can you elaborate 'I seem to be corrupting some data ...' please? Do > you mean that HTTP::WebTest's objects change unexpectedly or do you > mean that Csf::ListMgmt object changes unexpectedly? > > BTW it is hard to tell for sure without seeing all code but should not > be it easier to rewrite your testing code as a plugin instead of using > on_request hooks? > > GF> [..snip..] > > -- > Ilya Martynov, il...@ip... > CTO IPonWEB (UK) Ltd > Quality Perl Programming and Unix Support > UK managed @ offshore prices - http://www.iponweb.net > Personal website - http://martynov.org > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Http-webtest-general mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/http-webtest-general -- Gerry Finkel phone (732)302-0222 ext. 6614 ga...@cs... fax (732)302-0799 MQSS pager (800) 759-8888 pin 1909963 As often happens, once we had a few songs finished that we liked, the newer ones started to get weirder. Daring grows out of confidence (or what the ancient Greeks called "hubris," I guess). Neil Peart |