Re: [tclwebtest] use tclwebtest from AOLserver?
Status: Abandoned
Brought to you by:
tils
From: Andrew P. <at...@pi...> - 2003-09-29 12:28:57
|
On Sun, Sep 28, 2003 at 06:37:42PM +0000, Tilmann Singer wrote: > * Andrew Piskorski <at...@pi...> [20030927 15:36]: > > E.g., are you loading the procs into AOLserver or exec'ing tclsh? Are > > you strictly using the tcllib http stuff with tclwebtest, or have you > I just wrote a small openacs package for my personal convenience that > acts as webinterface to tclwebtest, which uses a very evil hack to > make the tclwebtest procs available within aolserver: it calls > Ideally I would like to make it available via package require, but > that doesn't work with the older aolserver versions (at least not > 3.3ad13). It's propably an option with aolserver 4. Yeah, probably simplest to just ignore the issue for AOLserver 3.x, as 4.0 should make it simple Real Soon Now. FYI, since all I needed to load into my AOLserver 3.3+ad13 was the tclwebtest cookie handling stuff, I simply copied the 5 cookie procs and wrote a trivial bit of initialization code. (See below.) I'm using this with ns_httpspost from nsopenssl plus some glue code of my own. So far it all seems to work ok. The only major limitations I know of are: No frames support, and no javascript support. I don't know what frames support involves, but so far I've managed to avoid needing it. Javascript support sounds ugly and nasty, but potentially useful. I've definitely seen forms out there which use all sorts of JavaScript in ways that accidentally make it awfully hard to figure out just what the underlying (but often very simple!) for submission is. If I really needed JavaScript support, maybe the thing to do is to use Mozilla's, perhaps simply by running tclwebtest from within the Tcl plugin in Mozilla? That doesn't sound nearly as nice as just doing "package require http::javascript" or whatever, but it might actually be easy... Whereas I assume (without any actual knowledge) that extracting Mozilla's JavaScript support into a separate loadable C module with a nice API would be a royal PITA. Incidentally, I think tclwebtest sends ALL the cookies it has recorded to the server (using [tclwebtest::cookies clientvalue]), even if the the cookies are for a totally different web site. True? If so, this is not such of a problem, but should be documented. Hm, one thing I did not think of is cleaning up the per-thread ::tclwebtest::cookies global variable when I'm done. Guess I should probably call 'tclwebtest::cookies clear' to be safe... FYI, here's how I loaded the Tclwebtest cookie procs into AOLserver, in an OpenACS 4.6.3 environment: In tclwebtest-init.tcl : namespace eval tclwebtest { # A list that contains alternating cookie name and value. Value is # a list by itself, containing array key and value pairs. This is # different from the format of the other lists, e.g. links variable cookies [list] set cookies [list] } In tclwebtest-procs.tcl : namespace eval tclwebtest {} ad_proc -public tclwebtest::assertion_failed ... ad_proc -public tclwebtest::cookies ... ad_proc -private tclwebtest::scan_cookie_expiration_time ... ad_proc -private tclwebtest::set_cookie ... -- Andrew Piskorski <at...@pi...> http://www.piskorski.com |