NAME

HTTP::WebTest::Plugin - Base class for HTTP::WebTest plugins.

SYNOPSIS

Not applicable.

DESCRIPTION

HTTP::WebTest plugin classes can subclass this class. It provides some useful helper methods.

METHODS

new ($webtest)

Constructor.

Returns

A new plugin object which will be used by HTTP::WebTest object $webtest.

webtest

Returns

A HTTP::WebTest object which uses this plugin.

test_param ($param, $default)

Returns

If latest test parameter $param is not defined returns $optional_default or false if it is not defined.

If latest test parameter $param is defined returns it's value.

yesno_test_param ($param, $optional_default)

Returns

If latest test parameter $param is not defined returns $optional_default or false if it is not defined.

If latest test parameter $param is defined returns true if latest test parameter $param is yes. False otherwise.

merge_params ($param, $value, $global_value)

Merges test parameter value with global test parameter value.

Returns

A merged test parameter value.

test_result ($ok, $comment)

Factory method which creates test result object.

Returns

A HTTP::WebTest::TestResult object.

validate_test ($test)

Checks test parameters.

Returns

An array of HTTP::WebTest::TestResult objects.

param_types

Method which should be redefined in subclasses. Returns information about test parameters which are supported by plugin. Used to validate tests.

Returns

An hash reference. Keys are names of test parameters which are supported by plugin. Values are their type.

check_anything ($value)

Method which checks test parameter if it is value is of anything type.

Returns

Always true.

check_list ($value)

Method which checks test parameter if it is value is of list type.

Returns

True if $value is an array reference. False otherwise.

check_string ($value)

Method which checks test parameter if it is value is of string type.

Returns

True if $value is a string. False otherwise.

check_stringref ($value)

Method which checks test parameter if it is value is of stringref type.

Returns

True if $value is a string reference. False otherwise.

check_uri ($value)

Method which checks test parameter if it is value is of uri type.

Returns

True if $value is an URI. False otherwise.

check_hashlist ($value)

Method which checks test parameter if it is value is of hashlist type.

Returns

True if $value is a hash reference or an array reference which points to array containing even number of elements. False otherwise.

check_yesno ($value)

Method which checks test parameter if it is value is of yesno type.

Returns

True if $value is either yes or no. False otherwise.

COPYRIGHT

Copyright (c) 2001,2002 Ilya Martynov. All rights reserved.

This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License.

SEE ALSO

HTTP::WebTest

HTTP::WebTest::API

HTTP::WebTest::Plugins

HTTP::WebTest::ReportPlugin