Command/SOAP/Lite/Call.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 4 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 92.3% 48 / 52 CC 4 SCAR 5.9
CC
4
Cov
95%
execute
3.0
new
2.0
BEGIN
1.0
CRAP 1.8
↑ Summary Factory/SOAP/Lite.pm »
1 #*********************************************************************
2 #*** ResourcePool/Command/SOAP/Lite/Call.pm
3 #*** Copyright (c) 2003 by Markus Winand <mws@fatalmind.com>
4 #*** $Id: Call.pm,v 1.5 2011-01-31 13:49:38 mws Exp $
5 #*********************************************************************
6 package ResourcePool::Command::SOAP::Lite::Call;
7  
8 1 ▶use ResourcePool::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use ResourcePool::Command::NoFailoverException;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use SOAP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use vars qw(@ISA $VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 $VERSION = "1.0103";
15 1 push @ISA, qw(ResourcePool::Command);
16  
17 1 ▶sub new($$) {
Subroutine new: called CC=2 SCAR=7.1
Pod documented
18 1 my $proto = shift;
19 1 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
20 1 my $self = {};
21 1 $self->{namespace} = shift;
22  
23 1 bless($self, $class);
24 1 return $self;
25 }
26  
27 4 ▶sub execute($$$@) {
Subroutine execute: called CC=3 SCAR=11.0
Pod documented
28 4 my ($self, $soaph, $method, @args) = @_;
29  
30 4 $soaph->uri($self->{namespace});
31 4 my $som = $soaph->call($method => @args);
32 4 my $fc = $som->faultcode();
33 4 ▶ if ($fc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fc) 3 1 4
34 # some error happend
35 # throw NoFailoverException if it is a Client fault
36 3 my $ex;
37 3 ▶ if ($fc =~ /^[^:]*:Client/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fc =~ /^[^:]*:Client/i) { } 1 2 3
38 1 $ex = ResourcePool::Command::NoFailoverException->new($som->fault());
39 } else {
40 2 $ex = $som->fault();
41 }
42  
43 3 die $ex;
44 }
45 1 return $som->result();
46 }
47  
↑ Summary Factory/SOAP/Lite.pm »