blib/lib/DBD/Gofer/Transport/null.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.5% 35 / 37 CC 2 SCAR 2.5
CC
2
Cov
100%
transmit_request_by_transport
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/DBD/Gofer/Policy/Base.pm ↑ Summary blib/lib/DBD/Proxy.pm »
1 package DBD::Gofer::Transport::null;
2  
3 # $Id: null.pm 10087 2007-10-16 12:42:37Z Tim $
4 #
5 # Copyright (c) 2007, Tim Bunce, Ireland
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9  
10 63 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 63 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 63 ▶use base qw(DBD::Gofer::Transport::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 63 ▶use DBI::Gofer::Execute;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 63 our $VERSION = "0.010088";
18  
19 63 __PACKAGE__->mk_accessors(qw(
20 pending_response
21 transmit_count
22 ));
23  
24 63 my $executor = DBI::Gofer::Execute->new();
25  
26  
27 6558 ▶sub transmit_request_by_transport {
Subroutine transmit_request_by_transport: called CC=2 SCAR=6.9
Pod undocumented
28 6558 my ($self, $request) = @_;
29 6558 ▶ $self->transmit_count( ($self->transmit_count()||0) + 1 ); # just for tests
Condition100%2/2
$self->transmit_count || 0
l!l
6165393
MC/DC100%1/1
$self->transmit_count || 0
$self->transmit_count
Truth table100%2/2
A
A= $self->transmit_count
Aresult
11
00
30  
31 6558 my $frozen_request = $self->freeze_request($request);
32  
33 # ...
34 # the request is magically transported over to ... ourselves
35 # ...
36  
37 6558 my $response = $executor->execute_request( $self->thaw_request($frozen_request, undef, 1) );
38  
39 # put response 'on the shelf' ready for receive_response()
40 6558 $self->pending_response( $response );
41  
42 6558 return undef;
43 }
44  
45  
46 6561 ▶sub receive_response_by_transport {
Subroutine receive_response_by_transport: called CC=1 SCAR=0.0
Pod undocumented
47 6561 my $self = shift;
48  
49 6561 my $response = $self->pending_response;
50  
51 6561 my $frozen_response = $self->freeze_response($response, undef, 1);
52  
53 # ...
54 # the response is magically transported back to ... ourselves
55 # ...
56  
57 6561 return $self->thaw_response($frozen_response);
58 }
59  
60  
61 63 1;
62 __END__
« blib/lib/DBD/Gofer/Policy/Base.pm ↑ Summary blib/lib/DBD/Proxy.pm »