WWW::Webrobot::SelftestRunner - Start httpd and run a test plan


webrobot documentation  | view source Contained in the webrobot distribution.

Index


NAME

Top

WWW::Webrobot::SelftestRunner - Start httpd and run a test plan

SYNOPSIS

Top

 use WWW::Webrobot::SelftestRunner qw/RunTestplan HttpdEcho Config/;
 exit RunTestplan(HttpdEcho, Config(qw/Test/, $test_plan);

 exit RunTestplan(HttpdEcho, Config(qw/Test Html/, $test_plan);

see also t/get.t

DESCRIPTION

Top

This package serves some functions to start a http daemon and run a test plan. It is only used for the test in the t/... directory.

FUNCTIONS

Top

RunTestplan($serverfunc, $config, $testplan)

Run a WWW::Webrobot::StupidHTTPD http daemon implementing $serverfunc. Then run a WWW::Webrobot http client using the configuration $config and the testplan $testplan.

HttpdEcho

A simple server function for the WWW::Webrobot::StupidHTTPD http daemon. It read the requested url http://server:port/action/anyting_else as an action where the action is denoted by the action part within the url. The result of the action is returned as content in the response. Actions are

 url           echo the url as response content
 content       echo the content in the request as response content
 method        echo the method in the request as response content
 headers       echo a stringified form of the request headers as response content

Config(Modulenames...)

Simple config string for WWW::Webrobot::Print::* output. Defaults to "Test" if no parameter is given.

Example:

 my $cfg = Config(qw/Html Test/);
 my $cfg = Config;


webrobot documentation  | view source Contained in the webrobot distribution.