=encoding utf8 =head1 NAME =begin original HTTP::WebTest::Plugin - Base class for HTTP::WebTest plugins. =end original HTTP::WebTest::Plugin - HTTP::WebTest プラグインの基底クラス =head1 SYNOPSIS =begin original Not applicable. =end original なし. =head1 DESCRIPTION =begin original L plugin classes can inherit from this class. It provides some useful helper methods. =end original L プラグインクラスはこのクラスから派生させます. ここでは便利なヘルパーメソッドが提供されています. =head1 METHODS (メソッド) =head2 new ($webtest) =begin original Constructor. =end original コンストラクタ. =head3 Returns (復帰値) =begin original A new plugin object that will be used by L object C<$webtest>. =end original L オブジェクト C<$webtest> によって使用される 新しいプラグインオブジェクト. =head2 webtest () =head3 Returns (復帰値) =begin original An L object that uses this plugin. =end original このプラグインを使っている L オブジェクト. =head2 global_test_param ($param, $optional_default) =head3 Returns (復帰値) =begin original If global test parameter C<$param> is not defined, returns C<$optional_default> or C if there is no default. =end original グローバルテストパラメータ C<$param> が定義されていなければ C<$optional_default>. デフォルト値も渡されていなければ C. =begin original If the global test parameter C<$param> is defined, returns it's value. =end original グローバルテストパラメータ C<$param> が定義されていればその値. =head2 test_param ($param, $optional_default) =head3 Returns (復帰値) =begin original If latest test parameter C<$param> is not defined, returns C<$optional_default> or C if there is no default. =end original 最新のテストパラメータ C<$param> が定義されていなければ C<$optional_default>. デフォルト値も渡されていなければ C. =begin original If latest test parameter C<$param> is defined returns it's value. =end original 最新ののテストパラメータ C<$param> が定義されていればその値. =head2 global_yesno_test_param ($param, $optional_default) =head3 Returns (復帰値) =begin original If the global test parameter C<$param> is not defined, returns C<$optional_default> or false if no default exists. =end original グローバルテストパラメータ C<$param> が定義されていなければ C<$optional_default>. デフォルト値も渡されていなければ偽. =begin original If the global test parameter C<$param> is defined, returns true if latest test parameter C<$param> is C, false otherwise. =end original グローバルテストパラメータ C<$param> が定義されてるのなら, 最新のテストパラメータ C<$param> が C であれば真, そうでなければ偽. =head2 yesno_test_param ($param, $optional_default) =head3 Returns (復帰値) =begin original If latest test parameter C<$param> is not defined returns C<$optional_default> or false if it is not defined also. =end original 最新のテストパラメータ C<$param> が定義されていなければ C<$optional_default>. デフォルト値も渡されていなければ偽. =begin original If latest test parameter C<$param> is defined returns true if latest test parameter C<$param> is C. False otherwise. =end original 最新のテストパラメータ C<$param> が定義されてるのなら, 最新のテストパラメータ C<$param> が C であれば真, そうでなければ偽. =head2 test_result ($ok, $comment) =begin original Factory method that creates test result object. =end original テスト結果オブジェクトを作るファクトリメソッド. =head3 Returns (復帰値) =begin original A L object. =end original L オブジェクト. =head2 validate_params (@params) =begin original Checks test parameters in C<@params>. Throws exception if any of them are invalid. =end original C<@params> の中のテストパラメータを調べます. もし不正なものがあれば 例外をなげます. =head2 global_validate_params (@params) =begin original Checks global test parameters in C<@params>. Throws exception if any of them are invalid. =end original C<@params> の中のグローバルテストパラメータを調べます. もし不正なものがあれば 例外をなげます. =head2 validate_value($param, $value, $type) =begin original Checks if C<$value> of test parameter C<$param> has type <$type>. =end original テストパラメータ C<$param> の C<$value> がタイプ <$type> を持っているか を調べます. =head3 Exceptions (例外) =begin original Dies if check is not successful. =end original チェックが成功しなければ die します. =head2 param_types () =begin original This method should be redefined in the subclasses. Returns information about test parameters that are supported by plugin. Used to validate tests. =end original このメソッドはサブクラスで再定義されるべきです. プラグインがサポートするテストパラメータに関する情報を返します. テストの検証に使われます. =head3 Returns (復帰値) =begin original A string that looks like: =end original 次のような文字列です: 'param1 type1 param2 type2 param3 type3(optional,args) param4 type4' =head2 check_anything ($value) =begin original Method that checks whether test parameter value is of C type. =end original テストパラメータの値が C タイプであることをチェックする メソッドです. =begin original This is NOOP operation. It always succeed. =end original これは何もしません. 常に成功します. =head2 check_list ($param, $value, @optional_spec) =begin original Method that checks whether test parameter value is of C type. That is it is a reference on an array. =end original テストパラメータの値が C タイプ から成ることをチェックします. つまり配列のリファレンスであることをチェックします. =begin original Optional list C<@optional_spec> can define specification on allowed elements of list. It can be either =end original 任意のリスト C<@optional_spec> はリストに許可される要素を定義します. 次のいずれかの形式で指定します: ('TYPE_1', 'TYPE_2', ..., 'TYPE_N') =begin original or =end original もしくは ('TYPE_1', 'TYPE_2', ..., 'TYPE_M', '...') =begin original First specification requires list value of test parameter to contain C elements. First element of list should be of should C type, second element of list should of C type, ..., N-th element of list should be of C type. =end original 1つめの指定ではテストパラメータが C 個の要素を持っているリストで あることを要求します. リストの最初の要素は C タイプであり, リストの2つ目の要素は C であり, ..., リストの N 番目の要素は C タイプであるべきです. =begin original Second specification requires list value of test parameter to contain at least C elements. First element of list should be of should C type, second element of list should of C type, ..., M-th element of list should be of C type, all following elements should be of C type. =end original 2つめの指定ではテストパラメータが少なくとも C 個の要素を持っている リストであることを要求します. リストの最初の要素は C タイプであり, リストの2つ目の要素は C であり, ..., リストの M 番目の要素は C タイプであるべきです. そしてそれ以降の要素は C で あるべきです. =head3 Exceptions (例外) =begin original Dies if checks is not successful. =end original チェックが成功しなければ die します. =head2 check_scalar ($param, $value, $optional_regexp) =begin original Method that checks whether test parameter value is of C type (that is it is usual Perl scalar and is not a reference). =end original テストパラメータが C タイプ(通常の Perl のスカラーであり, リファレンスは含みません)であることをチェックします. =begin original If C<$optional_regexp> is specified also checks value of parameter using this regual expression. =end original C<$optional_regexp> が指定されたのならパラメータの値をこの正規表現でも チェックします. =head3 Exceptions (例外) =begin original Dies if check is not successful. =end original チェックが成功しなければ die します. =head2 check_stringref ($param, $value) =begin original Method that checks whether test parameter value is of C type (that is it is a reference on scalar). =end original テストパラメータの値が C タイプ(スカラーへのリファレンス) であることをチェックします. =head3 Exceptions (例外) =begin original Dies if check is not successful. =end original チェックが成功しなければ die します. =head2 check_uri ($param, $value) =begin original Method that checks whether test parameter value is of C type (that is it either scalar or L object). =end original テストパラメータの値が C タイプ (スカラーもしくは L オブジェクト)であることをチェックします. =head3 Exceptions (例外) =begin original Dies if check is not successful. =end original チェックが成功しなければ die します. =head2 check_hashlist ($param, $value) =begin original Method that checks whether test parameter value is of C type (that is it is either a hash reference or an array reference that points to array containing even number of elements). =end original テストパラメータの値が C タイプ(ハッシュのリファレンス もしくは偶数個の要素をもつ配列へのリファレンス)であることをチェックします. =head3 Exceptions (例外) =begin original Dies if check is not successful. =end original チェックが成功しなければ die します. =head2 check_yesno ($param, $value) =begin original Same as =end original 以下の分と等値です: check_scalar($param, $value, '^(?:yes|no)$'); =head1 COPYRIGHT Copyright (c) 2001-2003 Ilya Martynov. All rights reserved. =begin original This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =end original このプログラムはフリーソフトウェアです. このプログラムは Perl 自身と同じ条件下で再配布・改変可能です. =head1 SEE ALSO L L L L