Mercurial > pub > Impl
annotate _test/Test/Web/Application.pm @ 250:129e48bb5afb
DOM refactoring
ObjectToDOM methods are virtual
QueryToDOM uses inflators
Fixed transform for the complex values in the ObjectToDOM
QueryToDOM doesn't allow to use complex values (HASHes) as values for nodes (overpost problem)
author | sergey |
---|---|
date | Wed, 07 Nov 2012 04:17:53 +0400 |
parents | 4d0e1962161c |
children |
rev | line source |
---|---|
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
1 package Test::Web::Application::Instance; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
2 package Test::Web::Application; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
3 use strict; |
166 | 4 use parent qw(IMPL::Test::Unit); |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
5 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
6 use IMPL::Test qw(test failed); |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
7 require IMPL::Web::Application; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
8 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
9 __PACKAGE__->PassThroughArgs; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
10 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
11 sub CTOR { |
194 | 12 # simulate CGI environment |
13 | |
14 $ENV{PATH_TRANSLATED} = "Resources/simple.tt"; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
15 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
16 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
17 test SpawnApp => sub { |
194 | 18 my $instance = spawn Test::Web::Application::Instance('Resources/app.xml'); |
19 | |
20 return 1; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
21 }; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
22 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
23 test ActivateOnDemand => sub { |
194 | 24 my $instance = spawn Test::Web::Application::Instance('Resources/app.xml'); |
25 | |
26 my $ds = $instance->dataSource; | |
27 | |
28 return 1; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
29 }; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
30 |
61 | 31 test SaveXml => sub { |
194 | 32 my $instance = spawn Test::Web::Application::Instance('Resources/app.xml'); |
33 | |
34 $instance->xml or failed "xml property is invalid"; | |
63
76b878ad6596
Added serialization support for the IMPL::Object::List
wizard
parents:
61
diff
changeset
|
35 }; |
76b878ad6596
Added serialization support for the IMPL::Object::List
wizard
parents:
61
diff
changeset
|
36 |
76b878ad6596
Added serialization support for the IMPL::Object::List
wizard
parents:
61
diff
changeset
|
37 test Run => sub { |
194 | 38 my $instance = spawn Test::Web::Application::Instance('Resources/app.xml'); |
39 $instance->Run(); | |
61 | 40 }; |
41 | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
42 package Test::Web::Application::Instance; |
166 | 43 use parent qw(IMPL::Web::Application); |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
44 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
45 __PACKAGE__->PassThroughArgs; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
46 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
47 use IMPL::Class::Property; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
48 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
49 BEGIN { |
194 | 50 public property name => prop_all; |
51 public property options => prop_all; | |
52 public property dataSource => prop_all; | |
53 public property securityMod => prop_all; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
54 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
55 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
56 |
180 | 57 1; |