Author: stas Date: Mon Dec 6 21:23:30 2004 New Revision: 110081 URL: http://svn.apache.org/viewcvs?view=rev&rev=110081 Log: use the new Apache::TestRequest::module2url wrapper Contributed by: "Christopher H. Laco" <apache-test chrislaco.com>
Modified: perl/modperl/trunk/t/modperl/merge.t perl/modperl/trunk/t/modperl/merge2.t perl/modperl/trunk/t/modperl/merge3.t perl/modperl/trunk/t/modperl/perl_options.t perl/modperl/trunk/t/modperl/setupenv.t perl/modperl/trunk/t/modules/proxy.t perl/modperl/trunk/t/perl/ithreads2.t perl/modperl/trunk/t/preconnection/note.t perl/modperl/trunk/t/user/rewrite.t perl/modperl/trunk/t/vhost/config.t perl/modperl/trunk/t/vhost/log.t Modified: perl/modperl/trunk/t/modperl/merge.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modperl/merge.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/modperl/merge.t&r1=110080&p2=perl/modperl/trunk/t/modperl/merge.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/modperl/merge.t (original) +++ perl/modperl/trunk/t/modperl/merge.t Mon Dec 6 21:23:30 2004 @@ -5,13 +5,8 @@ use Apache::Test; use Apache::TestUtil; -my $module = 'TestModperl::merge'; -Apache::TestRequest::module($module); - -my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); - -my $base = "http://$hostport"; +my $module = 'TestModperl::merge'; +my $url = Apache::TestRequest::module2url($module, {path => '/merge/'}); # test server-to-container merging (without overrides) for: # PerlSetEnv @@ -19,6 +14,5 @@ # PerlSetVar # PerlAddVar -my $uri = "$base/merge"; -t_debug("connecting to $uri"); -print GET_BODY_ASSERT $uri; +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url; Modified: perl/modperl/trunk/t/modperl/merge2.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modperl/merge2.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/modperl/merge2.t&r1=110080&p2=perl/modperl/trunk/t/modperl/merge2.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/modperl/merge2.t (original) +++ perl/modperl/trunk/t/modperl/merge2.t Mon Dec 6 21:23:30 2004 @@ -5,13 +5,8 @@ use Apache::Test; use Apache::TestUtil; -my $module = 'TestModperl::merge'; -Apache::TestRequest::module($module); - -my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); - -my $base = "http://$hostport"; +my $module = 'TestModperl::merge'; +my $url = Apache::TestRequest::module2url($module, {path => '/merge2/'}); # test server-to-container merging (with overrides) for: # PerlSetEnv @@ -19,6 +14,5 @@ # PerlSetVar # PerlAddVar -my $uri = "$base/merge2/"; -t_debug("connecting to $uri"); -print GET_BODY_ASSERT $uri; +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url; Modified: perl/modperl/trunk/t/modperl/merge3.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modperl/merge3.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/modperl/merge3.t&r1=110080&p2=perl/modperl/trunk/t/modperl/merge3.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/modperl/merge3.t (original) +++ perl/modperl/trunk/t/modperl/merge3.t Mon Dec 6 21:23:30 2004 @@ -5,13 +5,8 @@ use Apache::Test; use Apache::TestUtil; -my $module = 'TestModperl::merge'; -Apache::TestRequest::module($module); - -my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); - -my $base = "http://$hostport"; +my $module = 'TestModperl::merge'; +my $url = Apache::TestRequest::module2url($module, {path => '/merge3/'}); # test multi-level merging (server-to-container-to-htaccess) for: # PerlSetEnv @@ -19,6 +14,5 @@ # PerlSetVar # PerlAddVar -my $uri = "$base/merge3/"; -t_debug("connecting to $uri"); -print GET_BODY_ASSERT $uri; +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url; Modified: perl/modperl/trunk/t/modperl/perl_options.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modperl/perl_options.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/modperl/perl_options.t&r1=110080&p2=perl/modperl/trunk/t/modperl/perl_options.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/modperl/perl_options.t (original) +++ perl/modperl/trunk/t/modperl/perl_options.t Mon Dec 6 21:23:30 2004 @@ -5,12 +5,8 @@ use Apache::TestUtil; use Apache::TestRequest; -my $module = "TestModperl::perl_options"; -my $path = Apache::TestRequest::module2path($module); +my $module = 'TestModperl::perl_options'; +my $url = Apache::TestRequest::module2url($module); -Apache::TestRequest::module($module); -my $hostport = Apache::TestRequest::hostport(Apache::Test::config()); -my $location = "http://$hostport/$path"; - -t_debug "connecting to $hostport"; -print GET_BODY_ASSERT $location; +t_debug "connecting to $url"; +print GET_BODY_ASSERT $url; Modified: perl/modperl/trunk/t/modperl/setupenv.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modperl/setupenv.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/modperl/setupenv.t&r1=110080&p2=perl/modperl/trunk/t/modperl/setupenv.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/modperl/setupenv.t (original) +++ perl/modperl/trunk/t/modperl/setupenv.t Mon Dec 6 21:23:30 2004 @@ -5,26 +5,20 @@ use Apache::Test; use Apache::TestUtil; -my $module = "TestModperl::setupenv"; -Apache::TestRequest::module($module); +my $module = 'TestModperl::setupenv'; +my $url = Apache::TestRequest::module2url($module); -my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); -my $path = Apache::TestRequest::module2path($module); +t_debug("connecting to $url"); -my $base = "http://$hostport/$path"; - -t_debug("connecting to $base"); - -my @locations = ("${base}_mpdefault", - "${base}_mpsetup", - "${base}_mpdefault", # make sure %ENV is cleared - "${base}_mpvoid", - "${base}_mpsetupvoid", - "${base}_psdefault", - "${base}_psnosetup", - "${base}_psvoid", - "${base}_psnosetupvoid"); +my @locations = ("${url}_mpdefault", + "${url}_mpsetup", + "${url}_mpdefault", # make sure %ENV is cleared + "${url}_mpvoid", + "${url}_mpsetupvoid", + "${url}_psdefault", + "${url}_psnosetup", + "${url}_psvoid", + "${url}_psnosetupvoid"); # plan the tests from a handler so we can run # tests from within handlers across multiple requests @@ -37,7 +31,7 @@ } Apache::TestRequest::user_agent(keep_alive => 1); -print GET_BODY_ASSERT join '?', $base, scalar @locations; +print GET_BODY_ASSERT join '?', $url, scalar @locations; # this tests for when %ENV is populated with CGI variables # as well as the contents of the subprocess_env table Modified: perl/modperl/trunk/t/modules/proxy.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modules/proxy.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/modules/proxy.t&r1=110080&p2=perl/modperl/trunk/t/modules/proxy.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/modules/proxy.t (original) +++ perl/modperl/trunk/t/modules/proxy.t Mon Dec 6 21:23:30 2004 @@ -6,16 +6,13 @@ use Apache::TestRequest; my $module = 'TestModules::proxy'; +my $url = Apache::TestRequest::module2url($module); -Apache::TestRequest::module($module); -my $path = Apache::TestRequest::module2path($module); -my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); -t_debug("connecting to $hostport"); +t_debug("connecting to $url"); plan tests => 1, (need_module('proxy') && need_access); my $expected = "ok"; -my $received = GET_BODY_ASSERT "http://$hostport/$path";; +my $received = GET_BODY_ASSERT $url; ok t_cmp($received, $expected, "internally proxified request"); Modified: perl/modperl/trunk/t/perl/ithreads2.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/perl/ithreads2.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/perl/ithreads2.t&r1=110080&p2=perl/modperl/trunk/t/perl/ithreads2.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/perl/ithreads2.t (original) +++ perl/modperl/trunk/t/perl/ithreads2.t Mon Dec 6 21:23:30 2004 @@ -19,11 +19,7 @@ } my $module = 'TestPerl::ithreads'; -my $config = Apache::Test::config(); -my $path = Apache::TestRequest::module2path($module); +my $url = Apache::TestRequest::module2url($module); -Apache::TestRequest::module($module); -my $hostport = Apache::TestRequest::hostport($config); - -t_debug("connecting to $hostport"); -print GET_BODY_ASSERT "http://$hostport/$path"; +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url; Modified: perl/modperl/trunk/t/preconnection/note.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/preconnection/note.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/preconnection/note.t&r1=110080&p2=perl/modperl/trunk/t/preconnection/note.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/preconnection/note.t (original) +++ perl/modperl/trunk/t/preconnection/note.t Mon Dec 6 21:23:30 2004 @@ -5,16 +5,15 @@ use Apache::TestUtil; use Apache::TestRequest; -my $module = "TestPreConnection::note"; -Apache::TestRequest::module($module); +my $module = 'TestPreConnection::note'; +my $url = Apache::TestRequest::module2url($module); my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); -my $location = "http://$hostport/" . Apache::TestRequest::module2path($module); + my $remote_addr = $config->{vars}->{remote_addr}; -t_debug("connecting to $location"); +t_debug("connecting to $url"); plan tests => 1; ok t_cmp( - GET_BODY_ASSERT($location), + GET_BODY_ASSERT($url), $remote_addr, "connection notes"); Modified: perl/modperl/trunk/t/user/rewrite.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/user/rewrite.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/user/rewrite.t&r1=110080&p2=perl/modperl/trunk/t/user/rewrite.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/user/rewrite.t (original) +++ perl/modperl/trunk/t/user/rewrite.t Mon Dec 6 21:23:30 2004 @@ -6,11 +6,7 @@ use Apache::TestUtil; my $module = 'TestUser::rewrite'; +my $url = Apache::TestRequest::module2url($module); -Apache::TestRequest::module($module); -my $path = Apache::TestRequest::module2path($module); -my $config = Apache::Test::config(); -my $hostport = Apache::TestRequest::hostport($config); -t_debug("connecting to $hostport"); - -print GET_BODY_ASSERT "http://$hostport/$path"; +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url; Modified: perl/modperl/trunk/t/vhost/config.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/vhost/config.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/vhost/config.t&r1=110080&p2=perl/modperl/trunk/t/vhost/config.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/vhost/config.t (original) +++ perl/modperl/trunk/t/vhost/config.t Mon Dec 6 21:23:30 2004 @@ -8,13 +8,10 @@ my $vars = $config->{vars}; my $module = 'TestVhost::config'; -my $path = Apache::TestRequest::module2path($module); +my $url = Apache::TestRequest::module2url($module); -Apache::TestRequest::module($module); -my $hostport = Apache::TestRequest::hostport($config); - -t_debug("connecting to $hostport"); -my $res = GET "http://$hostport/$path"; +t_debug("connecting to $url"); +my $res = GET $url; if ($res->is_success) { print $res->content; Modified: perl/modperl/trunk/t/vhost/log.t Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/vhost/log.t?view=diff&rev=110081&p1=perl/modperl/trunk/t/vhost/log.t&r1=110080&p2=perl/modperl/trunk/t/vhost/log.t&r2=110081 ============================================================================== --- perl/modperl/trunk/t/vhost/log.t (original) +++ perl/modperl/trunk/t/vhost/log.t Mon Dec 6 21:23:30 2004 @@ -5,11 +5,8 @@ my $vars = $config->{vars}; my $module = 'TestVhost::log'; -my $path = Apache::TestRequest::module2path($module); +my $url = Apache::TestRequest::module2url($module); -Apache::TestRequest::module($module); -my $hostport = Apache::TestRequest::hostport($config); - -t_debug("connecting to $hostport"); -print GET_BODY_ASSERT "http://$hostport/$path"; +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url;