Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Apache::Test hooks?

Torsten Foertsch

2010-03-09


Author LoginPost Reply
Hi,

for my current project I need an additional server process to run to run my
tests. What I came up with is this (snippet from t/TEST.PL):

use Apache::TestTrace;
use Apache::TestServer ();
BEGIN {
no warnings 'redefine';
my $orig_start=\&Apache::TestServer::start;
*Apache::TestServer::start=sub {
  my $rc=$orig_start->(@(protected));
  if( $rc ) {
   notice "Starting sessionserver";
  }
  return $rc;
};

my $orig_stop=\&Apache::TestServer::stop;
*Apache::TestServer::stop=sub {
  my $rc=$orig_stop->(@(protected));
  if( $rc!=-1 ) {
   notice "Stopping sessionserver";
  }
  return $rc;
};
}

Is that the right way to go?

Torsten Förtsch

--
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.