Wombat/Core/HostValve.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 40 CC 2 SCAR 11.0
CC
2
Cov
0%
invoke
6.0
getName
2.0
BEGIN
2.0
CRAP 3.0
1 # -*- Mode: Perl; indent-tabs-mode: nil; -*-
2  
3 package Wombat::Core::HostValve;
4  
5 use base qw(Wombat::Valve::ValveBase);
6 use fields qw();
7 use strict;
8 use warnings;
9  
10 use Servlet::Util::Exception ();
11  
12 # public methods
13  
14 sub getName { return 'HostValve' }
15  
16 sub invoke {
17 my $self = shift;
18 my $request = shift;
19 my $response = shift;
20  
21 my $host = $self->getContainer();
22 my $application = $host->map($request);
23 unless ($application) {
24 my $status = Servlet::Http::HttpServletResponse::SC_NOT_FOUND;
25 $response->getResponse()->sendError($status);
26  
27 $host->handleError($request, $response);
28 return 1;
29 }
30  
31 $application->invoke($request, $response);
32  
33 return 1;
34 }
35  
36 1;
37 __END__