From: Kip H. <ki...@us...> - 2009-01-24 13:18:29
|
Update of /cvsroot/sawa/sawa/t/src/output/lib/output In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11548/t/src/output/lib/output Added Files: StepOne.pm StepTwo.pm handler.pm Log Message: Massive update to the test suite. Now decoupled from Apache::Test --- NEW FILE: StepTwo.pm --- package output::StepTwo; use SAWA::Constants; use SAWA::Event::Simple; use vars qw(@ISA); @ISA = qw( SAWA::Event::Simple ); sub registerEvents { return qw/ /; } sub event_init { die "Event method called when upstream handler returned 'OUTPUT'" } 1; --- NEW FILE: StepOne.pm --- package output::StepOne; use SAWA::Constants; use SAWA::Event::Simple; our @ISA = qw( SAWA::Event::Simple ); sub registerEvents { return qw/ first /; } sub event_init { my $self = shift; my $ctxt = shift; $ctxt->{content} = '<p>output::StepOne::event_init</p>'; return OUTPUT; } sub event_first { die "Event method called after event_init returned 'OUTPUT'"; } 1; --- NEW FILE: handler.pm --- package output::handler; use SAWA::Machine; use mod_perl; use constant MP2 => $mod_perl::VERSION >= 1.99; BEGIN { if (MP2) { require Apache::Response; require Apache::Const; } else { require Apache::Constants; } } sub handler { my $r = shift; my $app = SAWA::Machine->new(); $app->pipeline( qw( output::StepOne output::StepTwo basic::Output ) ); $app->run({}); return MP2 ? Apache::OK : Apache::Constants::OK; } 1; |