Mercurial > pub > Impl
annotate _test/temp.pl @ 422:b0481c071bea ref20150831
IMPL::Config::Container tests, YAMLConfiguration now works and tested
| author | cin |
|---|---|
| date | Sun, 20 Aug 2017 00:20:41 +0300 |
| parents | bbc4739c4d48 |
| children | 60c2892a577c |
| rev | line source |
|---|---|
| 210 | 1 #!/usr/bin/perl |
| 2 use strict; | |
| 412 | 3 use Carp; |
| 4 use Time::HiRes qw(gettimeofday tv_interval); | |
| 415 | 5 use Scalar::Util qw(blessed refaddr); |
| 418 | 6 use YAML::XS qw(Dump Load); |
|
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
7 use Data::Dumper; |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
8 use URI; |
| 418 | 9 |
| 417 | 10 |
| 11 use IMPL::require { | |
| 12 Container => 'IMPL::Config::Container', | |
| 13 Service => 'IMPL::Config::ServiceDescriptor', | |
| 14 Reference => 'IMPL::Config::ReferenceDescriptor', | |
|
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
15 Value => 'IMPL::Config::ValueDescriptor', |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
16 YAMLConfig => 'IMPL::Config::YAMLConfig' |
| 417 | 17 }; |
| 18 | |
| 19 | |
| 418 | 20 my $t = [gettimeofday]; |
|
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
21 my $config = YAMLConfig->new(load => 'sample.yaml'); |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
22 print "Loaded: ",tv_interval($t,[gettimeofday]),"\n"; |
| 417 | 23 |
|
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
24 my $container = Container->new()->AutoPtr; |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
25 $config->ConfigureContainer($container); |
| 417 | 26 |
| 27 | |
| 28 | |
|
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
29 print "Configured: ",tv_interval($t,[gettimeofday]),"\n"; |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
30 #print Data::Dumper->Dump([$container]); |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
31 #$container->Dispose(); |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
32 |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
33 my $base = URI->new('some/path'); |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
34 my $rel = URI->new('../other/path')->abs($base)->rel('/'); |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
35 print $rel,"\n"; |
|
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
36 |
| 407 | 37 1; |
