[Catalyst-commits] r6230 - trunk/Catalyst-Engine-HTTP-POE/t
andyg at dev.catalyst.perl.org
andyg at dev.catalyst.perl.org
Thu Mar 29 02:29:10 GMT 2007
Author: andyg
Date: 2007-03-29 02:29:10 +0100 (Thu, 29 Mar 2007)
New Revision: 6230
Modified:
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_action.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_auto.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_begin.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_chained.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_default.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_detach.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_end.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_forward.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_global.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_index.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_inheritance.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_local.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_multipath.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_path.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_private.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_regexp.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_streaming.t
trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_args.t
trunk/Catalyst-Engine-HTTP-POE/t/live_engine_request_parameters.t
trunk/Catalyst-Engine-HTTP-POE/t/live_engine_response_redirect.t
trunk/Catalyst-Engine-HTTP-POE/t/live_fork.t
Log:
Sync tests to the POE engine
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_action.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_action.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_action.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 28 * $iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_auto.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_auto.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_auto.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 18*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_begin.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_begin.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_begin.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 7*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_chained.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_chained.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_chained.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 109*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_default.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_default.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_default.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 16 * $iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_detach.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_detach.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_detach.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 18*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_end.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_end.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_end.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 7*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_forward.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_forward.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_forward.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 47 * $iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_global.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_global.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_global.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 18*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_index.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_index.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_index.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 20*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_inheritance.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_inheritance.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_inheritance.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 21*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_local.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_local.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_local.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 32*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_multipath.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_multipath.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_multipath.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -13,7 +13,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 16*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_path.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_path.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_path.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 30*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_private.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_private.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_private.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 24*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_regexp.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_regexp.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_regexp.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 12*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_streaming.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_streaming.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_action_streaming.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -8,7 +8,7 @@
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
use Test::More tests => 8*$iters;
use Catalyst::Test 'TestApp';
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_args.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_args.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_component_controller_args.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -11,7 +11,7 @@
our @paths;
our $iters;
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2;
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1;
# add special paths to test here
@paths = (
@@ -62,29 +62,37 @@
} else {
$path = uri_escape($test);
}
+
+ SKIP:
+ {
+ # Skip %2F, ., [, (, and ) tests on real webservers
+ # Both Apache and lighttpd don't seem to like these
+ if ( $ENV{CATALYST_SERVER} && $path =~ /(?:%2F|\.|%5B|\(|\))/ ) {
+ skip "Skipping $path tests on remote server", 6;
+ }
- my $response;
+ my $response;
- ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path");
+ ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path");
- is( $response->content, $test, 'as args' );
+ is( $response->content, $test, "$test as args" );
- undef $response;
+ undef $response;
- ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path");
+ ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path");
- is( $response->content, $test, 'as params' );
+ is( $response->content, $test, "$test as params" );
- undef $response;
+ undef $response;
- if( $test =~ m{/} ) {
- $test =~ s{/}{}g;
- $path = uri_escape( $test );
- }
+ if( $test =~ m{/} ) {
+ $test =~ s{/}{}g;
+ $path = uri_escape( $test );
+ }
- ok( $response = request("http://localhost/chained/multi_cap/$path/baz"), "Requested capture for path $path");
+ ok( $response = request("http://localhost/chained/multi_cap/$path/baz"), "Requested capture for path $path");
- is( $response->content, join( ', ', split( //, $test ) ) ."; ", 'as capture' );
-
+ is( $response->content, join( ', ', split( //, $test ) ) ."; ", "$test as capture" );
+ }
}
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_engine_request_parameters.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_engine_request_parameters.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_engine_request_parameters.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -6,7 +6,7 @@
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 28;
+use Test::More tests => 30;
use Catalyst::Test 'TestApp';
use Catalyst::Request;
@@ -41,8 +41,9 @@
my $creq;
my $parameters = {
- 'a' => [qw(A b C d E f G)],
- '%' => [ '%', '"', '& - &' ],
+ 'a' => [qw(A b C d E f G)],
+ '%' => [ '%', '"', '& - &' ],
+ 'blank' => '',
};
my $request = POST(
@@ -78,7 +79,8 @@
my $creq;
my $parameters = {
- 'url' => 'http://www.google.com',
+ 'url' => 'http://www.google.com',
+ 'blank' => '',
};
my $request = POST( 'http://localhost/dump/request',
@@ -96,18 +98,21 @@
my $creq;
my $parameters = {
- a => 1,
+ a => 1,
+ blank => '',
};
my $request = POST(
- 'http://localhost/dump/request/a/b?query_string',
+ 'http://localhost/dump/request/a/b?query+string',
'Content' => $parameters,
'Content-Type' => 'application/x-www-form-urlencoded'
);
ok( my $response = request($request), 'Request' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
- is( $creq->{uri}->query, 'query_string', 'Catalyst::Request POST query_string' );
+ is( $creq->{uri}->query, 'query+string', 'Catalyst::Request POST query_string' );
+ is( $creq->keywords, 'query string', 'Catalyst::Request keywords' );
+ is_deeply( $creq->{parameters}, $parameters, 'Catalyst::Request parameters' );
ok( $response = request('http://localhost/dump/request/a/b?x=1&y=1&z=1'), 'Request' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_engine_response_redirect.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_engine_response_redirect.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_engine_response_redirect.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -6,7 +6,7 @@
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 20;
+use Test::More tests => 26;
use Catalyst::Test 'TestApp';
{
@@ -15,6 +15,8 @@
is( $response->code, 302, 'Response Code' );
is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/one', 'Test Action' );
is( $response->header('Location'), '/test/writing/is/boring', 'Response Header Location' );
+ ok( $response->header('Content-Length'), '302 Redirect contains Content-Length' );
+ ok( $response->content, '302 Redirect contains a response body' );
}
{
@@ -31,6 +33,8 @@
is( $response->code, 301, 'Response Code' );
is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/three', 'Test Action' );
is( $response->header('Location'), 'http://www.google.com/', 'Response Header Location' );
+ ok( $response->header('Content-Length'), '301 Redirect contains Content-Length' );
+ ok( $response->content, '301 Redirect contains a response body' );
}
{
@@ -39,4 +43,6 @@
is( $response->code, 307, 'Response Code' );
is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/four', 'Test Action' );
is( $response->header('Location'), 'http://www.google.com/', 'Response Header Location' );
+ ok( $response->header('Content-Length'), '307 Redirect contains Content-Length' );
+ ok( $response->content, '307 Redirect contains a response body' );
}
Modified: trunk/Catalyst-Engine-HTTP-POE/t/live_fork.t
===================================================================
--- trunk/Catalyst-Engine-HTTP-POE/t/live_fork.t 2007-03-28 23:07:12 UTC (rev 6229)
+++ trunk/Catalyst-Engine-HTTP-POE/t/live_fork.t 2007-03-29 01:29:10 UTC (rev 6230)
@@ -15,7 +15,12 @@
use lib "$FindBin::Bin/lib";
use Catalyst::Test qw(TestApp);
-plan 'skip_all' if !-e '/bin/ls'; # see if /bin/ls exists
+plan skip_all => 'Using remote server'
+ if $ENV{CATALYST_SERVER};
+
+plan skip_all => 'Skipping fork tests: no /bin/ls'
+ if !-e '/bin/ls'; # see if /bin/ls exists
+
plan tests => 13; # otherwise
{
More information about the Catalyst-commits
mailing list