|
NAMEHTTP::WebTest::Utils - Miscellaneous subroutines used by HTTP::WebTestSYNOPSISuse HTTP::WebTest::Utils; *method = make_access_method($field); *method = make_access_method($field, $default_value); *method = make_access_method($field, sub { ... }); find_port(hostname => $hostname); my $pid = start_webserver(port => $port, server_sub => sub { ... }); stop_webserver($pid); copy_dir($src_dir, $dst_dir); load_package($package); my $ret = eval_in_playground($code); die $@ if $@; DESCRIPTIONThis packages contains utility subroutines used by HTTP::WebTest. All of them can be exported but none of them is exported by default.SUBROUTINESmake_access_method($field, $optional_default_value)Creates anonymous subroutine which can be used as accessor method. Method can be used with objects that are blessed hashes.Typical usage is *method = make_access_method($field, ...); Parameters
Returns find_port (hostname => $hostname)ReturnsFree port number for network interface specified by $hostname. start_webserver(%params)Starts separate process with a test webserver.Parameters
stop_webserver($pid)Kills a test webserver specified by its PID.copy_dir ($src_dir, $dst_dir)Copies directiory recursively.load_package ($package)Loads package unless it is already loaded.eval_in_playground ($code)Evaluates perl code inside playground package.Returns A return value of evaluated code. make_sub_in_playground ($code)Create anonymous subroutine inside playground package.Returns A reference on anonymous subroutine. COPYRIGHTCopyright (c) 2001-2003 Ilya Martynov. All rights reserved.This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSOHTTP::WebTestHTTP::WebTest::API
Visit the GSP FreeBSD Man Page Interface. |