Server/AsyncEndpoint/ChannelAdapter/Config.pm untested

filter: Statementstmt 0.0% 0 / 35 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 48 CC 3 SCAR 16.1
CC
3
Cov
0%
init
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 5.0
1 package POE::Component::Server::AsyncEndpoint::ChannelAdapter::Config;
2  
3 use warnings;
4 use strict;
5 our @EXPORT = ( );
6 use base qw(Exporter);
7 use vars qw($VERSION);
8 $VERSION = '0.10';
9  
10 use AppConfig ':argcount';
11 use File::Find;
12 use Carp qw(croak);
13  
14 sub init {
15  
16 my $self = shift;
17 my $alias = shift;
18  
19 my $base_dir = 'endpoints/'.$alias;
20  
21 my $config = AppConfig->new(
22 {GLOBAL => {ARGCOUNT => ARGCOUNT_ONE}},
23 'socuser' => {DEFAULT => 'user'},
24 'socpass' => {DEFAULT => 'pass'},
25 'stcuser' => {DEFAULT => 'user'},
26 'stcpass' => {DEFAULT => 'pass'},
27 'soap_proxy' => {DEFAULT => undef},
28 'soap_service' => {DEFAULT => undef},
29 'mq_address' => {DEFAULT => '127.0.0.1'},
30 'mq_port' => {DEFAULT => 61614},
31 'ikc_addr' => {DEFAULT => undef},
32 'ikc_port' => {DEFAULT => undef},
33 'popper_freq' => {DEFAULT => 10},
34 'soc_retry' => {DEFAULT => 10},
35 'start' => {DEFAULT => 0},
36 );
37  
38 my $fn = undef;
39  
40 # find and load endpoint config file...
41 find( sub{ $fn = $File::Find::name if /^endpoint\.conf$/ }, $base_dir);
42 $config->file($fn) if($fn);
43  
44 return $config;
45  
46 }
47  
48 1;
49  
50 __END__