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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
1 #!/usr/bin/perl
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
2 use strict;
412
30e8c6a74937 working on di container (role based registrations)
cin
parents: 411
diff changeset
3 use Carp;
30e8c6a74937 working on di container (role based registrations)
cin
parents: 411
diff changeset
4 use Time::HiRes qw(gettimeofday tv_interval);
415
3d24b10dd0d5 working on IMPL::Config::Container
cin
parents: 414
diff changeset
5 use Scalar::Util qw(blessed refaddr);
418
cin
parents: 417
diff changeset
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
cin
parents: 417
diff changeset
9
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
10
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
11 use IMPL::require {
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
12 Container => 'IMPL::Config::Container',
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
13 Service => 'IMPL::Config::ServiceDescriptor',
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
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
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
17 };
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
18
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
19
418
cin
parents: 417
diff changeset
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
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
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
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
26
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
27
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
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
c6e90e02dd17 renamed Lib->lib
cin
parents: 406
diff changeset
37 1;