Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv27485/lib/HTTP/WebTest
Modified Files:
Plugin.pm Cookbook.pod API.pm
Log Message:
Renamed all last_xxx methods to current_xxx since the latest naming
schema makes more sense for them.
Index: Plugin.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Plugin.pm 21 Jun 2002 06:48:16 -0000 1.12
--- Plugin.pm 12 Dec 2002 23:22:15 -0000 1.13
***************
*** 101,106 ****
my $value;
! if(defined $self->webtest->last_test) {
! $value = $self->webtest->last_test->param($param);
$value = defined $value ? $value : $global_value;
} else {
--- 101,106 ----
my $value;
! if(defined $self->webtest->current_test) {
! $value = $self->webtest->current_test->param($param);
$value = defined $value ? $value : $global_value;
} else {
Index: Cookbook.pod
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Cookbook.pod,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Cookbook.pod 22 Aug 2002 08:36:50 -0000 1.16
--- Cookbook.pod 12 Dec 2002 23:22:15 -0000 1.17
***************
*** 209,213 ****
# find ID in the returned page
! ($ID) = $webtest->last_response->content =~ /ID=(\d+)/;
# because no checks are defined a reference on empty array
--- 209,213 ----
# find ID in the returned page
! ($ID) = $webtest->current_response->content =~ /ID=(\d+)/;
# because no checks are defined a reference on empty array
Index: API.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** API.pm 19 Oct 2002 22:37:54 -0000 1.25
--- API.pm 12 Dec 2002 23:22:16 -0000 1.26
***************
*** 92,97 ****
$self->reset_plugins;
! # reset last test object
! $self->last_test(undef);
# convert tests to canonic representation
--- 92,97 ----
$self->reset_plugins;
! # reset current test object
! $self->current_test(undef);
# convert tests to canonic representation
***************
*** 128,132 ****
for(my $i = 0; $i < @{$self->tests}; $i ++) {
my $test = $self->tests->[$i];
! $self->last_test_num($i);
$self->run_test($test, $self->_global_test_params);
}
--- 128,132 ----
for(my $i = 0; $i < @{$self->tests}; $i ++) {
my $test = $self->tests->[$i];
! $self->current_test_num($i);
$self->run_test($test, $self->_global_test_params);
}
***************
*** 441,505 ****
}
! =head2 last_test_num ()
=head3 Returns
! The number of the current test or, if no test is running, the last test run.
=cut
! *last_test_num = make_access_method('LAST_TEST_NUM');
! =head2 last_test ()
=head3 Returns
The L<HTTP::WebTest::Test|HTTP::WebTest::Test> object which corresponds
! to the current test or, if no test is running, the last test run.
=cut
! *last_test = make_access_method('LAST_TEST');
! =head2 last_request ()
=head3 Returns
! The L<HTTP::WebTest::Request|HTTP::WebTest::Request> object used in last test.
=cut
! sub last_request { shift->last_test->request(@_) }
! =head2 last_response ()
=head3 Returns
! The L<HTTP::Response|HTTP::Response> object used in last test.
=cut
! sub last_response { shift->last_test->response(@_) }
! =head2 last_response_time ()
=head3 Returns
! The response time for the last request.
=cut
! sub last_response_time { shift->last_test->response_time(@_) }
! =head2 last_results ()
=head3 Returns
A reference to an array that contains the results of checks made by plugins
! for the last test.
=cut
! sub last_results { shift->last_test->results(@_) }
=head2 run_test ($test, $optional_params)
--- 441,505 ----
}
! =head2 current_test_num ()
=head3 Returns
! The number of the current test or, if no test is running, the current test run.
=cut
! *current_test_num = make_access_method('CURRENT_TEST_NUM');
! =head2 current_test ()
=head3 Returns
The L<HTTP::WebTest::Test|HTTP::WebTest::Test> object which corresponds
! to the current test or, if no test is running, the current test run.
=cut
! *current_test = make_access_method('CURRENT_TEST');
! =head2 current_request ()
=head3 Returns
! The L<HTTP::WebTest::Request|HTTP::WebTest::Request> object used in current test.
=cut
! sub current_request { shift->current_test->request(@_) }
! =head2 current_response ()
=head3 Returns
! The L<HTTP::Response|HTTP::Response> object used in current test.
=cut
! sub current_response { shift->current_test->response(@_) }
! =head2 current_response_time ()
=head3 Returns
! The response time for the HTTP request used in current test.
=cut
! sub current_response_time { shift->current_test->response_time(@_) }
! =head2 current_results ()
=head3 Returns
A reference to an array that contains the results of checks made by plugins
! for the current test.
=cut
! sub current_results { shift->current_test->results(@_) }
=head2 run_test ($test, $optional_params)
***************
*** 530,534 ****
# convert test to canonic representation
$test = $self->convert_tests($test);
! $self->last_test($test);
$self->_global_test_params($params);
--- 530,534 ----
# convert test to canonic representation
$test = $self->convert_tests($test);
! $self->current_test($test);
$self->_global_test_params($params);
***************
*** 538,542 ****
my $request = HTTP::WebTest::Request->new('GET' =>
'http://MISSING_HOSTNAME/');
! $self->last_request($request);
# set request object with plugins
--- 538,542 ----
my $request = HTTP::WebTest::Request->new('GET' =>
'http://MISSING_HOSTNAME/');
! $self->current_request($request);
# set request object with plugins
***************
*** 557,561 ****
# get response
my $response = $self->user_agent->request($request);
! $self->last_response($response);
# measure current time
--- 557,561 ----
# get response
my $response = $self->user_agent->request($request);
! $self->current_response($response);
# measure current time
***************
*** 563,567 ****
# calculate response time
! $self->last_response_time($time2 - $time1);
# init results
--- 563,567 ----
# calculate response time
! $self->current_response_time($time2 - $time1);
# init results
***************
*** 574,578 ****
}
}
! $self->last_results(\@results);
# report test results
--- 574,578 ----
}
}
! $self->current_results(\@results);
# report test results
|