diff options
Diffstat (limited to 'debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t')
7 files changed, 129 insertions, 0 deletions
diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/TEST.PL b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/TEST.PL new file mode 100644 index 0000000..b5d3494 --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/TEST.PL @@ -0,0 +1,37 @@ +use strict; + +use FindBin; +# test against the A-T source lib for easier dev +use lib "$FindBin::Bin/../../../lib"; + +use lib qw(lib ../lib); + +use warnings FATAL => 'all'; + +use Apache::TestRunPerl (); + +package MyTest; + +use vars qw(@ISA); +@ISA = qw(Apache::TestRunPerl); + +sub new_test_config { + my $self = shift; + + #$self->{conf_opts}->{authname} = 'gold club'; + + return $self->SUPER::new_test_config; +} + +sub bug_report { + my $self = shift; + + print <<EOI; ++-----------------------------------------------------+ +| To report problems please refer to the SUPPORT file | ++-----------------------------------------------------+ +EOI +} + +MyTest->new->run(@ARGV); + diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/basic/hello.t b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/basic/hello.t new file mode 100644 index 0000000..ced9f86 --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/basic/hello.t @@ -0,0 +1,20 @@ +use strict; +use warnings FATAL => 'all'; + +use Apache::Test; +use Apache::TestRequest; +use Apache::TestUtil; + +plan tests => 3, have_lwp; + +my $response = GET '/TestBasic__Hello'; + +ok t_cmp $response->code, 200, '/handler returned HTTP_OK'; + +ok t_cmp $response->header('Content-Type'), 'text/plain', + '/handler set proper Content-Type'; + +chomp(my $content = $response->content); + +ok t_cmp $content, 'Hello', '/handler returned proper content'; + diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/basic/vhost.t b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/basic/vhost.t new file mode 100644 index 0000000..4b4d315 --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/basic/vhost.t @@ -0,0 +1,7 @@ +use Apache::TestUtil; +use Apache::TestRequest 'GET_BODY_ASSERT'; + +my $module = 'TestBasic::Vhost'; +my $url = Apache::TestRequest::module2url($module); +t_debug("connecting to $url"); +print GET_BODY_ASSERT $url; diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/conf/extra.conf.in b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/conf/extra.conf.in new file mode 100644 index 0000000..e16d963 --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/conf/extra.conf.in @@ -0,0 +1,16 @@ +# this vhost entry is needed to check that when t/TEST -maxclients 1 +# or similar is called after t/TEST -conf was run, and extra.conf +# includes a vhost entry and httpd.conf includes an autogenerated +# vhost entry from some .pm file, we used to have a collision, since +# extra.conf wasn't reparsed and the same port was getting assigned to +# more than one vhost entry, preventing server startup: +# +#default_ VirtualHost overlap on port 8530, the first has precedence +#(98)Address already in use: make_sock: could not bind to address +#0.0.0.0:8530 no listening sockets available, shutting down +# +# XXX: for now using a dummy vhost entry. later if needed to put a +# real vhost entry in ths file, the dummy one can be removed +# +<VirtualHost foo_bar_tar> +</VirtualHost> diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/conf/modperl_extra.pl b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/conf/modperl_extra.pl new file mode 100755 index 0000000..a9f939a --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/conf/modperl_extra.pl @@ -0,0 +1,2 @@ + +1; diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm new file mode 100644 index 0000000..953df81 --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Hello.pm @@ -0,0 +1,19 @@ +package TestBasic::Hello; + +use Apache2::RequestRec (); +use Apache2::RequestIO (); +use Apache2::Const -compile => qw(OK); + +# XXX: adjust the test that it'll work under mp1 as well + +sub handler { + + my $r = shift; + + $r->content_type('text/plain'); + $r->print('Hello'); + + return Apache2::OK; +} + +1; diff --git a/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm new file mode 100644 index 0000000..9692b49 --- /dev/null +++ b/debian/perl-framework/Apache-Test/Apache-TestItSelf/Apache-TestMe/t/response/TestBasic/Vhost.pm @@ -0,0 +1,28 @@ +package TestBasic::Vhost; + +use Apache2::Const -compile => qw(OK); +use Apache::Test; + +# XXX: adjust the test that it'll work under mp1 as well + +sub handler { + + my $r = shift; + + plan $r, tests => 1; + + ok 1; + + return Apache2::OK; +} + +1; +__END__ +<NoAutoConfig> +<VirtualHost TestBasic::Vhost> + <Location /TestBasic__Vhost> + SetHandler modperl + PerlResponseHandler TestBasic::Vhost + </Location> +</VirtualHost> +</NoAutoConfig> |