http-webtest-commits Mailing List for HTTP-WebTest (Page 8)
Brought to you by:
m_ilya,
richardanderson
You can subscribe to this list here.
| 2002 |
Jan
(38) |
Feb
(83) |
Mar
(10) |
Apr
(28) |
May
(42) |
Jun
(61) |
Jul
(43) |
Aug
(42) |
Sep
(14) |
Oct
(27) |
Nov
(16) |
Dec
(81) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(81) |
Feb
(29) |
Mar
(32) |
Apr
(42) |
May
(3) |
Jun
|
Jul
(11) |
Aug
|
Sep
(33) |
Oct
(6) |
Nov
(4) |
Dec
|
| 2004 |
Jan
|
Feb
|
Mar
(10) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 18:01:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv14711
Modified Files:
Parser.pm
Log Message:
Fix bug with 'test_name' parameter
Index: Parser.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Parser.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Parser.pm 25 Jan 2003 17:46:27 -0000 1.19
--- Parser.pm 25 Jan 2003 18:01:21 -0000 1.20
***************
*** 303,306 ****
--- 303,307 ----
my $param = $params_aref->[2 * $i];
my $value = $params_aref->[2 * $i + 1];
+ next if $param eq 'test_name';
$wtscript .= _write_param_value($params_aref->[2 * $i],
$params_aref->[2 * $i + 1],
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:48:08
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory sc8-pr-cvs1:/tmp/cvs-serv4370/t
Modified Files:
06-parser.t 01-api.t
Log Message:
Tests for new parser API
Index: 06-parser.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/06-parser.t,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** 06-parser.t 3 Jan 2003 22:32:32 -0000 1.19
--- 06-parser.t 25 Jan 2003 17:48:05 -0000 1.20
***************
*** 10,14 ****
use HTTP::WebTest::SelfTest;
! use Test::More tests => 68;
# 1-60: check parsed wt script (which contains all variants of
--- 10,14 ----
use HTTP::WebTest::SelfTest;
! use Test::More tests => 69;
# 1-60: check parsed wt script (which contains all variants of
***************
*** 95,99 ****
}
! # 61-68: check error handling for borked wtscript files
parse_error_check(wtscript => 't/borked1.wt',
check_file => 't/test.out/borked1.err');
--- 95,99 ----
}
! # 61-68: test error handling for borked wtscript files
parse_error_check(wtscript => 't/borked1.wt',
check_file => 't/test.out/borked1.err');
***************
*** 121,124 ****
--- 121,135 ----
parse_error_check(wtscript => 't/borked8.wt',
check_file => 't/test.out/borked8.err');
+
+ # 69: test writing wtscript for single test
+ {
+ my @params = ( xxx => 'yyy',
+ zzz => [ 1 => 2 ],
+ abc => [ 1 => [ 2 => 3 ] ],
+ bad => [ qw|( ) ' \' " => { }| ]);
+ my $output = HTTP::WebTest::Parser->write_test(\@params);
+ compare_output(check_file => 't/test.out/write_params',
+ output_ref => \$output);
+ }
sub parse_error_check {
Index: 01-api.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/01-api.t,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** 01-api.t 22 Dec 2002 21:25:50 -0000 1.14
--- 01-api.t 25 Jan 2003 17:48:05 -0000 1.15
***************
*** 12,16 ****
use HTTP::WebTest::Utils qw(start_webserver stop_webserver);
! use Test::More tests => 15;
# init test
--- 12,16 ----
use HTTP::WebTest::Utils qw(start_webserver stop_webserver);
! use Test::More tests => 19;
# init test
***************
*** 27,31 ****
my $user_agent = new LWP::UserAgent;
$WEBTEST->user_agent($user_agent);
! ok($WEBTEST->user_agent eq $user_agent);
}
--- 27,31 ----
my $user_agent = new LWP::UserAgent;
$WEBTEST->user_agent($user_agent);
! is($WEBTEST->user_agent, $user_agent);
}
***************
*** 39,43 ****
{
my $aref = $WEBTEST->tests;
! ok(@$aref == 0);
}
--- 39,43 ----
{
my $aref = $WEBTEST->tests;
! is(@$aref, 0);
}
***************
*** 49,53 ****
my $request = $WEBTEST->current_request;
my $response = $WEBTEST->current_response;
! ok($request->uri eq $url);
ok($response->is_success);
}
--- 49,53 ----
my $request = $WEBTEST->current_request;
my $response = $WEBTEST->current_response;
! is($request->uri->as_string, $url->as_string);
ok($response->is_success);
}
***************
*** 68,72 ****
{
my $aref = $WEBTEST->tests;
! ok(@$aref == 3);
}
--- 68,72 ----
{
my $aref = $WEBTEST->tests;
! is(@$aref, 3);
}
***************
*** 76,81 ****
my ($tests, $opts) = $WEBTEST->parse($data);
! ok($tests->[0]{test_name} eq 'Some name here');
! ok($opts->{text_require}[0] eq 'Require some');
}
--- 76,81 ----
my ($tests, $opts) = $WEBTEST->parse($data);
! is($tests->[0]{test_name}, 'Some name here');
! is($opts->{text_require}[0], 'Require some');
}
***************
*** 124,129 ****
$WEBTEST->run_tests($tests, { output_ref => \$output });
! ok($WEBTEST->num_fail == 2);
! ok($WEBTEST->num_succeed == 1);
}
--- 124,129 ----
$WEBTEST->run_tests($tests, { output_ref => \$output });
! is($WEBTEST->num_fail, 2);
! is($WEBTEST->num_succeed, 1);
}
***************
*** 136,140 ****
$WEBTEST->run_tests($tests, { output_ref => \$output });
! ok($WEBTEST->current_test->request->uri eq abs_url($URL, '/doesnt-exist'));
}
--- 136,160 ----
$WEBTEST->run_tests($tests, { output_ref => \$output });
! is($WEBTEST->current_test->request->uri->as_string,
! abs_url($URL, '/doesnt-exist')->as_string);
! }
!
! # 16-19: test $WEBTEST->parser_package
! {
! is($WEBTEST->parser_package, 'HTTP::WebTest::Parser');
! {
! package TestParser;
!
! sub parse { [ x => 'z' ], { 1 => 2 } };
! };
! # set non default parser
! $WEBTEST->parser_package('TestParser');
! is($WEBTEST->parser_package, 'TestParser');
! is_deeply([ [ x => 'z' ], { 1 => 2 } ],
! [ $WEBTEST->parse('a = b') ]);
! # reset to default
! $WEBTEST->parser_package(undef);
! is_deeply([ [ ], { a => 'b' } ],
! [ $WEBTEST->parse('a = b') ]);
}
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:47:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory sc8-pr-cvs1:/tmp/cvs-serv3686 Modified Files: MANIFEST Changes Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** MANIFEST 13 Dec 2002 00:51:21 -0000 1.29 --- MANIFEST 25 Jan 2003 17:47:19 -0000 1.30 *************** *** 126,129 **** --- 126,130 ---- t/test.out/timeout t/test.out/user_agent + t/test.out/write_params t/test1.html t/test1.txt Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Changes 18 Jan 2003 10:14:55 -0000 1.70 --- Changes 25 Jan 2003 17:47:19 -0000 1.71 *************** *** 9,12 **** --- 9,18 ---- * Port self-testing suite from Test to Test::More. + * HTTP::WebTest allows to specify non-default parser for wtscript + files. + + * Now HTTP::WebTest::Parser can generate wtscript files from test + parameters. + DEPRECATIONS: |
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:46:29
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv3018/lib/HTTP/WebTest
Modified Files:
Parser.pm
Log Message:
Can write wtscript files now
Index: Parser.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Parser.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Parser.pm 22 Aug 2002 07:21:50 -0000 1.18
--- Parser.pm 25 Jan 2003 17:46:27 -0000 1.19
***************
*** 278,281 ****
--- 278,358 ----
}
+ =head2 write_test ($params_aref)
+
+ Given a set of test parameters generates text representation of the
+ test.
+
+ =head3 Returns
+
+ The test text.
+
+ =cut
+
+ sub write_test {
+ my $class = shift;
+ my($params_aref) = @_;
+ my %params = @$params_aref;
+
+ my $wtscript = '';
+
+ $wtscript .= _write_param_value('test_name',
+ $params{test_name} || 'N/A',
+ '');
+
+ for(my $i = 0; $i < @$params_aref/2; $i ++) {
+ my $param = $params_aref->[2 * $i];
+ my $value = $params_aref->[2 * $i + 1];
+ $wtscript .= _write_param_value($params_aref->[2 * $i],
+ $params_aref->[2 * $i + 1],
+ ' ' x 4);
+ }
+
+ $wtscript .= "end_test\n";
+
+ return $wtscript;
+ }
+
+ sub _write_param_value {
+ my($param, $value, $indent) = @_;
+
+ my $wtscript = "$indent$param = ";
+ my $value_indent = ' ' x length($wtscript);
+ $wtscript .= _write_value($value, $value_indent) . "\n";
+
+ return $wtscript;
+ }
+
+ sub _write_value {
+ my($value, $indent) = @_;
+
+ my $wtscript = '';
+ if(UNIVERSAL::isa($value, 'ARRAY')) {
+ $wtscript .= "(\n";
+ for my $subvalue (@$value) {
+ my $subindent = "$indent ";
+ $wtscript .= $subindent;
+ $wtscript .= _write_value($subvalue, $subindent);
+ $wtscript .= "\n";
+ }
+ $wtscript .= "$indent)";
+ } else {
+ $wtscript .= _write_scalar($value);
+ }
+
+ return $wtscript;
+ }
+
+ sub _write_scalar {
+ my($scalar) = @_;
+
+ if($scalar =~ /[()'"{}]/ or $scalar =~ /=>/) {
+ my $q_scalar = $scalar;
+ $q_scalar =~ s/(['\\])/\\$1/g;
+ return "'" . $q_scalar . "'";
+ } else {
+ return $scalar;
+ }
+ }
+
=head1 COPYRIGHT
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:45:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv2490/lib/HTTP/WebTest
Modified Files:
API.pm
Log Message:
Let use non-default parser class
Index: API.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** API.pm 2 Jan 2003 20:49:49 -0000 1.27
--- API.pm 25 Jan 2003 17:45:51 -0000 1.28
***************
*** 251,254 ****
--- 251,268 ----
}
+ =head2 parser_package($optional_parser_package)
+
+ If $optional_parser is defined sets a parser package to use when
+ parsing wtscript files. Otherwise just returns current parser package.
+
+ =head3 Returns
+
+ The parser package.
+
+ =cut
+
+ *parser_package = make_access_method('PARSER_PACKAGE',
+ sub { 'HTTP::WebTest::Parser' });
+
=head2 parse ($data)
***************
*** 283,289 ****
my $data = shift;
! # load parsing module on demand - it is quite heavy
! load_package('HTTP::WebTest::Parser');
! my ($tests, $opts) = HTTP::WebTest::Parser->parse($data);
return ($tests, $opts);
--- 297,304 ----
my $data = shift;
! load_package('HTTP::WebTest::Parser')
! unless(UNIVERSAL::can($self->parser_package, 'parse'));
!
! my ($tests, $opts) = $self->parser_package->parse($data);
return ($tests, $opts);
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:45:23
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out
In directory sc8-pr-cvs1:/tmp/cvs-serv2196/t/test.out
Added Files:
write_params
Log Message:
Added
--- NEW FILE: write_params ---
test_name = N/A
xxx = yyy
zzz = (
1
2
)
abc = (
1
(
2
3
)
)
bad = (
'('
')'
'\''
'\\\''
'"'
'=>'
'{'
'}'
)
end_test
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:44:40
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin
In directory sc8-pr-cvs1:/tmp/cvs-serv1593/lib/HTTP/WebTest/Plugin
Modified Files:
Click.pm
Log Message:
Cosmetic fixes: fix indenting
Index: Click.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Click.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Click.pm 12 Dec 2002 23:22:14 -0000 1.15
--- Click.pm 25 Jan 2003 17:44:37 -0000 1.16
***************
*** 116,121 ****
} elsif(defined $form_name) {
# find action which corresponds to requested form name
! my $action = $self->find_form(response => $response,
! form_name => $form_name);
$request->base_uri($action)
--- 116,121 ----
} elsif(defined $form_name) {
# find action which corresponds to requested form name
! my $action = $self->find_form(response => $response,
! form_name => $form_name);
$request->base_uri($action)
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 17:42:11
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv32060/lib/HTTP/WebTest
Modified Files:
SelfTest.pm
Log Message:
Cosmetic fix: better formatting of diffs for failed tests
Index: SelfTest.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/SelfTest.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SelfTest.pm 22 Dec 2002 21:25:50 -0000 1.5
--- SelfTest.pm 25 Jan 2003 17:42:06 -0000 1.6
***************
*** 367,371 ****
for my $hunk (@diff) {
for my $diff_str (@$hunk) {
! print "@$diff_str\n";
}
}
--- 367,371 ----
for my $hunk (@diff) {
for my $diff_str (@$hunk) {
! printf "%s %03d %s\n", @$diff_str;
}
}
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 15:24:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv7122/lib/HTTP/WebTest/Recorder/template
Modified Files:
page.inc list
Log Message:
Display 'turn off/on recorder' only on list page
Index: page.inc
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template/page.inc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** page.inc 25 Jan 2003 14:54:51 -0000 1.1
--- page.inc 25 Jan 2003 15:24:47 -0000 1.2
***************
*** 2,6 ****
[% USE HTML %]
- [% USE enable_url = URL('enable') %]
<html>
--- 2,5 ----
***************
*** 9,18 ****
</head>
<body>
-
- [% IF controller.recorder.is_recording %]
- <p><a href="[% enable_url(enable => 0) %]">Turn off</a> recording</p>
- [% ELSE %]
- <p><a href="[% enable_url(enable => 1) %]">Turn on</a> recording</p>
- [% END %]
<h1>[% HTML.escape(title) %]</h1>
--- 8,11 ----
Index: list
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template/list,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** list 25 Jan 2003 14:54:51 -0000 1.1
--- list 25 Jan 2003 15:24:47 -0000 1.2
***************
*** 4,10 ****
[% USE HTML %]
! [% USE request_url = URL('request') %]
[% IF tests.size > 0 %]
<table>
--- 4,18 ----
[% USE HTML %]
! [% USE enable_url = URL('enable') %]
!
! [% IF controller.recorder.is_recording %]
! <p><a href="[% enable_url(enable => 0) %]">Turn off</a> recording</p>
! [% ELSE %]
! <p><a href="[% enable_url(enable => 1) %]">Turn on</a> recording</p>
! [% END %]
[% IF tests.size > 0 %]
+
+ [% USE request_url = URL('request') %]
<table>
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:58:18
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv28339 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/MANIFEST,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MANIFEST 3 Jan 2003 23:01:12 -0000 1.1.1.1 --- MANIFEST 25 Jan 2003 14:58:14 -0000 1.2 *************** *** 2,13 **** Makefile.PL bin/rec-proxy - lib/HTTP/WebTest/Action.pm - lib/HTTP/WebTest/Action/List.pm - lib/HTTP/WebTest/Action/Request.pm - lib/HTTP/WebTest/Controller.pm lib/HTTP/WebTest/Recorder.pm ! lib/HTTP/WebTest/template/list ! lib/HTTP/WebTest/template/page.inc ! lib/HTTP/WebTest/template/request t/01-recorder.t t/02-controller.t --- 2,17 ---- Makefile.PL bin/rec-proxy lib/HTTP/WebTest/Recorder.pm ! lib/HTTP/WebTest/Recorder/Action.pm ! lib/HTTP/WebTest/Recorder/Action/Enable.pm ! lib/HTTP/WebTest/Recorder/Action/List.pm ! lib/HTTP/WebTest/Recorder/Action/Request.pm ! lib/HTTP/WebTest/Recorder/Action/WTScript.pm ! lib/HTTP/WebTest/Recorder/Controller.pm ! lib/HTTP/WebTest/Recorder/Exceptions.pm ! lib/HTTP/WebTest/Recorder/template/list ! lib/HTTP/WebTest/Recorder/template/page.inc ! lib/HTTP/WebTest/Recorder/template/request ! lib/HTTP/WebTest/Recorder/template/wtscript t/01-recorder.t t/02-controller.t *************** *** 15,20 **** t/04-action-list.t t/05-action-request.t ! t/HTTP/WebTest/template/testcrash ! t/HTTP/WebTest/template/testdump ! t/HTTP/WebTest/template/testme t/test1.txt --- 19,28 ---- t/04-action-list.t t/05-action-request.t ! t/06-action-wtscript.t ! t/07-action-enable.t ! t/50-web.t ! t/HTTP/WebTest/Recorder/template/testcrash ! t/HTTP/WebTest/Recorder/template/testdump ! t/HTTP/WebTest/Recorder/template/testme ! t/init.wt t/test1.txt |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:57:45
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv28023 Added Files: MANIFEST.SKIP Log Message: Added --- NEW FILE: MANIFEST.SKIP --- \bCVS\b ^MANIFEST\. ^Makefile$ TAGS$ ~$ \.bak$ \.old$ ^blib/ ^pm_to_blib$ \# \.cvsignore$ \.config$ \.out$ ^build-stamp ^debian |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:57:16
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv27706/t
Added Files:
init.wt 50-web.t
Log Message:
Starting of functional tests
--- NEW FILE: init.wt ---
test_name = Empty list of request/response pairs
url = "${::URL}webtest/list"
text_require = ( List of Request/Response Pairs
No request/response have been recorded. )
end_test
--- NEW FILE: 50-web.t ---
#!/usr/bin/perl -w
use strict;
use HTTP::Request::Common;
use HTTP::Status;
use HTTP::WebTest;
use HTTP::WebTest::Utils qw(start_webserver stop_webserver);
use HTTP::WebTest::SelfTest;
use Test::More tests => 3;
require_ok('HTTP::WebTest::Recorder');
# test constructors
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
my $PID = start_webserver(port => $PORT, server_sub => \&server_sub);
# tests of web UI for just started recorder
{
if($ENV{TEST_RECORDING}) {
warn "\nRecording test (port=$PORT). Press enter when finished\n";
scalar <>;
}
my $webtest = HTTP::WebTest->new;
$webtest->run_wtscript('t/init.wt',
{ plugins => [ '::HarnessReport' ],
default_report => 'no' }
);
}
END { stop_webserver($PID) if defined $PID }
# handles connects to our mini web server
sub server_sub {
my %param = @_;
my $response = $RECORDER->handle($param{request});
$param{connect}->send_response($response);
};
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv26219/lib/HTTP/WebTest
Modified Files:
Recorder.pm
Removed Files:
Exceptions.pm Controller.pm Action.pm
Log Message:
Move everything in HTTP::WebTest::Recorder namespace
Index: Recorder.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Recorder.pm 18 Jan 2003 17:03:59 -0000 1.3
--- Recorder.pm 25 Jan 2003 14:54:52 -0000 1.4
***************
*** 21,29 ****
use strict;
- use HTTP::WebTest::Controller;
use HTTP::WebTest::Test;
use HTTP::WebTest::Utils qw(make_access_method);
use LWP::UserAgent;
# constructor
sub new {
--- 21,30 ----
use strict;
use HTTP::WebTest::Test;
use HTTP::WebTest::Utils qw(make_access_method);
use LWP::UserAgent;
+ use HTTP::WebTest::Recorder::Controller;
+
# constructor
sub new {
***************
*** 43,48 ****
*ui_path = make_access_method('UI_PATH');
# controller object
! *controller = make_access_method('CONTROLLER',
! sub { HTTP::WebTest::Controller->new } );
# user agent to do proxying
*user_agent = make_access_method('USER_AGENT', sub { LWP::UserAgent->new });
--- 44,50 ----
*ui_path = make_access_method('UI_PATH');
# controller object
! *controller =
! make_access_method('CONTROLLER',
! sub { HTTP::WebTest::Recorder::Controller->new } );
# user agent to do proxying
*user_agent = make_access_method('USER_AGENT', sub { LWP::UserAgent->new });
--- Exceptions.pm DELETED ---
--- Controller.pm DELETED ---
--- Action.pm DELETED ---
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Action In directory sc8-pr-cvs1:/tmp/cvs-serv26219/lib/HTTP/WebTest/Action Removed Files: WTScript.pm Request.pm List.pm Enable.pm Log Message: Move everything in HTTP::WebTest::Recorder namespace --- WTScript.pm DELETED --- --- Request.pm DELETED --- --- List.pm DELETED --- --- Enable.pm DELETED --- |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:55
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Action
In directory sc8-pr-cvs1:/tmp/cvs-serv26219/lib/HTTP/WebTest/Recorder/Action
Added Files:
WTScript.pm Request.pm List.pm Enable.pm
Log Message:
Move everything in HTTP::WebTest::Recorder namespace
--- NEW FILE: WTScript.pm ---
package HTTP::WebTest::Recorder::Action::WTScript;
# $Id: WTScript.pm,v 1.1 2003/01/25 14:54:52 m_ilya Exp $
use strict;
use base qw(HTTP::WebTest::Recorder::Action);
use CGI;
sub execute {
my $self = shift;
my $controller = shift;
my @tests = @{$controller->recorder->tests};
my $wtscript = join "\n", map $self->test2wtscript($_), @tests;
return($self->SUPER::execute($controller),
wtscript => $wtscript);
}
sub test2wtscript {
my $self = shift;
my $test = shift;
my $request = $test->request;
my $wtscript = '';
$wtscript .= "test_name = N/A\n";
my $short_uri = URI->new($request->uri);
$short_uri->query(undef);
$wtscript .= ' url = ' . $short_uri . "\n";
$wtscript .= ' method = ' . $request->method . "\n"
if $request->method ne 'GET';
my $cgi;
if($request->method eq 'POST') {
$cgi = CGI->new($request->content);
} else {
$cgi = CGI->new($request->uri->query);
}
if($cgi->param) {
$wtscript .= " params = (\n";
for my $param ($cgi->param) {
$wtscript .= ' ' .
$param . ' => ' . $cgi->param($param) . "\n";
}
$wtscript .= " )\n";
}
$wtscript .= "end_test\n";
return $wtscript;
}
1;
--- NEW FILE: Request.pm ---
package HTTP::WebTest::Recorder::Action::Request;
# $Id: Request.pm,v 1.1 2003/01/25 14:54:52 m_ilya Exp $
use strict;
use base qw(HTTP::WebTest::Recorder::Action);
sub execute {
my $self = shift;
my $controller = shift;
my $num = $controller->cgi->param('num');
my $test = $controller->recorder->tests->[$num];
return($self->SUPER::execute($controller),
test => $test);
}
1;
--- NEW FILE: List.pm ---
package HTTP::WebTest::Recorder::Action::List;
# $Id: List.pm,v 1.1 2003/01/25 14:54:52 m_ilya Exp $
use strict;
use base qw(HTTP::WebTest::Recorder::Action);
sub execute {
my $self = shift;
my $controller = shift;
return($self->SUPER::execute($controller),
tests => $controller->recorder->tests);
}
1;
--- NEW FILE: Enable.pm ---
package HTTP::WebTest::Recorder::Action::Enable;
# $Id: Enable.pm,v 1.1 2003/01/25 14:54:52 m_ilya Exp $
use strict;
use base qw(HTTP::WebTest::Recorder::Action);
sub execute {
my $self = shift;
my $controller = shift;
my $enable = $controller->cgi->param('enable');
$controller->recorder->is_recording($enable);
$controller->redirect('list');
}
1;
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:55
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv26219/lib/HTTP/WebTest/Recorder
Added Files:
Exceptions.pm Controller.pm Action.pm
Log Message:
Move everything in HTTP::WebTest::Recorder namespace
--- NEW FILE: Exceptions.pm ---
package HTTP::WebTest::Recorder::Exceptions;
use strict;
my %EXC;
BEGIN {
%EXC = ( HTTP::WebTest::Recorder::Exception =>
{ description =>
'Generic base class for all Investion exceptions' },
HTTP::WebTest::Recorder::Exception::Redirect =>
{ isa => 'HTTP::WebTest::Recorder::Exception',
fields => [ 'url' ],
description => 'Redirect message' },
);
}
use Exception::Class %EXC;
{
package HTTP::WebTest::Recorder::Exception;
# have nice stack trace output
sub as_string {
my $self = shift;
my $str = $self->full_message;
chomp $str;
if(exists $self->{show_trace} ? $self->{show_trace} : $self->Trace) {
$str .= "\n\n\n" . $self->_stack_trace . "\n\n";
}
return $str;
}
sub _stack_trace {
my $self = shift;
my $str = '';
while(my $frame = $self->trace->next_frame) {
next if $frame->subroutine eq 'Exception::Class::Base::throw';
my $args = join ', ', map defined $_ ? "'$_'" : 'undef', $frame->args;
$str .= ' [' . $frame->filename . ':' . $frame->line . '] ';
$str .= $frame->subroutine . "($args)\n";
}
return $str;
}
}
1;
--- NEW FILE: Controller.pm ---
package HTTP::WebTest::Recorder::Controller;
# $Id: Controller.pm,v 1.1 2003/01/25 14:54:52 m_ilya Exp $
use strict;
use CGI;
use File::Spec;
use HTTP::Status;
use HTTP::WebTest::Utils qw(make_access_method);
use Template;
use HTTP::WebTest::Recorder::Exceptions;
# constructor
sub new {
my $class = shift;
my $self = bless {}, $class;
return $self;
}
# recorder object
*recorder = make_access_method('RECORDER');
# template toolkit object
*template = make_access_method('TEMPLATE', 'create_template');
# view (template filename)
*view = make_access_method('VIEW');
# cgi object
*cgi = make_access_method('CGI');
# request object
*request = make_access_method('REQUEST');
use vars qw(%DISPATCH);
%DISPATCH = (list => 'HTTP::WebTest::Recorder::Action::List',
request => 'HTTP::WebTest::Recorder::Action::Request',
wtscript => 'HTTP::WebTest::Recorder::Action::WTScript',
enable => 'HTTP::WebTest::Recorder::Action::Enable',
default => 'HTTP::WebTest::Recorder::Action');
# serves requests for web interface of the proxy
sub execute {
my $self = shift;
my %param = @_;
# init controller with request data
$self->recorder($param{recorder});
$self->request($param{request});
$self->cgi($self->create_cgi($param{request}));
$self->view($param{action});
my $action_package = $DISPATCH{$param{action}} || $DISPATCH{default};
eval "require $action_package";
my $action = $action_package->new;
my $response;
eval {
$response = $self->process_template($action->execute($self));
};
if($@) {
if($@->isa('HTTP::WebTest::Recorder::Exception::Redirect')) {
$response = HTTP::Response->new(RC_FOUND);
$response->header(Location => $@->url);
} else {
$@->rethrow;
}
};
$response->header(Pragma => 'No-Cache');
return $response;
}
# populates template with data returned by action object and generates
# response based on template output
sub process_template {
my $self = shift;
my %data = @_;
my $content = '';
if($self->template->process($self->view, \%data, \$content)) {
my $response = HTTP::Response->new(RC_OK);
$response->header(Content_Type => 'text/html');
$response->content($content);
return $response;
} elsif($self->template->error =~ /file error - .*: not found/) {
my $response = HTTP::Response->new(RC_NOT_FOUND);
$response->header(Content_Type => 'text/plain');
$response->content('Not Found');
return $response;
} else {
my $response = HTTP::Response->new(RC_INTERNAL_SERVER_ERROR);
$response->header(Content_Type => 'text/plain');
$response->content($self->template->error);
return $response;
}
}
# generates redirect exception
sub redirect {
my $self = shift;
my $url = shift;
HTTP::WebTest::Recorder::Exception::Redirect->throw(message => 'Redirect',
url => $url);
}
# create CGI object from HTTP request object
sub create_cgi {
my $self = shift;
my $request = shift;
my $query = '';
if($request->method eq 'GET') {
$query = $request->uri->query;
} elsif($request->method eq 'POST') {
$query = $request->content;
}
return CGI->new($query);
}
# creates template toolkit object
sub create_template {
my $self = shift;
# search template files in standart Perl include directories
my @template_dir = qw(HTTP WebTest Recorder template);
my $include_path = (join ':',
map File::Spec->catdir($_, @template_dir),
@INC);
return Template->new(INCLUDE_PATH => $include_path);
}
1;
--- NEW FILE: Action.pm ---
package HTTP::WebTest::Recorder::Action;
# $Id: Action.pm,v 1.1 2003/01/25 14:54:52 m_ilya Exp $
use strict;
# constructor
sub new {
my $class = shift;
my $self = bless {}, $class;
return $self;
}
# serves requests
sub execute {
my $self = shift;
my $controller = shift;
return(action => $self,
controller => $controller);
}
1;
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:55
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/template In directory sc8-pr-cvs1:/tmp/cvs-serv26219/lib/HTTP/WebTest/template Removed Files: wtscript request page.inc list Log Message: Move everything in HTTP::WebTest::Recorder namespace --- wtscript DELETED --- --- request DELETED --- --- page.inc DELETED --- --- list DELETED --- |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:55
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv26219/lib/HTTP/WebTest/Recorder/template
Added Files:
wtscript request page.inc list
Log Message:
Move everything in HTTP::WebTest::Recorder namespace
--- NEW FILE: wtscript ---
[% WRAPPER page.inc
title => 'WTScript'
%]
[% USE HTML %]
<pre>
[% HTML.escape(wtscript) %]
</pre>
[% END %]
--- NEW FILE: request ---
[% WRAPPER page.inc
title => 'Show Request'
%]
[% USE HTML %]
[% USE request_url = URL(test.request.uri) %]
<table>
<tr><th colspan="2">Request</th></tr>
<tr>
<th>Request</th>
<td>
<pre>[% HTML.escape(test.request.method) %] <a href="[% request_url %]">[% HTML.escape(test.request.uri) %]</a></pre>
</td>
</tr>
<tr>
<th>Headers</th>
<td><pre>[% HTML.escape(test.request.headers_as_string) %]</pre></td>
</tr>
[% IF test.request.content %]
<tr>
<th>Content</th>
<td><pre>[% HTML.escape(test.request.content) %]</pre></td>
</tr>
[% END %]
<tr>
</tr>
<tr><th colspan="2">Response</th></tr>
<tr>
<th>Status Line</th>
<td><pre>[% HTML.escape(test.response.status_line) %]</pre></td>
</tr>
<tr>
<th>Headers</th>
<td><pre>[% HTML.escape(test.response.headers_as_string) %]</pre></td>
</tr>
</table>
[% END %]
--- NEW FILE: page.inc ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
[% USE HTML %]
[% USE enable_url = URL('enable') %]
<html>
<head>
<title>[% HTML.escape(title) %]</title>
</head>
<body>
[% IF controller.recorder.is_recording %]
<p><a href="[% enable_url(enable => 0) %]">Turn off</a> recording</p>
[% ELSE %]
<p><a href="[% enable_url(enable => 1) %]">Turn on</a> recording</p>
[% END %]
<h1>[% HTML.escape(title) %]</h1>
[% content %]
</body>
</html>
--- NEW FILE: list ---
[% WRAPPER page.inc
title => 'List of Request/Response Pairs'
%]
[% USE HTML %]
[% USE request_url = URL('request') %]
[% IF tests.size > 0 %]
<table>
[% FOREACH test = tests %]
<tr>
<td>
<a href="[% request_url(num => loop.index) %]">
[% HTML.escape(test.request.uri) %]
</a>
</td>
<td>[% HTML.escape(test.response.status_line) %]</td>
</tr>
[% END %]
</table>
<p>Generate <a href="wtscript">wtscript</a>.</p>
[% ELSE %]
<p>No request/response have been recorded.</p>
[% END %]
[% END %]
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv26219/t
Modified Files:
07-action-enable.t 06-action-wtscript.t 05-action-request.t
04-action-list.t 03-action.t 02-controller.t 01-recorder.t
Log Message:
Move everything in HTTP::WebTest::Recorder namespace
Index: 07-action-enable.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/07-action-enable.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** 07-action-enable.t 24 Jan 2003 09:21:44 -0000 1.1
--- 07-action-enable.t 25 Jan 2003 14:54:51 -0000 1.2
***************
*** 10,22 ****
use Test::Exception;
! require_ok('HTTP::WebTest::Action::Enable');
! require_ok('HTTP::WebTest::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Action::Enable;
! isa_ok($ACTION, 'HTTP::WebTest::Action::Enable');
! my $CONTROLLER = new HTTP::WebTest::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
--- 10,22 ----
use Test::Exception;
! require_ok('HTTP::WebTest::Recorder::Action::Enable');
! require_ok('HTTP::WebTest::Recorder::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Recorder::Action::Enable;
! isa_ok($ACTION, 'HTTP::WebTest::Recorder::Action::Enable');
! my $CONTROLLER = new HTTP::WebTest::Recorder::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
***************
*** 27,31 ****
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
dies_ok { $ACTION->execute($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Exception::Redirect',
'Verify exception class');
is($@->url, 'list', 'Test url property of exception');
--- 27,31 ----
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
dies_ok { $ACTION->execute($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
'Verify exception class');
is($@->url, 'list', 'Test url property of exception');
***************
*** 37,41 ****
$CONTROLLER->cgi(CGI->new({ enable => 0 }));
dies_ok { $ACTION->execute($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Exception::Redirect',
'Verify exception class');
is($@->url, 'list', 'Test url property of exception');
--- 37,41 ----
$CONTROLLER->cgi(CGI->new({ enable => 0 }));
dies_ok { $ACTION->execute($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
'Verify exception class');
is($@->url, 'list', 'Test url property of exception');
***************
*** 47,51 ****
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
dies_ok { $ACTION->execute($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Exception::Redirect',
'Verify exception class');
is($@->url, 'list', 'Test url property of exception');
--- 47,51 ----
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
dies_ok { $ACTION->execute($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
'Verify exception class');
is($@->url, 'list', 'Test url property of exception');
Index: 06-action-wtscript.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/06-action-wtscript.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 06-action-wtscript.t 18 Jan 2003 18:52:18 -0000 1.2
--- 06-action-wtscript.t 25 Jan 2003 14:54:51 -0000 1.3
***************
*** 9,21 ****
use Test::More tests => 7;
! require_ok('HTTP::WebTest::Action::WTScript');
! require_ok('HTTP::WebTest::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Action::WTScript;
! isa_ok($ACTION, 'HTTP::WebTest::Action::WTScript');
! my $CONTROLLER = new HTTP::WebTest::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
--- 9,21 ----
use Test::More tests => 7;
! require_ok('HTTP::WebTest::Recorder::Action::WTScript');
! require_ok('HTTP::WebTest::Recorder::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Recorder::Action::WTScript;
! isa_ok($ACTION, 'HTTP::WebTest::Recorder::Action::WTScript');
! my $CONTROLLER = new HTTP::WebTest::Recorder::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
Index: 05-action-request.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/05-action-request.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** 05-action-request.t 18 Jan 2003 18:52:18 -0000 1.3
--- 05-action-request.t 25 Jan 2003 14:54:51 -0000 1.4
***************
*** 9,21 ****
use Test::More tests => 9;
! require_ok('HTTP::WebTest::Action::Request');
! require_ok('HTTP::WebTest::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Action::Request;
! isa_ok($ACTION, 'HTTP::WebTest::Action::Request');
! my $CONTROLLER = new HTTP::WebTest::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
--- 9,21 ----
use Test::More tests => 9;
! require_ok('HTTP::WebTest::Recorder::Action::Request');
! require_ok('HTTP::WebTest::Recorder::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Recorder::Action::Request;
! isa_ok($ACTION, 'HTTP::WebTest::Recorder::Action::Request');
! my $CONTROLLER = new HTTP::WebTest::Recorder::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
Index: 04-action-list.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/04-action-list.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 04-action-list.t 18 Jan 2003 18:52:18 -0000 1.2
--- 04-action-list.t 25 Jan 2003 14:54:51 -0000 1.3
***************
*** 9,21 ****
use Test::More tests => 7;
! require_ok('HTTP::WebTest::Action::List');
! require_ok('HTTP::WebTest::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Action::List;
! isa_ok($ACTION, 'HTTP::WebTest::Action::List');
! my $CONTROLLER = new HTTP::WebTest::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
--- 9,21 ----
use Test::More tests => 7;
! require_ok('HTTP::WebTest::Recorder::Action::List');
! require_ok('HTTP::WebTest::Recorder::Controller');
require_ok('HTTP::WebTest::Recorder');
# test constructors
! my $ACTION = new HTTP::WebTest::Recorder::Action::List;
! isa_ok($ACTION, 'HTTP::WebTest::Recorder::Action::List');
! my $CONTROLLER = new HTTP::WebTest::Recorder::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
my $RECORDER = new HTTP::WebTest::Recorder;
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
Index: 03-action.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-action.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 03-action.t 18 Jan 2003 18:52:19 -0000 1.2
--- 03-action.t 25 Jan 2003 14:54:51 -0000 1.3
***************
*** 11,22 ****
use lib 't';
! require_ok('HTTP::WebTest::Action');
! require_ok('HTTP::WebTest::Controller');
# test constructors
! my $ACTION = new HTTP::WebTest::Action;
! isa_ok($ACTION, 'HTTP::WebTest::Action');
! my $CONTROLLER = new HTTP::WebTest::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
# test execute()
--- 11,22 ----
use lib 't';
! require_ok('HTTP::WebTest::Recorder::Action');
! require_ok('HTTP::WebTest::Recorder::Controller');
# test constructors
! my $ACTION = new HTTP::WebTest::Recorder::Action;
! isa_ok($ACTION, 'HTTP::WebTest::Recorder::Action');
! my $CONTROLLER = new HTTP::WebTest::Recorder::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
# test execute()
Index: 02-controller.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/02-controller.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 02-controller.t 24 Jan 2003 09:38:07 -0000 1.2
--- 02-controller.t 25 Jan 2003 14:54:51 -0000 1.3
***************
*** 12,20 ****
use lib 't';
! require_ok('HTTP::WebTest::Controller');
# test constructor
! my $CONTROLLER = new HTTP::WebTest::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
# try to get template toolkit object and process one of recorder's
--- 12,20 ----
use lib 't';
! require_ok('HTTP::WebTest::Recorder::Controller');
# test constructor
! my $CONTROLLER = new HTTP::WebTest::Recorder::Controller;
! isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
# try to get template toolkit object and process one of recorder's
***************
*** 70,74 ****
like($response->content, qr/CGI = CGI/,
'CGI object should be passed to template');
! like($response->content, qr/CONTROLLER = HTTP::WebTest::Controller/,
'Controller object should be passed to template');
like($response->content, qr/REQUEST = HTTP::Request/,
--- 70,75 ----
like($response->content, qr/CGI = CGI/,
'CGI object should be passed to template');
! like($response->content,
! qr/CONTROLLER = HTTP::WebTest::Recorder::Controller/,
'Controller object should be passed to template');
like($response->content, qr/REQUEST = HTTP::Request/,
***************
*** 104,108 ****
{
dies_ok { $CONTROLLER->redirect('xxx') } 'Expecting redirect exception';
! isa_ok($@, 'HTTP::WebTest::Exception::Redirect',
'Verify exception class');
is($@->url, 'xxx', 'Test url property of exception');
--- 105,109 ----
{
dies_ok { $CONTROLLER->redirect('xxx') } 'Expecting redirect exception';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
'Verify exception class');
is($@->url, 'xxx', 'Test url property of exception');
***************
*** 111,121 ****
# try to access page that generates a redirect
{
! local %HTTP::WebTest::Controller::DISPATCH =
( redirect => 'TestRedirect' );
# just to disable used only once warning
! () = %HTTP::WebTest::Controller::DISPATCH;
{
package TestRedirect;
! use base qw(HTTP::WebTest::Action);
sub execute {
--- 112,122 ----
# try to access page that generates a redirect
{
! local %HTTP::WebTest::Recorder::Controller::DISPATCH =
( redirect => 'TestRedirect' );
# just to disable used only once warning
! () = %HTTP::WebTest::Recorder::Controller::DISPATCH;
{
package TestRedirect;
! use base qw(HTTP::WebTest::Recorder::Action);
sub execute {
Index: 01-recorder.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/01-recorder.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** 01-recorder.t 18 Jan 2003 17:04:45 -0000 1.4
--- 01-recorder.t 25 Jan 2003 14:54:51 -0000 1.5
***************
*** 109,113 ****
# test controller of proxy's web interface
{
! isa_ok($RECORDER->controller, 'HTTP::WebTest::Controller');
my $request = GET 'http://localhost/webtest/testme';
my $response = $RECORDER->handle($request);
--- 109,113 ----
# test controller of proxy's web interface
{
! isa_ok($RECORDER->controller, 'HTTP::WebTest::Recorder::Controller');
my $request = GET 'http://localhost/webtest/testme';
my $response = $RECORDER->handle($request);
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/template In directory sc8-pr-cvs1:/tmp/cvs-serv26219/t/HTTP/WebTest/template Removed Files: testme testdump testcrash Log Message: Move everything in HTTP::WebTest::Recorder namespace --- testme DELETED --- --- testdump DELETED --- --- testcrash DELETED --- |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:54:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv26219/t/HTTP/WebTest/Recorder/template
Added Files:
testme testdump testcrash
Log Message:
Move everything in HTTP::WebTest::Recorder namespace
--- NEW FILE: testme ---
This is a test file
VAR = [% var %]
--- NEW FILE: testdump ---
ACTION = [% action %]
CONTROLLER = [% controller %]
CGI = [% controller.cgi %]
REQUEST = [% controller.request %]
--- NEW FILE: testcrash ---
[% CRASH ME %]
|
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:52:02
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template In directory sc8-pr-cvs1:/tmp/cvs-serv24819/lib/HTTP/WebTest/Recorder/template Log Message: Directory /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template added to the repository |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:52:02
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Action In directory sc8-pr-cvs1:/tmp/cvs-serv24819/lib/HTTP/WebTest/Recorder/Action Log Message: Directory /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Action added to the repository |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:52:02
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder/template In directory sc8-pr-cvs1:/tmp/cvs-serv24819/t/HTTP/WebTest/Recorder/template Log Message: Directory /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder/template added to the repository |
|
From: Ilya M. <m_...@us...> - 2003-01-25 14:49:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv23794/t/HTTP/WebTest/Recorder Log Message: Directory /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder added to the repository |