GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HTTP::WEBTEST::UTILS (3)

.ds Aq ’

NAME

HTTP::WebTest::Utils - Miscellaneous subroutines used by HTTP::WebTest

CONTENTS

SYNOPSIS



    use 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 $@;



DESCRIPTION

This packages contains utility subroutines used by HTTP::WebTest. All of them can be exported but none of them is exported by default.

SUBROUTINES

make_access_method($field, CW$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
o $field

A hash field used for created accessor method.

o $optional_default_value

If $optional_default_value is a code reference, uses values returned by its execution as default for created accessor method. Otherwise, uses $optional_default_value as name of method which returns default value for created accessor method.

Returns

find_port (hostname => CW$hostname)

Returns

Free port number for network interface specified by $hostname.

    start_webserver(%params)

Starts separate process with a test webserver.

Parameters
port => $port A port number where the test webserver listens for incoming connections.
server_sub => $server_sub A reference on a subroutine to handle requests. It get passed two named parameters: connect and request.

    stop_webserver($pid)

Kills a test webserver specified by its PID.

copy_dir ($src_dir, CW$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.

COPYRIGHT

Copyright (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 ALSO

HTTP::WebTest

HTTP::WebTest::API

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HTTP::WEBTEST::UTILS (3) 2003-03-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.