File Coverage

blib/lib/XAO/testcases/FS/config.pm
Criterion Covered Total %
statement 15 32 46.8
branch n/a
condition n/a
subroutine 5 8 62.5
pod 0 1 0.0
total 20 41 48.7


line stmt bran cond sub pod time code
1             package XAO::testcases::FS::config;
2 1     1   688 use strict;
  1         2  
  1         28  
3 1     1   512 use XAO::Utils;
  1         19157  
  1         69  
4 1     1   466 use XAO::Objects;
  1         5289  
  1         34  
5 1     1   6 use Error qw(:try);
  1         3  
  1         5  
6              
7 1     1   165 use base qw(XAO::testcases::FS::base);
  1         3  
  1         574  
8              
9             sub test_everything {
10 0     0 0   my $self=shift;
11              
12 0           my $config=XAO::Objects->new(objname => 'Config', baseobj => 1);
13 0           $self->assert(ref($config),
14             "Can't get base config object");
15              
16             my $fsconfig=XAO::Objects->new(objname => 'FS::Config',
17             odb_args => {
18             dsn => $self->{odb_args}->{dsn},
19             user => $self->{odb_args}->{user},
20             password => $self->{odb_args}->{password},
21 0           });
22 0           $self->assert(ref($fsconfig),
23             "Can't get FS config object");
24              
25 0           $config->embed(fs => $fsconfig);
26              
27 0           $self->assert(ref($config->odb),
28             "Can't get database handler from the config");
29              
30 0           my $ok=0;
31             try {
32 0     0     $config->odb($self->get_odb);
33             }
34             otherwise {
35 0     0     $ok=1;
36 0           };
37 0           $self->assert($ok,
38             "Setting odb succeeded without enabling special access");
39              
40 0           $config->embedded('fs')->enable_special_access();
41 0           $config->odb($self->get_odb);
42 0           $config->embedded('fs')->enable_special_access();
43 0           $self->assert(ref($config->odb),
44             "Updating odb did not work");
45 0           $self->assert($config->odb == $self->get_odb,
46             "ODB after update points to wrong location");
47             }
48              
49             1;