NAME
Fennec::DeveloperManual::Handlers - Writing Custom Result Handlers.
OVERVIEW
Handlers are very simple, they are the final destination for Output objects, including results. When Fennec is started one or more handlers will be instantiated. Every output generated will be sent to the parent process which sends the object to each of the handlers.
SYNOPSIS
Here is a very basic, and not very useful output handler.
package Fennec::Handler::MyHandler;
use strict;
use warnings;
use base 'Fennec::Handler';
use Data::Dumper;
sub init {
my $self = shift;
...
}
sub start {
my $self = shift;
print "Fennec started\n";
}
sub handle {
my $self = shift;
my ( $output ) = @_;
print "Fennec generated output, here it is:\n";
print Dumper( $output );
}
sub fennec_error {
my $self = shift;
my ( $msg ) = @_;
print "Fennec experienced an error: $msg\n";
}
sub finish {
my $self = shift;
print "Fennec finished\n";
}
1;
METHODS TO IMPLEMENT
MUST IMPLEMENT
- handle( $output )
-
This is how the Fennec runner sends output to the handlers. Every output item generated will be pased in here. All items will be subclases of Fennec::Output.
- fennec_error( @msgs )
-
Called when fennec encounters an error.
CAN IMPLEMENT
USER DOCUMENTATION
User documentation is for those who wish to use Fennec to write simple tests, or manage a test suite for a project.
DEVELOPER DOCUMENTATION
Developer documentation is for those who wish to extend Fennec, or contribute to overall Fennec development.
API DOCUMENTATION
API Documentation covers object internals. See the POD within each individual module.
AUTHORS
Chad Granum exodist7@gmail.com
COPYRIGHT
Copyright (C) 2010 Chad Granum
Fennec is free software; Standard perl licence.
Fennec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.