cvs commit: modperl-2.0/t/preconnection/TestPreConnection note.pm

2003-01-19 Thread stas
stas2003/01/19 23:59:44

  Modified:t/preconnection/TestPreConnection note.pm
  Log:
  cleanup
  
  Revision  ChangesPath
  1.2   +1 -3  modperl-2.0/t/preconnection/TestPreConnection/note.pm
  
  Index: note.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/preconnection/TestPreConnection/note.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- note.pm   20 Jan 2003 07:56:17 -  1.1
  +++ note.pm   20 Jan 2003 07:59:44 -  1.2
  @@ -1,7 +1,7 @@
   package TestPreConnection::note;
   
   use strict;
  -use warnings;# FATAL => 'all';
  +use warnings FATAL => 'all';
   
   use Apache::Connection ();
   
  @@ -14,8 +14,6 @@
   
   return Apache::OK;
   }
  -
  -use constant BUFF_LEN => 1024;
   
   sub response {
   my $r = shift;
  
  
  



cvs commit: modperl-2.0/t/preconnection/TestPreConnection note.pm

2003-01-19 Thread stas
stas2003/01/19 23:56:17

  Added:   t/preconnection note.t
   t/preconnection/TestPreConnection note.pm
  Log:
  add a simple test to verify that PreConnection handlers are working
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/preconnection/note.t
  
  Index: note.t
  ===
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  my $module = "TestPreConnection::note";
  Apache::TestRequest::module($module);
  my $hostport = Apache::TestRequest::hostport(Apache::Test::config());
  my $location = "http://$hostport/$module";;
  t_debug("connecting to $location");
  plan tests => 1;
  
  ok t_cmp(
  'ok', 
  GET_BODY($location),
  "connection notes");
  
  
  
  1.1  modperl-2.0/t/preconnection/TestPreConnection/note.pm
  
  Index: note.pm
  ===
  package TestPreConnection::note;
  
  use strict;
  use warnings;# FATAL => 'all';
  
  use Apache::Connection ();
  
  use Apache::Const -compile => qw(OK);
  
  sub handler {
  my Apache::Connection $c = shift;
  
  $c->notes->set(preconnection => 'ok');
  
  return Apache::OK;
  }
  
  use constant BUFF_LEN => 1024;
  
  sub response {
  my $r = shift;
  
  $r->content_type('text/plain');
  $r->print($r->connection->notes->get('preconnection') || '');
  
  return Apache::OK
  }
  
  1;
  __END__
  

  PerlPreConnectionHandler TestPreConnection::note

  
SetHandler modperl
PerlResponseHandler TestPreConnection::note::response