Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin
In directory usw-pr-cvs1:/tmp/cvs-serv32115/lib/HTTP/WebTest/Plugin
Modified Files:
SetRequest.pm DefaultReport.pm Apache.pm
Log Message:
Rename HTTP::WebTest::validate_test to HTTP::WebTest::validate_params
and make it validate hash with test parameters instead of test object
Index: SetRequest.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/SetRequest.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SetRequest.pm 2002/01/24 12:26:29 1.1.1.1
--- SetRequest.pm 2002/01/28 06:32:02 1.2
***************
*** 97,119 ****
}
! sub validate_test {
my $self = shift;
! my $test = shift;
! my %checks = $self->SUPER::validate_test($test);
if(exists $checks{method}) {
$checks{method} &&=
! $self->test_result($test->param('method') =~ /^(?:GET|POST)$/i ? 1 : 0,
'Request method should be either GET or POST.');
}
if(exists $checks{auth}) {
$checks{auth} &&=
! $self->test_result(@{$test->param('auth')} == 2,
'Parameter auth should have two elements.');
}
if(exists $checks{pauth}) {
$checks{pauth} &&=
! $self->test_result(@{$test->param('pauth')} == 2,
'Parameter auth should have two elements.');
}
--- 97,119 ----
}
! sub validate_params {
my $self = shift;
! my $params = shift;
! my %checks = $self->SUPER::validate_params($params);
if(exists $checks{method}) {
$checks{method} &&=
! $self->test_result($params->{method} =~ /^(?:GET|POST)$/i ? 1 : 0,
'Request method should be either GET or POST.');
}
if(exists $checks{auth}) {
$checks{auth} &&=
! $self->test_result(@{$params->{auth}} == 2,
'Parameter auth should have two elements.');
}
if(exists $checks{pauth}) {
$checks{pauth} &&=
! $self->test_result(@{$params->{pauth}} == 2,
'Parameter auth should have two elements.');
}
Index: DefaultReport.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/DefaultReport.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** DefaultReport.pm 2002/01/24 12:26:30 1.1.1.1
--- DefaultReport.pm 2002/01/28 06:32:02 1.2
***************
*** 110,122 ****
}
! sub validate_test {
my $self = shift;
! my $test = shift;
! my %checks = $self->SUPER::validate_test($test);
if(exists $checks{terse}) {
$checks{terse} &&=
! $self->test_result($test->param('terse') =~ /^(?:no|summary|failed_only)$/i ? 1 : 0,
'Parameter terse can be either no, summary or failed_only.');
}
--- 110,122 ----
}
! sub validate_params {
my $self = shift;
! my $params = shift;
! my %checks = $self->SUPER::validate_params($params);
if(exists $checks{terse}) {
$checks{terse} &&=
! $self->test_result($params->{terse} =~ /^(?:no|summary|failed_only)$/i ? 1 : 0,
'Parameter terse can be either no, summary or failed_only.');
}
Index: Apache.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Apache.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Apache.pm 2002/01/24 12:26:32 1.1.1.1
--- Apache.pm 2002/01/28 06:32:02 1.2
***************
*** 235,252 ****
}
! sub validate_test {
my $self = shift;
! my $test = shift;
! my %checks = $self->SUPER::validate_test($test);
if(exists $checks{file_path}) {
$checks{file_path} &&=
! $self->test_result(@{$test->param('file_path')} == 2,
'Parameter file_path should have two elements.');
}
if(exists $checks{include_file_path}) {
$checks{include_file_path} &&=
! $self->test_result((@{$test->param('include_file_path')} % 2) == 0,
'Parameter include_file_path should have even number of elements.');
}
--- 235,252 ----
}
! sub validate_params {
my $self = shift;
! my $params = shift;
! my %checks = $self->SUPER::validate_params($params);
if(exists $checks{file_path}) {
$checks{file_path} &&=
! $self->test_result(@{$params->{file_path}} == 2,
'Parameter file_path should have two elements.');
}
if(exists $checks{include_file_path}) {
$checks{include_file_path} &&=
! $self->test_result((@{$params->{include_file_path}} % 2) == 0,
'Parameter include_file_path should have even number of elements.');
}
|