From: Sebastian Riedel Date: Fri, 21 Oct 2005 15:43:52 +0000 (+0000) Subject: Added some stress testing X-Git-Tag: 5.7099_04~1158 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d8c66af52b5353c93b1816e19c0f1cac69bc5ad1 Added some stress testing --- diff --git a/t/live/component/controller/action/begin.t b/t/live/component/controller/action/begin.t index f94d13b..144d929 100644 --- a/t/live/component/controller/action/begin.t +++ b/t/live/component/controller/action/begin.t @@ -6,29 +6,32 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 7; +use Test::More tests => 70; use Catalyst::Test 'TestApp'; -{ - my @expected = qw[ - TestApp::Controller::Action::Begin->begin - TestApp::Controller::Action::Begin->default - TestApp::View::Dump::Request->process - ]; +for ( 1 .. 10 ) { + { + my @expected = qw[ + TestApp::Controller::Action::Begin->begin + TestApp::Controller::Action::Begin->default + TestApp::View::Dump::Request->process + ]; - my $expected = join( ", ", @expected ); + my $expected = join( ", ", @expected ); - ok( my $response = request('http://localhost/action/begin'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Begin', - 'Test Class' - ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - like( $response->content, qr/'Catalyst::Request'/, - 'Content is a serialized Catalyst::Request' ); + ok( my $response = request('http://localhost/action/begin'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Begin', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( $response->content, qr/'Catalyst::Request'/, + 'Content is a serialized Catalyst::Request' ); + } } diff --git a/t/live/component/controller/action/default.t b/t/live/component/controller/action/default.t index b41893b..93e9de2 100644 --- a/t/live/component/controller/action/default.t +++ b/t/live/component/controller/action/default.t @@ -6,27 +6,38 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests=>9 ; +use Test::More tests => 90; use Catalyst::Test 'TestApp'; - -{ - my @expected = qw[ - TestApp::Controller::Action::Default->begin - TestApp::Controller::Action::Default->default - TestApp::View::Dump::Request->process - ]; - - my $expected = join( ", ", @expected ); - - ok( my $response = request('http://localhost/action/default'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Default', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); - - ok( $response = request('http://localhost/foo/bar/action'), 'Request' ); - is( $response->code, 404, 'Invalid URI returned 404' ); +for ( 1 .. 10 ) { + { + my @expected = qw[ + TestApp::Controller::Action::Default->begin + TestApp::Controller::Action::Default->default + TestApp::View::Dump::Request->process + ]; + + my $expected = join( ", ", @expected ); + + ok( my $response = request('http://localhost/action/default'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Default', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + + ok( $response = request('http://localhost/foo/bar/action'), 'Request' ); + is( $response->code, 404, 'Invalid URI returned 404' ); + } } diff --git a/t/live/component/controller/action/detach.t b/t/live/component/controller/action/detach.t index f33ee7a..7ea99b4 100644 --- a/t/live/component/controller/action/detach.t +++ b/t/live/component/controller/action/detach.t @@ -6,56 +6,79 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 18; +use Test::More tests => 180; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + my @expected = qw[ + TestApp::Controller::Action::Detach->begin + TestApp::Controller::Action::Detach->one + TestApp::Controller::Action::Detach->two + TestApp::View::Dump::Request->process + ]; -{ - my @expected = qw[ - TestApp::Controller::Action::Detach->begin - TestApp::Controller::Action::Detach->one - TestApp::Controller::Action::Detach->two - TestApp::View::Dump::Request->process - ]; + my $expected = join( ", ", @expected ); - my $expected = join( ", ", @expected ); + # Test detach to chain of actions. + ok( my $response = request('http://localhost/action/detach/one'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/detach/one', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Detach', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + } - # Test detach to chain of actions. - ok( my $response = request('http://localhost/action/detach/one'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/detach/one', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); -} + { + my @expected = qw[ + TestApp::Controller::Action::Detach->begin + TestApp::Controller::Action::Detach->path + TestApp::Controller::Action::Detach->two + TestApp::View::Dump::Request->process + ]; -{ - my @expected = qw[ - TestApp::Controller::Action::Detach->begin - TestApp::Controller::Action::Detach->path - TestApp::Controller::Action::Detach->two - TestApp::View::Dump::Request->process - ]; - - my $expected = join( ", ", @expected ); - - # Test detach to chain of actions. - ok( my $response = request('http://localhost/action/detach/path'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/detach/path', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); -} + my $expected = join( ", ", @expected ); -{ - ok( my $response = request('http://localhost/action/detach/with_args/old'), 'Request with args' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'new'); -} + # Test detach to chain of actions. + ok( my $response = request('http://localhost/action/detach/path'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/detach/path', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Detach', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + } + + { + ok( + my $response = + request('http://localhost/action/detach/with_args/old'), + 'Request with args' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'new' ); + } -{ - ok( my $response = request('http://localhost/action/detach/with_method_and_args/old'), 'Request with args and method' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'new'); + { + ok( + my $response = request( + 'http://localhost/action/detach/with_method_and_args/old'), + 'Request with args and method' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'new' ); + } } diff --git a/t/live/component/controller/action/end.t b/t/live/component/controller/action/end.t index 74da110..9042df2 100644 --- a/t/live/component/controller/action/end.t +++ b/t/live/component/controller/action/end.t @@ -6,25 +6,35 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 7; +use Test::More tests => 70; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + my @expected = qw[ + TestApp::Controller::Action::End->begin + TestApp::Controller::Action::End->default + TestApp::View::Dump::Request->process + TestApp::Controller::Action::End->end + ]; -{ - my @expected = qw[ - TestApp::Controller::Action::End->begin - TestApp::Controller::Action::End->default - TestApp::View::Dump::Request->process - TestApp::Controller::Action::End->end - ]; + my $expected = join( ", ", @expected ); - my $expected = join( ", ", @expected ); - - ok( my $response = request('http://localhost/action/end'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::End', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + ok( my $response = request('http://localhost/action/end'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::End', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } } diff --git a/t/live/component/controller/action/forward.t b/t/live/component/controller/action/forward.t index 6a991ee..1b7b9be 100644 --- a/t/live/component/controller/action/forward.t +++ b/t/live/component/controller/action/forward.t @@ -6,124 +6,128 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 30; +use Test::More tests => 300; use Catalyst::Test 'TestApp'; -{ - my @expected = qw[ - TestApp::Controller::Action::Forward->begin - TestApp::Controller::Action::Forward->one - TestApp::Controller::Action::Forward->two - TestApp::Controller::Action::Forward->three - TestApp::Controller::Action::Forward->four - TestApp::Controller::Action::Forward->five - TestApp::View::Dump::Request->process - ]; +for ( 1 .. 10 ) { + { + my @expected = qw[ + TestApp::Controller::Action::Forward->begin + TestApp::Controller::Action::Forward->one + TestApp::Controller::Action::Forward->two + TestApp::Controller::Action::Forward->three + TestApp::Controller::Action::Forward->four + TestApp::Controller::Action::Forward->five + TestApp::View::Dump::Request->process + ]; - my $expected = join( ", ", @expected ); + my $expected = join( ", ", @expected ); - # Test forward to global private action - ok( my $response = request('http://localhost/action/forward/global'), - 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), - 'action/forward/global', 'Main Class Action' ); + # Test forward to global private action + ok( my $response = request('http://localhost/action/forward/global'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/forward/global', 'Main Class Action' ); - # Test forward to chain of actions. - ok( $response = request('http://localhost/action/forward/one'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), - 'action/forward/one', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Forward', - 'Test Class' - ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - like( - $response->content, - qr/^bless\( .* 'Catalyst::Request' \)$/s, - 'Content is a serialized Catalyst::Request' - ); -} + # Test forward to chain of actions. + ok( $response = request('http://localhost/action/forward/one'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/forward/one', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Forward', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - my @expected = qw[ - TestApp::Controller::Action::Forward->begin - TestApp::Controller::Action::Forward->jojo - TestApp::Controller::Action::Forward->one - TestApp::Controller::Action::Forward->two - TestApp::Controller::Action::Forward->three - TestApp::Controller::Action::Forward->four - TestApp::Controller::Action::Forward->five - TestApp::View::Dump::Request->process - TestApp::Controller::Action::Forward->three - TestApp::Controller::Action::Forward->four - TestApp::Controller::Action::Forward->five - TestApp::View::Dump::Request->process - ]; + { + my @expected = qw[ + TestApp::Controller::Action::Forward->begin + TestApp::Controller::Action::Forward->jojo + TestApp::Controller::Action::Forward->one + TestApp::Controller::Action::Forward->two + TestApp::Controller::Action::Forward->three + TestApp::Controller::Action::Forward->four + TestApp::Controller::Action::Forward->five + TestApp::View::Dump::Request->process + TestApp::Controller::Action::Forward->three + TestApp::Controller::Action::Forward->four + TestApp::Controller::Action::Forward->five + TestApp::View::Dump::Request->process + ]; - my $expected = join( ", ", @expected ); + my $expected = join( ", ", @expected ); - ok( my $response = request('http://localhost/action/forward/jojo'), - 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), - 'action/forward/jojo', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Forward', - 'Test Class' - ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - like( - $response->content, - qr/^bless\( .* 'Catalyst::Request' \)$/s, - 'Content is a serialized Catalyst::Request' - ); -} + ok( my $response = request('http://localhost/action/forward/jojo'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/forward/jojo', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Forward', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( - my $response = request('http://localhost/action/forward/with_args/old'), - 'Request with args' - ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'old' ); -} + { + ok( + my $response = + request('http://localhost/action/forward/with_args/old'), + 'Request with args' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'old' ); + } -{ - ok( - my $response = - request('http://localhost/action/forward/with_method_and_args/old'), - 'Request with args and method' - ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'old' ); -} + { + ok( + my $response = request( + 'http://localhost/action/forward/with_method_and_args/old'), + 'Request with args and method' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'old' ); + } -# test forward with embedded args -{ - ok( - my $response = - request('http://localhost/action/forward/args_embed_relative'), - 'Request' - ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'ok' ); -} + # test forward with embedded args + { + ok( + my $response = + request('http://localhost/action/forward/args_embed_relative'), + 'Request' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'ok' ); + } -{ - ok( - my $response = - request('http://localhost/action/forward/args_embed_absolute'), - 'Request' - ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'ok' ); + { + ok( + my $response = + request('http://localhost/action/forward/args_embed_absolute'), + 'Request' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'ok' ); + } } diff --git a/t/live/component/controller/action/global.t b/t/live/component/controller/action/global.t index b1bb53a..44aad6d 100644 --- a/t/live/component/controller/action/global.t +++ b/t/live/component/controller/action/global.t @@ -6,33 +6,64 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 18; +use Test::More tests => 180; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + ok( my $response = request('http://localhost/action_global_one'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action_global_one', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Global', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action_global_one'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action_global_one', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} - -{ - ok( my $response = request('http://localhost/action_global_two'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action_global_two', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} + { + ok( my $response = request('http://localhost/action_global_two'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action_global_two', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Global', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action_global_three'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action_global_three', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + { + ok( my $response = request('http://localhost/action_global_three'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action_global_three', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Global', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } } diff --git a/t/live/component/controller/action/inheritance.t b/t/live/component/controller/action/inheritance.t index 19cd861..c6a8e89 100644 --- a/t/live/component/controller/action/inheritance.t +++ b/t/live/component/controller/action/inheritance.t @@ -6,69 +6,100 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests =>21; +use Test::More tests => 210; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + my @expected = qw[ + TestApp::Controller::Action::Inheritance->begin + TestApp::Controller::Action::Inheritance->auto + TestApp::Controller::Action::Inheritance->default + TestApp::View::Dump::Request->process + TestApp::Controller::Action::Inheritance->end + ]; -{ - my @expected = qw[ - TestApp::Controller::Action::Inheritance->begin - TestApp::Controller::Action::Inheritance->auto - TestApp::Controller::Action::Inheritance->default - TestApp::View::Dump::Request->process - TestApp::Controller::Action::Inheritance->end - ]; + my $expected = join( ", ", @expected ); - my $expected = join( ", ", @expected ); + ok( my $response = request('http://localhost/action/inheritance'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Inheritance', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } - ok( my $response = request('http://localhost/action/inheritance'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} - -{ - my @expected = qw[ - TestApp::Controller::Action::Inheritance::A->begin - TestApp::Controller::Action::Inheritance->auto - TestApp::Controller::Action::Inheritance::A->auto - TestApp::Controller::Action::Inheritance::A->default - TestApp::View::Dump::Request->process - TestApp::Controller::Action::Inheritance::A->end - ]; + { + my @expected = qw[ + TestApp::Controller::Action::Inheritance::A->begin + TestApp::Controller::Action::Inheritance->auto + TestApp::Controller::Action::Inheritance::A->auto + TestApp::Controller::Action::Inheritance::A->default + TestApp::View::Dump::Request->process + TestApp::Controller::Action::Inheritance::A->end + ]; - my $expected = join( ", ", @expected ); + my $expected = join( ", ", @expected ); - ok( my $response = request('http://localhost/action/inheritance/a'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance::A', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} + ok( my $response = request('http://localhost/action/inheritance/a'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Inheritance::A', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - my @expected = qw[ - TestApp::Controller::Action::Inheritance::A::B->begin - TestApp::Controller::Action::Inheritance->auto - TestApp::Controller::Action::Inheritance::A->auto - TestApp::Controller::Action::Inheritance::A::B->auto - TestApp::Controller::Action::Inheritance::A::B->default - TestApp::View::Dump::Request->process - TestApp::Controller::Action::Inheritance::A::B->end - ]; + { + my @expected = qw[ + TestApp::Controller::Action::Inheritance::A::B->begin + TestApp::Controller::Action::Inheritance->auto + TestApp::Controller::Action::Inheritance::A->auto + TestApp::Controller::Action::Inheritance::A::B->auto + TestApp::Controller::Action::Inheritance::A::B->default + TestApp::View::Dump::Request->process + TestApp::Controller::Action::Inheritance::A::B->end + ]; - my $expected = join( ", ", @expected ); + my $expected = join( ", ", @expected ); - ok( my $response = request('http://localhost/action/inheritance/a/b'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance::A::B', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + ok( my $response = request('http://localhost/action/inheritance/a/b'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Inheritance::A::B', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } } diff --git a/t/live/component/controller/action/local.t b/t/live/component/controller/action/local.t index 93f1dfb..47e872e 100644 --- a/t/live/component/controller/action/local.t +++ b/t/live/component/controller/action/local.t @@ -6,42 +6,86 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 24; +use Test::More tests => 240; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + ok( my $response = request('http://localhost/action/local/one'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/local/one', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Local', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action/local/one'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/local/one', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} - -{ - ok( my $response = request('http://localhost/action/local/two'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/local/two', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} + { + ok( my $response = request('http://localhost/action/local/two'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/local/two', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Local', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action/local/three'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/local/three', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} + { + ok( my $response = request('http://localhost/action/local/three'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/local/three', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Local', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action/local/four/five/six'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/local/four/five/six', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + { + ok( + my $response = + request('http://localhost/action/local/four/five/six'), + 'Request' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/local/four/five/six', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Local', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } } diff --git a/t/live/component/controller/action/multipath.t b/t/live/component/controller/action/multipath.t index 2d77968..a5edae0 100644 --- a/t/live/component/controller/action/multipath.t +++ b/t/live/component/controller/action/multipath.t @@ -6,7 +6,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 16; +use Test::More tests => 160; use Catalyst::Test 'TestApp'; my $content = q/foo @@ -14,36 +14,45 @@ bar baz /; -# Local -{ - ok( my $response = request('http://localhost/action/multipath/multipath'), - 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->content, $content, 'Content is a stream' ); -} - -# Global -{ - ok( my $response = request('http://localhost/multipath'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->content, $content, 'Content is a stream' ); -} - -# Path('/multipath1') -{ - ok( my $response = request('http://localhost/multipath1'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->content, $content, 'Content is a stream' ); -} - -# Path('multipath2') -{ - ok( my $response = request('http://localhost/action/multipath/multipath2'), - 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->content, $content, 'Content is a stream' ); +for ( 1 .. 10 ) { + + # Local + { + ok( + my $response = + request('http://localhost/action/multipath/multipath'), + 'Request' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); + } + + # Global + { + ok( my $response = request('http://localhost/multipath'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); + } + + # Path('/multipath1') + { + ok( my $response = request('http://localhost/multipath1'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); + } + + # Path('multipath2') + { + ok( + my $response = + request('http://localhost/action/multipath/multipath2'), + 'Request' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); + } } diff --git a/t/live/component/controller/action/path.t b/t/live/component/controller/action/path.t index 35f6183..643b9ce 100644 --- a/t/live/component/controller/action/path.t +++ b/t/live/component/controller/action/path.t @@ -6,24 +6,51 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 12; +use Test::More tests => 120; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + ok( + my $response = + request('http://localhost/action/path/a path with spaces'), + 'Request' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( + $response->header('X-Catalyst-Action'), + 'action/path/a path with spaces', + 'Test Action' + ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Path', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action/path/a path with spaces'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/path/a path with spaces', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Path', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} - -{ - ok( my $response = request('http://localhost/action/path/åäö'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/path/åäö', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Path', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + { + ok( my $response = request('http://localhost/action/path/åäö'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/path/åäö', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Path', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } } diff --git a/t/live/component/controller/action/private.t b/t/live/component/controller/action/private.t index 6539c4e..fda96ea 100644 --- a/t/live/component/controller/action/private.t +++ b/t/live/component/controller/action/private.t @@ -6,45 +6,70 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 24; +use Test::More tests => 240; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + ok( my $response = request('http://localhost/action/private/one'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Private', + 'Test Class' + ); + is( $response->content, 'access denied', 'Access' ); + } -{ - ok( my $response = request('http://localhost/action/private/one'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' ); - is( $response->content, 'access denied', 'Access' ); -} + { + ok( my $response = request('http://localhost/action/private/two'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Private', + 'Test Class' + ); + is( $response->content, 'access denied', 'Access' ); + } -{ - ok( my $response = request('http://localhost/action/private/two'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' ); - is( $response->content, 'access denied', 'Access' ); -} + { + ok( my $response = request('http://localhost/three'), 'Request' ); + ok( $response->is_error, 'Response Server Error 5xx' ); + is( $response->content_type, 'text/html', 'Response Content-Type' ); + like( + $response->header('X-Catalyst-Error'), + qr/^Unknown resource "three"/, + 'Catalyst Error' + ); + } -{ - ok( my $response = request('http://localhost/three'), 'Request' ); - ok( $response->is_error, 'Response Server Error 5xx' ); - is( $response->content_type, 'text/html', 'Response Content-Type' ); - like( $response->header('X-Catalyst-Error'), qr/^Unknown resource "three"/, 'Catalyst Error' ); -} - -{ - ok( my $response = request('http://localhost/action/private/four'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' ); - is( $response->content, 'access denied', 'Access' ); -} + { + ok( my $response = request('http://localhost/action/private/four'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Private', + 'Test Class' + ); + is( $response->content, 'access denied', 'Access' ); + } -{ - ok( my $response = request('http://localhost/action/private/five'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' ); - is( $response->content, 'access denied', 'Access' ); + { + ok( my $response = request('http://localhost/action/private/five'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Private', + 'Test Class' + ); + is( $response->content, 'access denied', 'Access' ); + } } diff --git a/t/live/component/controller/action/regexp.t b/t/live/component/controller/action/regexp.t index 6956552..ced2ac1 100644 --- a/t/live/component/controller/action/regexp.t +++ b/t/live/component/controller/action/regexp.t @@ -6,24 +6,45 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 12; +use Test::More tests => 120; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + ok( my $response = request('http://localhost/action/regexp/10/hello'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + '^action/regexp/(\d+)/(\w+)$', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Regexp', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action/regexp/10/hello'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), '^action/regexp/(\d+)/(\w+)$', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Regexp', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} - -{ - ok( my $response = request('http://localhost/action/regexp/hello/10'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), '^action/regexp/(\w+)/(\d+)$', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Regexp', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + { + ok( my $response = request('http://localhost/action/regexp/hello/10'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + '^action/regexp/(\w+)/(\d+)$', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Regexp', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } } diff --git a/t/live/component/controller/action/streaming.t b/t/live/component/controller/action/streaming.t index 1f34784..192e4de 100644 --- a/t/live/component/controller/action/streaming.t +++ b/t/live/component/controller/action/streaming.t @@ -6,38 +6,42 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 8; +use Test::More tests => 80; use Catalyst::Test 'TestApp'; -# test direct streaming -{ - ok( my $response = request('http://localhost/streaming'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->content,, <<'EOF', 'Content is a stream' ); +for ( 1 .. 10 ) { + + # test direct streaming + { + ok( my $response = request('http://localhost/streaming'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content,, <<'EOF', 'Content is a stream' ); foo bar baz EOF -} - -# test streaming by passing a handle to $c->res->body -SKIP: -{ - if ( $ENV{CATALYST_SERVER} ) { - skip "Using remote server", 4; } - - my $file = "$FindBin::Bin/../../../../01use.t"; - my $fh = IO::File->new( $file, 'r' ); - my $buffer; - if ( defined $fh ) { - $fh->read( $buffer, 1024 ); - $fh->close; + + # test streaming by passing a handle to $c->res->body + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip "Using remote server", 4; + } + + my $file = "$FindBin::Bin/../../../../01use.t"; + my $fh = IO::File->new( $file, 'r' ); + my $buffer; + if ( defined $fh ) { + $fh->read( $buffer, 1024 ); + $fh->close; + } + + ok( my $response = request('http://localhost/action/streaming/body'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $buffer, 'Content is read from filehandle' ); } - - ok( my $response = request('http://localhost/action/streaming/body'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->content, $buffer, 'Content is read from filehandle' ); }