Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin
In directory usw-pr-cvs1:/tmp/cvs-serv32518/lib/HTTP/WebTest/Plugin
Modified Files:
Hooks.pm
Log Message:
Added on_start and on_finish test parameters
Index: Hooks.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Hooks.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Hooks.pm 21 Jun 2002 06:48:16 -0000 1.9
--- Hooks.pm 22 Aug 2002 08:37:41 -0000 1.10
***************
*** 11,18 ****
plugins = ( ::Hooks )
test_name = Name1
....
# do some test initialization
! on_request = { My::init() }
end_test
--- 11,24 ----
plugins = ( ::Hooks )
+ # do some test sequence initialization
+ on_start = { My::init() }
+
+ # do some test sequence deinitialization
+ on_finish = { My::stop() }
+
test_name = Name1
....
# do some test initialization
! on_request = { My::local_init() }
end_test
***************
*** 48,55 ****
=for pod_merge copy opt_params
=head2 on_request
The value of this test parameter is ignored. However, it is evaluted
! before the HTTP request is done, so it can be used to do
initalization before the request.
--- 54,81 ----
=for pod_merge copy opt_params
+ =head2 on_start
+
+ The value of this test parameter is ignored. However, it is evaluted
+ before the test sequence is run, so it can be used to do initalization
+ before the test sequence run.
+
+ =head3 Example
+
+ See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>.
+
+ =head2 on_finish
+
+ The value of this test parameter is ignored. However, it is evaluted
+ before the test sequence is run, so it can be used to run finalization
+ code when the test sequence is finished.
+
+ =head3 Example
+
+ See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>.
+
=head2 on_request
The value of this test parameter is ignored. However, it is evaluted
! before the HTTP request is done, so it can be used to do
initalization before the request.
***************
*** 81,86 ****
sub param_types {
! return q(on_request anything
! on_response test_results);
}
--- 107,114 ----
sub param_types {
! return q(on_start anything
! on_request anything
! on_response test_results
! on_finish anything);
}
***************
*** 107,114 ****
}
sub prepare_request {
my $self = shift;
! # this both checks and evaluates test parameter
$self->validate_params(qw(on_request));
}
--- 135,156 ----
}
+ sub start_tests {
+ my $self = shift;
+
+ # both checks and evaluates test parameter
+ $self->validate_params(qw(on_start));
+ }
+
+ sub end_tests {
+ my $self = shift;
+
+ # both checks and evaluates test parameter
+ $self->validate_params(qw(on_finish));
+ }
+
sub prepare_request {
my $self = shift;
! # both checks and evaluates test parameter
$self->validate_params(qw(on_request));
}
|