Catalyst-Engine-HTTP-POE
view release on metacpan or search on metacpan
- Added prefork support.
0.04 2006-12-13 13:40:00
- Fixed bug that would cause simultaneous requests to break if plugins
that use NEXT were involved.
0.03 2006-04-24 17:00:00
- No changes, new release for CPAN indexing.
0.02 2006-04-22 22:00:00
- Full support for Catalyst 5.67+, streaming I/O, etc.
- Can handle UploadProgress in a single thread!
0.01 2005-05-24 21:59:00
- Initial release for Catalyst 5.33 (chansen).
t/live_component_controller_action_end.t
t/live_component_controller_action_forward.t
t/live_component_controller_action_global.t
t/live_component_controller_action_index.t
t/live_component_controller_action_inheritance.t
t/live_component_controller_action_local.t
t/live_component_controller_action_multipath.t
t/live_component_controller_action_path.t
t/live_component_controller_action_private.t
t/live_component_controller_action_regexp.t
t/live_component_controller_action_streaming.t
t/live_component_controller_args.t
t/live_engine_request_body.t
t/live_engine_request_body_demand.t
t/live_engine_request_cookies.t
t/live_engine_request_headers.t
t/live_engine_request_parameters.t
t/live_engine_request_uploads.t
t/live_engine_request_uri.t
t/live_engine_response_cookies.t
t/live_engine_response_errors.t
t/lib/TestApp/Controller/Action/Streaming.pm view on Meta::CPAN
package TestApp::Controller::Action::Streaming;
use strict;
use base 'TestApp::Controller::Action';
sub streaming : Global {
my ( $self, $c ) = @_;
for my $line ( split "\n", <<'EOF' ) {
foo
bar
baz
EOF
$c->res->write("$line\n");
}
}
t/live_component_controller_action_streaming.t view on Meta::CPAN
require Benchmark;
Benchmark::timethis( $iters, \&run_tests );
}
else {
for ( 1 .. $iters ) {
run_tests();
}
}
sub run_tests {
# 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' );
SKIP:
{
if ( $ENV{CATALYST_SERVER} ) {
skip "Using remote server", 1;
}
# XXX: Length should be undef here, but HTTP::Request::AsCGI sets it
is( $response->content_length, 12, 'Response Content-Length' );
}
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", 5;
}
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_length, -s $file, 'Response Content-Length' );
is( $response->content, $buffer, 'Content is read from filehandle' );
}
}
( run in 0.280 second using v1.01-cache-2.11-cpan-a5abf4f5562 )