http-webtest-commits Mailing List for HTTP-WebTest (Page 4)
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-04-26 15:12:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory sc8-pr-cvs1:/tmp/cvs-serv7752/t
Modified Files:
12-request.t 10-click.t 06-parser.t
Log Message:
Cosmetic fixes
Index: 12-request.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/12-request.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** 12-request.t 22 Dec 2002 21:25:49 -0000 1.4
--- 12-request.t 26 Apr 2003 15:12:14 -0000 1.5
***************
*** 7,11 ****
use strict;
! use Test::More tests => 25;
use HTTP::WebTest::Request;
--- 7,11 ----
use strict;
! use Test::More tests => 24;
use HTTP::WebTest::Request;
***************
*** 15,21 ****
{
$REQUEST = HTTP::WebTest::Request->new;
! ok(defined $REQUEST);
! ok($REQUEST->isa('HTTP::WebTest::Request'));
! ok($REQUEST->isa('HTTP::Request'));
}
--- 15,20 ----
{
$REQUEST = HTTP::WebTest::Request->new;
! isa_ok($REQUEST, 'HTTP::WebTest::Request');
! isa_ok($REQUEST, 'HTTP::Request');
}
Index: 10-click.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/10-click.t,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** 10-click.t 22 Dec 2002 21:25:49 -0000 1.12
--- 10-click.t 26 Apr 2003 15:12:14 -0000 1.13
***************
*** 286,291 ****
output_ref => \$text);
} else {
! # no exception - test have failed
! ok(0);
}
}
--- 286,290 ----
output_ref => \$text);
} else {
! fail('Was expecting an exception - did not get any');
}
}
Index: 06-parser.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/06-parser.t,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** 06-parser.t 2 Mar 2003 11:57:03 -0000 1.22
--- 06-parser.t 26 Apr 2003 15:12:15 -0000 1.23
***************
*** 159,163 ****
output_ref => \$text);
} else {
! ok(0);
}
}
--- 159,163 ----
output_ref => \$text);
} else {
! fail('Was expecting an exception - did not get any');
}
}
|
|
From: Ilya M. <m_...@us...> - 2003-04-26 15:11:15
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory sc8-pr-cvs1:/tmp/cvs-serv7443/t
Added Files:
05a-email-report.t
Log Message:
Added tests for email sending func in report plugin
--- NEW FILE: 05a-email-report.t ---
#!/usr/bin/perl -w
# $Id: 05a-email-report.t,v 1.1 2003/04/26 15:11:06 m_ilya Exp $
# Unit tests for HTTP::WebTest::ReportPlugin (email sending functionality)
use strict;
use Test::More tests => 41;
use Test::MockObject;
my $WEBTEST;
my $SMTP;
my %GLOBAL_PARAMS;
my $REPORT_PLUGIN;
{
$WEBTEST = Test::MockObject->new;
$WEBTEST->mock(global_test_param =>
sub {
my($self, $param, $default) = @_;
return $GLOBAL_PARAMS{$param}
if exists $GLOBAL_PARAMS{$param};
return $default;
});
$SMTP = Test::MockObject->new;
Test::MockObject->fake_module('Net::SMTP',
new => sub { $SMTP }
);
require_ok('HTTP::WebTest::ReportPlugin');
$REPORT_PLUGIN = HTTP::WebTest::ReportPlugin->new($WEBTEST);
isa_ok($REPORT_PLUGIN, 'HTTP::WebTest::ReportPlugin');
}
{
ok(!$REPORT_PLUGIN->_email_report_is_expected(),
"'mail' param is not set - do not send email report");
$GLOBAL_PARAMS{mail} = 'all';
$WEBTEST->set_series(have_succeed => 0, 1);
ok($REPORT_PLUGIN->_email_report_is_expected(),
"'mail' param is 'all' - always send email report");
ok($REPORT_PLUGIN->_email_report_is_expected(),
"'mail' param is 'all' - always send email report");
$GLOBAL_PARAMS{mail} = 'errors';
$WEBTEST->set_series(have_succeed => 0, 1);
ok(!$REPORT_PLUGIN->_email_report_is_expected(),
"'mail' param is 'errors' - only send email report if failed tests");
ok($REPORT_PLUGIN->_email_report_is_expected(),
"'mail' param is 'errors' - only send email report if failed tests");
}
{
$SMTP->set_true('mail');
$SMTP->set_true('to');
$SMTP->set_true('data');
$SMTP->set_true('datasend');
$SMTP->set_true('dataend');
$SMTP->set_true('quit');
$WEBTEST->set_always(num_fail => 0);
$WEBTEST->set_always(num_succeed => 0);
$WEBTEST->set_always(have_succeed => 1);
$GLOBAL_PARAMS{mail_addresses} = ['x@y.z'];
$SMTP->clear;
$REPORT_PLUGIN->test_output(\'TEST OUTPUT');
$REPORT_PLUGIN->_send_email_report;
my $from = getlogin() || getpwuid($<) || 'nobody';
$SMTP->called_pos_ok(1, 'mail', 'Test for MAIL FROM command');
$SMTP->called_args_pos_is(1, 2, $from,
'Test for content of MAIL FROM command');
$SMTP->called_pos_ok(2, 'to', 'Test for RCPT TO command');
$SMTP->called_args_pos_is(2, 2, 'x@y.z',
'Test for content of RCPT TO command');
$SMTP->called_pos_ok(3, 'data', 'Test for DATA command');
$SMTP->called_pos_ok(4, 'datasend', 'Test for From: header');
$SMTP->called_args_pos_is(4, 2, "From: $from\n",
'Test for default From: header');
$SMTP->called_pos_ok(5, 'datasend', 'Test for To: header');
$SMTP->called_args_pos_is(5, 2, "To: x\@y.z\n");
$SMTP->called_pos_ok(6, 'datasend', 'Test for Subject: header');
$SMTP->called_args_pos_is(6, 2, "Subject: Web tests succeeded\n",
'Test for default success subject');
$SMTP->called_pos_ok(7, 'datasend', 'Test for headers/body separator');
$SMTP->called_args_pos_is(7, 2, "\n");
$SMTP->called_pos_ok(8, 'datasend', 'Test for test report itself');
$SMTP->called_args_pos_is(8, 2, 'TEST OUTPUT');
$SMTP->called_pos_ok(9, 'dataend', 'End email');
$SMTP->called_pos_ok(10, 'quit', 'Disconnect from SMTP server');
$WEBTEST->set_always(have_succeed => 0);
$SMTP->clear;
$REPORT_PLUGIN->_send_email_report;
$SMTP->called_pos_ok(6, 'datasend', 'Test for Subject: header');
$SMTP->called_args_pos_is(6, 2,
"Subject: WEB TESTS FAILED! FOUND 0 ERROR(S)\n",
'Test for default failure subject');
$WEBTEST->set_always(num_fail => 2);
$WEBTEST->set_always(num_succeed => 3);
$WEBTEST->set_always(have_succeed => 1);
$SMTP->clear;
$GLOBAL_PARAMS{mail_success_subject} = 'OK - %% %f + %s = %t';
$REPORT_PLUGIN->_send_email_report;
$SMTP->called_pos_ok(6, 'datasend', 'Test for Subject: header');
$SMTP->called_args_pos_is(6, 2,
"Subject: OK - % 2 + 3 = 5\n",
'Test for customized success subject');
$WEBTEST->set_always(num_fail => 5);
$WEBTEST->set_always(num_succeed => 6);
$WEBTEST->set_always(have_succeed => 0);
$SMTP->clear;
$GLOBAL_PARAMS{mail_failure_subject} = 'NOT OK - %% %f + %s = %t';
$REPORT_PLUGIN->_send_email_report;
$SMTP->called_pos_ok(6, 'datasend', 'Test for Subject: header');
$SMTP->called_args_pos_is(6, 2,
"Subject: NOT OK - % 5 + 6 = 11\n",
'Test for customized failure subject');
$SMTP->clear;
$GLOBAL_PARAMS{mail_from} = '12...@ex...';
$REPORT_PLUGIN->_send_email_report;
$SMTP->called_pos_ok(4, 'datasend', 'Test for From: header');
$SMTP->called_args_pos_is(4, 2, "From: 123456\@example.com\n",
'Test for non-default From: header');
$SMTP->clear;
$GLOBAL_PARAMS{mail_from} = '12...@ex...';
$REPORT_PLUGIN->_send_email_report;
$SMTP->called_pos_ok(1, 'mail', 'Test for MAIL FROM command');
$SMTP->called_args_pos_is(1, 2, '12...@ex...',
'Test for content of MAIL FROM command');
$SMTP->called_pos_ok(4, 'datasend', 'Test for From: header');
$SMTP->called_args_pos_is(4, 2, "From: 123456\@example.com\n",
'Test for non-default From: header');
$SMTP->clear;
$GLOBAL_PARAMS{mail_addresses} = ['1@a.b', '2@c.d'];
$REPORT_PLUGIN->_send_email_report;
$SMTP->called_pos_ok(2, 'to', 'Test for RCPT TO command');
$SMTP->called_args_pos_is(2, 2, '1@a.b',
'Test for content of RCPT TO command');
$SMTP->called_args_pos_is(2, 3, '2@c.d',
'Test for content of RCPT TO command');
$SMTP->called_pos_ok(5, 'datasend', 'Test for To: header');
$SMTP->called_args_pos_is(5, 2, "To: 1\@a.b, 2\@c.d\n");
}
|
|
From: Ilya M. <m_...@us...> - 2003-04-26 10:27:49
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv13119
Modified Files:
POE.pm
Log Message:
Identify user agent as HTTP-WebTest-Recorder/VERSION
Index: POE.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/POE.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** POE.pm 4 Apr 2003 21:52:20 -0000 1.2
--- POE.pm 26 Apr 2003 10:27:41 -0000 1.3
***************
*** 7,12 ****
use POE qw(Component::Client::HTTP);
! POE::Component::Client::HTTP->spawn(Alias => 'wt_recorder_ua',
! Streaming => 1024);
sub new {
--- 7,18 ----
use POE qw(Component::Client::HTTP);
! use HTTP::WebTest::Recorder;
!
! my $agent = 'HTTP-WebTest-Recorder/' . HTTP::WebTest::Recorder->VERSION;
!
! POE::Component::Client::HTTP->spawn(Agent => $agent,
! Alias => 'wt_recorder_ua',
! Streaming => 1024,
! );
sub new {
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 23:02:01
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv28838 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/MANIFEST,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MANIFEST 22 Apr 2003 21:42:36 -0000 1.6 --- MANIFEST 22 Apr 2003 23:01:56 -0000 1.7 *************** *** 7,10 **** --- 7,11 ---- lib/HTTP/WebTest/Recorder/Controller.pm lib/HTTP/WebTest/Recorder/POE.pm + lib/HTTP/WebTest/Recorder/template/css lib/HTTP/WebTest/Recorder/template/list lib/HTTP/WebTest/Recorder/template/page.inc |
|
From: Ilya M. <m_...@us...> - 2003-04-22 23:01:37
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv28703/t
Modified Files:
03-actions.t
Log Message:
Added tests for css_action() and render_template_action()
Index: 03-actions.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-actions.t,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** 03-actions.t 22 Apr 2003 22:18:08 -0000 1.9
--- 03-actions.t 22 Apr 2003 23:01:34 -0000 1.10
***************
*** 6,10 ****
use HTTP::Status;
! use Test::More tests => 42;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 55;
# get test template files directory included in search path
***************
*** 227,228 ****
--- 227,294 ----
}
+
+ # test css_action()
+ {
+ css_action($CONTROLLER);
+ is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/css',
+ 'Test if content type is set correctly');
+ }
+
+ # test render_template_action() with view which does exist
+ {
+ $CONTROLLER->heap({});
+ $CONTROLLER->heap->{view} = 'testme';
+ $CONTROLLER->heap->{var} = 'xxx';
+ $CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
+ render_template_action($CONTROLLER);
+ is($CONTROLLER->heap->{response}->code, RC_OK,
+ 'Test if response code is ok');
+ is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/html',
+ 'Test if content type is set correctly');
+ like($CONTROLLER->heap->{response}->content, qr/VAR = xxx/,
+ 'Test if content has rendered template');
+
+ $CONTROLLER->heap({});
+ $CONTROLLER->heap->{view} = 'testme';
+ $CONTROLLER->heap->{var} = 'xxx';
+ $CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
+ $CONTROLLER->heap->{response}->header('Content-Type' => 'text/css');
+ render_template_action($CONTROLLER);
+ is($CONTROLLER->heap->{response}->code, RC_OK,
+ 'Test if response code is ok');
+ is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/css',
+ 'Test if content render_template_action() does not ' .
+ 'override already set content type');
+ like($CONTROLLER->heap->{response}->content, qr/VAR = xxx/,
+ 'Test if content has rendered template');
+ }
+
+ # test render_template_action() with view which doesn't exist
+ {
+ $CONTROLLER->heap({});
+ $CONTROLLER->heap->{view} = 'notfound';
+ $CONTROLLER->heap->{var} = 'xxx';
+ $CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
+ render_template_action($CONTROLLER);
+ is($CONTROLLER->heap->{response}->code, RC_NOT_FOUND,
+ 'Test if response code is not found');
+ is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/plain',
+ 'Test if content type is set correctly');
+ is($CONTROLLER->heap->{response}->content, 'Not Found',
+ 'Test if content contains error message');
+ }
+
+ # test render_template_action() with view which crashes
+ {
+ $CONTROLLER->heap({});
+ $CONTROLLER->heap->{view} = 'testcrash';
+ $CONTROLLER->heap->{var} = 'xxx';
+ $CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
+ render_template_action($CONTROLLER);
+ is($CONTROLLER->heap->{response}->code, RC_INTERNAL_SERVER_ERROR,
+ 'Test if response code is internal error');
+ is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/plain',
+ 'Test if content type is set correctly');
+ like($CONTROLLER->heap->{response}->content, qr/file error - parse error/,
+ 'Test if content contains error message');
+ }
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:59:47
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv27815/lib/HTTP/WebTest/Recorder/template
Modified Files:
page.inc
Log Message:
Use css stylesheet
Index: page.inc
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template/page.inc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** page.inc 2 Feb 2003 17:25:00 -0000 1.3
--- page.inc 22 Apr 2003 22:59:43 -0000 1.4
***************
*** 4,7 ****
--- 4,8 ----
<head>
<title>[% title | html %]</title>
+ <link rel="stylesheet" type="text/css" href="css" />
</head>
<body>
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:58:46
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv27338
Modified Files:
Config.pm
Log Message:
Added css_action()
Index: Config.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Config.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Config.pm 22 Apr 2003 21:40:55 -0000 1.2
--- Config.pm 22 Apr 2003 22:58:42 -0000 1.3
***************
*** 7,18 ****
use HTTP::WebTest::Recorder::Actions qw(:all);
! %DISPATCH = (render_template => \&render_template_action,
list => \&list_action,
request => \&request_action,
response_content => \&response_content_action,
! wtscript => \&wtscript_action,
! enable => \&enable_action,
! delete => \&delete_action,
! filter => \&filter_action);
1;
--- 7,19 ----
use HTTP::WebTest::Recorder::Actions qw(:all);
! %DISPATCH = (css => \&css_action,
! delete => \&delete_action,
! enable => \&enable_action,
! filter => \&filter_action,
list => \&list_action,
+ render_template => \&render_template_action,
request => \&request_action,
response_content => \&response_content_action,
! wtscript => \&wtscript_action);
1;
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:57:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv26724a/lib/HTTP/WebTest/Recorder
Modified Files:
Actions.pm
Log Message:
Implement css_action()
Index: Actions.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Actions.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Actions.pm 22 Apr 2003 22:17:38 -0000 1.9
--- Actions.pm 22 Apr 2003 22:57:10 -0000 1.10
***************
*** 22,25 ****
--- 22,33 ----
%EXPORT_TAGS = (all => [@EXPORT_OK]);
+ sub css_action {
+ my $controller = shift;
+
+ $controller->heap->{response}->header(Content_Type => 'text/css');
+
+ return 'render_template';
+ }
+
sub render_template_action {
my $controller = shift;
***************
*** 30,34 ****
if($template->process($view, $controller->heap, \$content)) {
! $controller->heap->{response}->header(Content_Type => 'text/html');
$controller->heap->{response}->content($content);
} elsif($template->error =~ /file error - .*: not found/) {
--- 38,43 ----
if($template->process($view, $controller->heap, \$content)) {
! $controller->heap->{response}->header(Content_Type => 'text/html')
! unless $controller->heap->{response}->header('Content-Type');
$controller->heap->{response}->content($content);
} elsif($template->error =~ /file error - .*: not found/) {
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:57:00
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv26586/lib/HTTP/WebTest/Recorder/template
Added Files:
css
Log Message:
Added
--- NEW FILE: css ---
BODY {
background-color: rgb(221, 221, 221);
color: rgb(0, 0, 0);
margin: 25px 25px 25px 25px;
text-align: justify;
}
H1, H2, H3 {
color: rgb(102, 102, 204);
}
H1 {
font-size: 150%;
text-align: center;
}
H2 {
font-size: 125%;
}
A {
text-decoration: none;
}
A:link {
color: rgb(160, 0, 0);
}
A:visited {
color: rgb(160, 0, 0);
}
A:hover {
color: rgb(102, 102, 204);
}
INPUT {
background-color: rgb(221, 221, 221);
}
PRE {
border-style: dashed;
border-width: medium;
border-color: rgb(0, 0, 0);
padding: 15px 15px 15px 15px;
font-size: 75%;
}
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:18:14
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv11697/t
Modified Files:
03-actions.t
Log Message:
Don't test private API of Actions.pm
Index: 03-actions.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-actions.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** 03-actions.t 22 Apr 2003 22:07:35 -0000 1.8
--- 03-actions.t 22 Apr 2003 22:18:08 -0000 1.9
***************
*** 6,10 ****
use HTTP::Status;
! use Test::More tests => 48;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 42;
# get test template files directory included in search path
***************
*** 21,41 ****
isa_ok($RECORDER, 'HTTP::WebTest::Recorder');
$CONTROLLER->recorder($RECORDER);
-
- # test HTTP::WebTest::Recorder::Actions::create_template()
- {
- my $template = HTTP::WebTest::Recorder::Actions::create_template();
- isa_ok($template, 'Template');
-
- my $output = '';
- ok($template->process('testme', { var => 1 }, \$output),
- 'Try to process test template: ' . ($template->error || '') );
- like($output, qr/This is a test file/, 'Check output');
- like($output, qr/VAR = 1/, 'Check output');
-
- $output = '';
- ok($template->process('testme', { var => 'xxx' }, \$output),
- 'Try to process test template: ' . ($template->error || '') );
- like($output, qr/VAR = xxx/, 'Check output');
- }
# test list_action()
--- 21,24 ----
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:17:45
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv11465/lib/HTTP/WebTest/Recorder
Modified Files:
Actions.pm
Log Message:
Minor style fixes
Index: Actions.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Actions.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Actions.pm 22 Apr 2003 22:07:35 -0000 1.8
--- Actions.pm 22 Apr 2003 22:17:38 -0000 1.9
***************
*** 12,18 ****
use vars qw(@EXPORT_OK %EXPORT_TAGS);
! @EXPORT_OK = qw(render_template_action enable_action list_action
! request_action response_content_action
! delete_action wtscript_action filter_action);
%EXPORT_TAGS = (all => [@EXPORT_OK]);
--- 12,23 ----
use vars qw(@EXPORT_OK %EXPORT_TAGS);
! @EXPORT_OK = qw(css_action
! delete_action
! enable_action list_action
! filter_action
! render_template_action
! request_action
! response_content_action
! wtscript_action);
%EXPORT_TAGS = (all => [@EXPORT_OK]);
***************
*** 21,25 ****
my $content = '';
! my $template = create_template();
my $view = $controller->heap->{view};
--- 26,30 ----
my $content = '';
! my $template = _create_template();
my $view = $controller->heap->{view};
***************
*** 40,46 ****
}
! # creates template toolkit object
! sub create_template {
! # search template files in standart Perl include directories
my @template_dir = qw(HTTP WebTest Recorder template);
my $include_path = (join ':',
--- 45,51 ----
}
! # creates template toolkit object which is configured to search
! # template files in standart Perl include directories
! sub _create_template {
my @template_dir = qw(HTTP WebTest Recorder template);
my $include_path = (join ':',
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:08:17
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv7609/t/HTTP/WebTest/Recorder/template
Modified Files:
testdump
Log Message:
Minor fixes
Index: testdump
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/HTTP/WebTest/Recorder/template/testdump,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** testdump 25 Jan 2003 14:54:51 -0000 1.1
--- testdump 22 Apr 2003 22:08:14 -0000 1.2
***************
*** 1,4 ****
ACTION = [% action %]
CONTROLLER = [% controller %]
! CGI = [% controller.cgi %]
! REQUEST = [% controller.request %]
--- 1,4 ----
ACTION = [% action %]
CONTROLLER = [% controller %]
! CGI = [% cgi %]
! REQUEST = [% request %]
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:07:39
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv7353/lib/HTTP/WebTest/Recorder
Modified Files:
Actions.pm
Log Message:
Move some contoller fields into its temporary heap
Index: Actions.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Actions.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Actions.pm 22 Apr 2003 21:43:48 -0000 1.7
--- Actions.pm 22 Apr 2003 22:07:35 -0000 1.8
***************
*** 22,27 ****
my $content = '';
my $template = create_template();
! if($template->process($controller->view, $controller->heap, \$content)) {
$controller->heap->{response}->header(Content_Type => 'text/html');
$controller->heap->{response}->content($content);
--- 22,28 ----
my $content = '';
my $template = create_template();
+ my $view = $controller->heap->{view};
! if($template->process($view, $controller->heap, \$content)) {
$controller->heap->{response}->header(Content_Type => 'text/html');
$controller->heap->{response}->content($content);
***************
*** 52,56 ****
my $controller = shift;
! my $enable = $controller->cgi->param('enable');
$controller->recorder->is_recording($enable);
--- 53,57 ----
my $controller = shift;
! my $enable = $controller->heap->{cgi}->param('enable');
$controller->recorder->is_recording($enable);
***************
*** 70,74 ****
my $controller = shift;
! my $num = $controller->cgi->param('num');
$controller->heap->{num} = $num;
--- 71,75 ----
my $controller = shift;
! my $num = $controller->heap->{cgi}->param('num');
$controller->heap->{num} = $num;
***************
*** 81,86 ****
my $controller = shift;
! my $num = $controller->cgi->param('num');
! my $view = $controller->cgi->param('view');
my $test = $controller->recorder->tests->[$num];
--- 82,87 ----
my $controller = shift;
! my $num = $controller->heap->{cgi}->param('num');
! my $view = $controller->heap->{cgi}->param('view');
my $test = $controller->recorder->tests->[$num];
***************
*** 112,116 ****
my $controller = shift;
! my $num = $controller->cgi->param('num');
splice @{$controller->recorder->tests}, $num, 1;
--- 113,117 ----
my $controller = shift;
! my $num = $controller->heap->{cgi}->param('num');
splice @{$controller->recorder->tests}, $num, 1;
***************
*** 122,128 ****
my $controller = shift;
! my $type = $controller->cgi->param('type');
! my $field = $controller->cgi->param('field');
! my $value = $controller->cgi->param('value');
if(not defined $value or $value eq '') {
--- 123,129 ----
my $controller = shift;
! my $type = $controller->heap->{cgi}->param('type');
! my $field = $controller->heap->{cgi}->param('field');
! my $value = $controller->heap->{cgi}->param('value');
if(not defined $value or $value eq '') {
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:07:39
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv7353/t
Modified Files:
03-actions.t
Log Message:
Move some contoller fields into its temporary heap
Index: 03-actions.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-actions.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** 03-actions.t 22 Apr 2003 21:44:26 -0000 1.7
--- 03-actions.t 22 Apr 2003 22:07:35 -0000 1.8
***************
*** 6,10 ****
use HTTP::Status;
! use Test::More tests => 46;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 48;
# get test template files directory included in search path
***************
*** 65,88 ****
# test request_action()
{
- $CONTROLLER->cgi(CGI->new({num => 0}));
$CONTROLLER->heap({});
request_action($CONTROLLER);
! is_deeply($CONTROLLER->heap,
! { test => $RECORDER->tests->[0],
! num => 0 },
! 'Test if test and test num are returned');
! $CONTROLLER->cgi(CGI->new({num => 1}));
! $CONTROLLER->heap({});
request_action($CONTROLLER);
! is_deeply($CONTROLLER->heap,
! { test => $RECORDER->tests->[1],
! num => 1 },
! 'Test if test and test num are returned');
! $CONTROLLER->cgi(CGI->new({num => 2}));
request_action($CONTROLLER);
! is($CONTROLLER->heap->{tests}, undef,
! 'Check if "test" variable is not defined');
}
--- 65,87 ----
# test request_action()
{
$CONTROLLER->heap({});
+ $CONTROLLER->heap->{cgi} = CGI->new({num => 0});
request_action($CONTROLLER);
! is($CONTROLLER->heap->{test}, $RECORDER->tests->[0],
! 'Test if test object is returned');
! is($CONTROLLER->heap->{num}, 0,
! 'Test if test number is returned');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 1});
request_action($CONTROLLER);
! is($CONTROLLER->heap->{test}, $RECORDER->tests->[1],
! 'Test if test object is returned');
! is($CONTROLLER->heap->{num}, 1,
! 'Test if test number is returned');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 2});
request_action($CONTROLLER);
! is($CONTROLLER->heap->{test}, undef,
! 'Test if test object is not defined');
}
***************
*** 145,149 ****
# test with enable_action() if we can turn on recording
{
! $CONTROLLER->cgi(CGI->new({ enable => 1 }));
$CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
enable_action($CONTROLLER);
--- 144,148 ----
# test with enable_action() if we can turn on recording
{
! $CONTROLLER->heap->{cgi} = CGI->new({ enable => 1 });
$CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
enable_action($CONTROLLER);
***************
*** 155,159 ****
# test with enable_action() if we can turn off recording
{
! $CONTROLLER->cgi(CGI->new({ enable => 0 }));
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 154,158 ----
# test with enable_action() if we can turn off recording
{
! $CONTROLLER->heap->{cgi} = CGI->new({ enable => 0 });
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 164,168 ****
# test with enable_action() if we can turn on recording once again
{
! $CONTROLLER->cgi(CGI->new({ enable => 1 }));
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 163,167 ----
# test with enable_action() if we can turn on recording once again
{
! $CONTROLLER->heap->{cgi} = CGI->new({ enable => 1 });
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 173,177 ****
# test response_content_action()
{
! $CONTROLLER->cgi(CGI->new({num => 0, view => 'raw'}));
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
--- 172,176 ----
# test response_content_action()
{
! $CONTROLLER->heap->{cgi} = CGI->new({num => 0, view => 'raw'});
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
***************
*** 181,185 ****
'Test content-type if header is set correctly');
! $CONTROLLER->cgi(CGI->new({num => 2, view => 'raw'}));
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
--- 180,184 ----
'Test content-type if header is set correctly');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 2, view => 'raw'});
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
***************
*** 189,193 ****
'Test content-type if header is set correctly');
! $CONTROLLER->cgi(CGI->new({num => 0, view => 'text'}));
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{content}, $RECORDER->tests->[0]->response->content,
--- 188,192 ----
'Test content-type if header is set correctly');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 0, view => 'text'});
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{content}, $RECORDER->tests->[0]->response->content,
***************
*** 197,201 ****
# test delete_action()
{
! $CONTROLLER->cgi(CGI->new({num => 2}));
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 196,200 ----
# test delete_action()
{
! $CONTROLLER->heap->{cgi} = CGI->new({num => 2});
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 203,207 ****
is(@{$RECORDER->tests}, 2, 'Check number of tests');
! $CONTROLLER->cgi(CGI->new({num => 0}));
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 202,206 ----
is(@{$RECORDER->tests}, 2, 'Check number of tests');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 0});
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 217,223 ****
$RECORDER->filter({});
! $CONTROLLER->cgi(CGI->new({type => 'header',
! field => 'Content-Type',
! value => 'text'}));
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 216,222 ----
$RECORDER->filter({});
! $CONTROLLER->heap->{cgi} = CGI->new({type => 'header',
! field => 'Content-Type',
! value => 'text'});
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 226,232 ****
'Test if Content-Type header filter is set');
! $CONTROLLER->cgi(CGI->new({type => 'header',
! field => 'Content-Type',
! value => ''}));
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 225,231 ----
'Test if Content-Type header filter is set');
! $CONTROLLER->heap->{cgi} = CGI->new({type => 'header',
! field => 'Content-Type',
! value => ''});
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 235,241 ****
'Test if Content-Type header filter is removed');
! $CONTROLLER->cgi(CGI->new({type => 'header',
! field => 'Location',
! value => '.'}));
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 234,240 ----
'Test if Content-Type header filter is removed');
! $CONTROLLER->heap->{cgi} = CGI->new({type => 'header',
! field => 'Location',
! value => '.'});
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:07:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv7128/lib/HTTP/WebTest/Recorder
Modified Files:
Controller.pm
Log Message:
More some contoller fields into its temporary heap
Index: Controller.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Controller.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Controller.pm 22 Apr 2003 21:43:48 -0000 1.9
--- Controller.pm 22 Apr 2003 22:07:00 -0000 1.10
***************
*** 21,30 ****
# recorder object
*recorder = make_access_method('RECORDER');
- # view (template filename)
- *view = make_access_method('VIEW');
- # cgi object
- *cgi = make_access_method('CGI');
- # request object
- *request = make_access_method('REQUEST');
# heap object
*heap = make_access_method('HEAP');
--- 21,24 ----
***************
*** 35,48 ****
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});
!
! # init heap
! $self->heap({});
! $self->heap->{controller} = $self;
! $self->heap->{response} = HTTP::Response->new(RC_OK);
# proceed request through handler chain
--- 29,34 ----
my %param = @_;
$self->recorder($param{recorder});
! $self->init_heap(%param);
# proceed request through handler chain
***************
*** 62,72 ****
}
! # configures correct HTTP headers for redirect
! sub redirect {
my $self = shift;
! my $url = shift;
! $self->heap->{response}->code(RC_FOUND);
! $self->heap->{response}->header(Location => $url);
}
--- 48,62 ----
}
! # init heap with request data
! sub init_heap {
my $self = shift;
! my %param = @_;
! $self->heap({});
! $self->heap->{controller} = $self;
! $self->heap->{cgi} = $self->create_cgi($param{request});
! $self->heap->{request} = $param{request};
! $self->heap->{view} = $param{action};
! $self->heap->{response} = HTTP::Response->new(RC_OK);
}
***************
*** 84,87 ****
--- 74,86 ----
return CGI->new($query);
+ }
+
+ # configures correct HTTP headers for redirect
+ sub redirect {
+ my $self = shift;
+ my $url = shift;
+
+ $self->heap->{response}->code(RC_FOUND);
+ $self->heap->{response}->header(Location => $url);
}
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:44:52
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv29779
Modified Files:
Makefile.PL
Log Message:
Update requirements
Index: Makefile.PL
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/Makefile.PL,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Makefile.PL 14 Mar 2003 12:09:54 -0000 1.6
--- Makefile.PL 22 Apr 2003 21:44:47 -0000 1.7
***************
*** 14,23 ****
WriteMakefile( NAME => 'HTTP::WebTest::Recorder',
VERSION_FROM => $VERSION_FROM,
! PREREQ_PM => { 'Exception::Class' => 1.11,
! 'HTTP::WebTest' => 2.01,
'POE' => 0.22,
'POE::Component::Client::HTTP' => 0.52,
! 'Template' => 2.00,
! 'Test::Exception' => 0.03 },
AUTHOR => $AUTHOR,
ABSTRACT => $ABSTRACT,
--- 14,21 ----
WriteMakefile( NAME => 'HTTP::WebTest::Recorder',
VERSION_FROM => $VERSION_FROM,
! PREREQ_PM => { 'HTTP::WebTest' => 2.01,
'POE' => 0.22,
'POE::Component::Client::HTTP' => 0.52,
! 'Template' => 2.00 },
AUTHOR => $AUTHOR,
ABSTRACT => $ABSTRACT,
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:44:29
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv29594/t
Modified Files:
03-actions.t 02-controller.t
Log Message:
Updated to pass tests for refactored API
Index: 03-actions.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-actions.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** 03-actions.t 5 Apr 2003 09:59:01 -0000 1.6
--- 03-actions.t 22 Apr 2003 21:44:26 -0000 1.7
***************
*** 6,11 ****
use HTTP::Status;
! use Test::More tests => 53;
! use Test::Exception;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 46;
# get test template files directory included in search path
***************
*** 23,37 ****
$CONTROLLER->recorder($RECORDER);
! # test default_action()
{
! is_deeply([default_action($CONTROLLER)],
! [controller => $CONTROLLER],
! 'Test template_data()');
}
# test list_action()
{
! my %data = list_action($CONTROLLER);
! is($data{tests}, $RECORDER->tests,
'Check if "tests" variable is defined');
}
--- 22,47 ----
$CONTROLLER->recorder($RECORDER);
! # test HTTP::WebTest::Recorder::Actions::create_template()
{
! my $template = HTTP::WebTest::Recorder::Actions::create_template();
! isa_ok($template, 'Template');
!
! my $output = '';
! ok($template->process('testme', { var => 1 }, \$output),
! 'Try to process test template: ' . ($template->error || '') );
! like($output, qr/This is a test file/, 'Check output');
! like($output, qr/VAR = 1/, 'Check output');
!
! $output = '';
! ok($template->process('testme', { var => 'xxx' }, \$output),
! 'Try to process test template: ' . ($template->error || '') );
! like($output, qr/VAR = xxx/, 'Check output');
}
# test list_action()
{
! $CONTROLLER->heap({});
! list_action($CONTROLLER);
! is($CONTROLLER->heap->{tests}, $RECORDER->tests,
'Check if "tests" variable is defined');
}
***************
*** 56,75 ****
{
$CONTROLLER->cgi(CGI->new({num => 0}));
! is_deeply({ request_action($CONTROLLER) },
! { controller => $CONTROLLER,
! test => $RECORDER->tests->[0],
num => 0 },
'Test if test and test num are returned');
$CONTROLLER->cgi(CGI->new({num => 1}));
! is_deeply({ request_action($CONTROLLER) },
! { controller => $CONTROLLER,
! test => $RECORDER->tests->[1],
num => 1 },
'Test if test and test num are returned');
$CONTROLLER->cgi(CGI->new({num => 2}));
! my %data = request_action($CONTROLLER);
! is($data{test}, undef,
'Check if "test" variable is not defined');
}
--- 66,87 ----
{
$CONTROLLER->cgi(CGI->new({num => 0}));
! $CONTROLLER->heap({});
! request_action($CONTROLLER);
! is_deeply($CONTROLLER->heap,
! { test => $RECORDER->tests->[0],
num => 0 },
'Test if test and test num are returned');
$CONTROLLER->cgi(CGI->new({num => 1}));
! $CONTROLLER->heap({});
! request_action($CONTROLLER);
! is_deeply($CONTROLLER->heap,
! { test => $RECORDER->tests->[1],
num => 1 },
'Test if test and test num are returned');
$CONTROLLER->cgi(CGI->new({num => 2}));
! request_action($CONTROLLER);
! is($CONTROLLER->heap->{tests}, undef,
'Check if "test" variable is not defined');
}
***************
*** 101,106 ****
# test wtscript_action()
{
! my %data = wtscript_action($CONTROLLER);
! is($data{wtscript}, <<'WTSCRIPT',
test_name = N/A
url = http://example.com/doc1.html
--- 113,118 ----
# test wtscript_action()
{
! wtscript_action($CONTROLLER);
! is($CONTROLLER->heap->{wtscript}, <<'WTSCRIPT',
test_name = N/A
url = http://example.com/doc1.html
***************
*** 134,141 ****
{
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
! dies_ok { enable_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
ok($CONTROLLER->recorder->is_recording, 'Recording');
}
--- 146,153 ----
{
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
! $CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
! enable_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
ok($CONTROLLER->recorder->is_recording, 'Recording');
}
***************
*** 144,151 ****
{
$CONTROLLER->cgi(CGI->new({ enable => 0 }));
! dies_ok { enable_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
ok(not($CONTROLLER->recorder->is_recording), 'Not recording');
}
--- 156,162 ----
{
$CONTROLLER->cgi(CGI->new({ enable => 0 }));
! enable_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
ok(not($CONTROLLER->recorder->is_recording), 'Not recording');
}
***************
*** 154,161 ****
{
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
! dies_ok { enable_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
ok($CONTROLLER->recorder->is_recording, 'Recording');
}
--- 165,171 ----
{
$CONTROLLER->cgi(CGI->new({ enable => 1 }));
! enable_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
ok($CONTROLLER->recorder->is_recording, 'Recording');
}
***************
*** 164,189 ****
{
$CONTROLLER->cgi(CGI->new({num => 0, view => 'raw'}));
! dies_ok { response_content_action($CONTROLLER) } 'Expect raw response';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::RawResponse',
! 'Verify exception class');
! is($@->content, $RECORDER->tests->[0]->response->content,
! 'Test content property of exception');
! is_deeply($@->headers,
! [ 'Content-Type' => 'text/xml' ],
! 'Test headers property of exception');
$CONTROLLER->cgi(CGI->new({num => 2, view => 'raw'}));
! dies_ok { response_content_action($CONTROLLER) } 'Expect raw response';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::RawResponse',
! 'Verify exception class');
! is($@->content, $RECORDER->tests->[2]->response->content,
! 'Test content property of exception');
! is_deeply($@->headers,
! [ 'Content-Type' => 'text/plain' ],
! 'Test headers property of exception');
$CONTROLLER->cgi(CGI->new({num => 0, view => 'text'}));
! my %data = response_content_action($CONTROLLER);
! is($data{content}, $RECORDER->tests->[0]->response->content,
"Test if action doesn't die and returns response content");
}
--- 174,195 ----
{
$CONTROLLER->cgi(CGI->new({num => 0, view => 'raw'}));
! response_content_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->content,
! $RECORDER->tests->[0]->response->content,
! 'Test content of response');
! is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/xml',
! 'Test content-type if header is set correctly');
$CONTROLLER->cgi(CGI->new({num => 2, view => 'raw'}));
! response_content_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->content,
! $RECORDER->tests->[2]->response->content,
! 'Test content of response');
! is($CONTROLLER->heap->{response}->header('Content-Type'), 'text/plain',
! 'Test content-type if header is set correctly');
$CONTROLLER->cgi(CGI->new({num => 0, view => 'text'}));
! response_content_action($CONTROLLER);
! is($CONTROLLER->heap->{content}, $RECORDER->tests->[0]->response->content,
"Test if action doesn't die and returns response content");
}
***************
*** 192,206 ****
{
$CONTROLLER->cgi(CGI->new({num => 2}));
! dies_ok { delete_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
is(@{$RECORDER->tests}, 2, 'Check number of tests');
$CONTROLLER->cgi(CGI->new({num => 0}));
! dies_ok { delete_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
is(@{$RECORDER->tests}, 1, 'Check number of tests');
--- 198,210 ----
{
$CONTROLLER->cgi(CGI->new({num => 2}));
! delete_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
is(@{$RECORDER->tests}, 2, 'Check number of tests');
$CONTROLLER->cgi(CGI->new({num => 0}));
! delete_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
is(@{$RECORDER->tests}, 1, 'Check number of tests');
***************
*** 216,223 ****
field => 'Content-Type',
value => 'text'}));
! dies_ok { filter_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
is($RECORDER->filter->{header}{'Content-Type'}, 'text',
'Test if Content-Type header filter is set');
--- 220,226 ----
field => 'Content-Type',
value => 'text'}));
! filter_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
is($RECORDER->filter->{header}{'Content-Type'}, 'text',
'Test if Content-Type header filter is set');
***************
*** 226,233 ****
field => 'Content-Type',
value => ''}));
! dies_ok { filter_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
ok(not(exists $RECORDER->filter->{header}{'Content-Type'}),
'Test if Content-Type header filter is removed');
--- 229,235 ----
field => 'Content-Type',
value => ''}));
! filter_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
ok(not(exists $RECORDER->filter->{header}{'Content-Type'}),
'Test if Content-Type header filter is removed');
***************
*** 236,244 ****
field => 'Location',
value => '.'}));
! dies_ok { filter_action($CONTROLLER) } 'Expect redirect';
! isa_ok($@, 'HTTP::WebTest::Recorder::Exception::Redirect',
! 'Verify exception class');
! is($@->url, 'list', 'Test url property of exception');
is($RECORDER->filter->{header}{Location}, '.',
'Test if Location header filter is set');
}
--- 238,246 ----
field => 'Location',
value => '.'}));
! filter_action($CONTROLLER);
! is($CONTROLLER->heap->{response}->code, RC_FOUND);
! is($CONTROLLER->heap->{response}->header('Location'), 'list');
is($RECORDER->filter->{header}{Location}, '.',
'Test if Location header filter is set');
}
+
Index: 02-controller.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/02-controller.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** 02-controller.t 2 Feb 2003 00:02:43 -0000 1.5
--- 02-controller.t 22 Apr 2003 21:44:26 -0000 1.6
***************
*** 6,11 ****
use HTTP::Status;
! use Test::More tests => 41;
! use Test::Exception;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 29;
# get test template files directory included in search path
***************
*** 18,39 ****
isa_ok($CONTROLLER, 'HTTP::WebTest::Recorder::Controller');
- # try to get template toolkit object and process one of recorder's
- # templates through it
- {
- my $template = $CONTROLLER->template;
- isa_ok($template, 'Template');
-
- my $output = '';
- ok($template->process('testme', { var => 1 }, \$output),
- 'Try to process test template: ' . ($template->error || '') );
- like($output, qr/This is a test file/, 'Check output');
- like($output, qr/VAR = 1/, 'Check output');
-
- $output = '';
- ok($template->process('testme', { var => 'xxx' }, \$output),
- 'Try to process test template: ' . ($template->error || '') );
- like($output, qr/VAR = xxx/, 'Check output');
- }
-
# try to get CGI object
{
--- 17,20 ----
***************
*** 104,111 ****
# test redirect()
{
! 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');
}
--- 85,99 ----
# test redirect()
{
! $CONTROLLER->redirect('xxx');
! is($CONTROLLER->heap->{response}->code, RC_FOUND,
! 'Expect redirect status code');
! is($CONTROLLER->heap->{response}->header('Location'), 'xxx',
! 'Verify location header');
!
! $CONTROLLER->redirect('yyy');
! is($CONTROLLER->heap->{response}->code, RC_FOUND,
! 'Expect redirect status code');
! is($CONTROLLER->heap->{response}->header('Location'), 'yyy',
! 'Verify location header');
}
***************
*** 117,121 ****
return $controller->redirect('xxx');
};
! local %HTTP::WebTest::Recorder::Controller::DISPATCH =
( redirect => $test_redirect );
--- 105,110 ----
return $controller->redirect('xxx');
};
! local %HTTP::WebTest::Recorder::Controller::DISPATCH;
! %HTTP::WebTest::Recorder::Controller::DISPATCH =
( redirect => $test_redirect );
***************
*** 126,163 ****
is($response->header('Location'), 'xxx',
'Check if we got correct Location header');
- }
-
- # test raw_response()
- {
- my $headers = [ 'Content-Type' => 'image/png' ];
- my $content = "Expect the worst, it's the least you can do.";
-
- dies_ok { $CONTROLLER->raw_response(headers => $headers,
- content => $content) }
- 'Expecting raw response exception';
- isa_ok($@, 'HTTP::WebTest::Recorder::Exception::RawResponse',
- 'Verify exception class');
- is($@->headers, $headers, 'Test headers property of exception');
- is($@->content, $content, 'Test content property of exception');
- }
-
- # try to access page that generates a raw response
- {
- my $test_raw_response = sub {
- my $controller = shift;
-
- return $controller->raw_response(headers =>
- [ 'Content-Type', 'text/xml' ],
- content => 'Bla Bla');
- };
- local %HTTP::WebTest::Recorder::Controller::DISPATCH =
- ( raw_response => $test_raw_response );
-
- my $request = GET 'http://localhost/webtest/raw_response';
- my $response = $CONTROLLER->execute(action => 'raw_response',
- request => $request);
- is($response->code, RC_OK, 'Expect ok status');
- is($response->content, 'Bla Bla', 'Verify content in response');
- is($response->header('Content-Type'), 'text/xml',
- 'Verify headers in response');
}
--- 115,117 ----
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:43:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv29286/lib/HTTP/WebTest/Recorder
Modified Files:
Controller.pm Actions.pm
Log Message:
Refactor Actions.pm and Controller.pm: I use chain of handlers now and
handlers have direct access to response object
Index: Controller.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Controller.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Controller.pm 22 Apr 2003 20:10:19 -0000 1.8
--- Controller.pm 22 Apr 2003 21:43:48 -0000 1.9
***************
*** 9,16 ****
use HTTP::Status;
use HTTP::WebTest::Utils qw(make_access_method);
- use Template;
use HTTP::WebTest::Recorder::Config qw(%DISPATCH);
- use HTTP::WebTest::Recorder::Exceptions;
# constructor
--- 9,14 ----
***************
*** 23,28 ****
# 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');
--- 21,24 ----
***************
*** 31,34 ****
--- 27,32 ----
# request object
*request = make_access_method('REQUEST');
+ # heap object
+ *heap = make_access_method('HEAP');
# serves requests for web interface of the proxy
***************
*** 43,110 ****
$self->view($param{action});
! my $action = $DISPATCH{$param{action}} || $DISPATCH{default};
! my $response;
! eval {
! $response = $self->process_template($action->($self));
! };
! if($@) {
! if($@->isa('HTTP::WebTest::Recorder::Exception::Redirect')) {
! $response = HTTP::Response->new(RC_FOUND);
! $response->header(Location => $@->url);
! } elsif($@->isa('HTTP::WebTest::Recorder::Exception::RawResponse')) {
! $response = HTTP::Response->new(RC_OK);
! $response->header(@{$@->headers});
! $response->content($@->content);
} 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);
! }
!
! # generates raw response exception
! sub raw_response {
! my $self = shift;
! my %param = @_;
!
! $param{message} = 'Raw Response';
!
! HTTP::WebTest::Recorder::Exception::RawResponse->throw(%param);
}
--- 41,72 ----
$self->view($param{action});
! # init heap
! $self->heap({});
! $self->heap->{controller} = $self;
! $self->heap->{response} = HTTP::Response->new(RC_OK);
! # proceed request through handler chain
! my $action = $param{action};
! $action = 'render_template' unless exists $DISPATCH{$action};
! while(defined $action) {
! my $handler = $DISPATCH{$action};
! if(defined $handler) {
! $action = $handler->($self);
} else {
! undef $action;
}
}
+
+ $self->heap->{response}->header(Pragma => 'No-Cache');
+ return $self->heap->{response};
}
! # configures correct HTTP headers for redirect
sub redirect {
my $self = shift;
my $url = shift;
! $self->heap->{response}->code(RC_FOUND);
! $self->heap->{response}->header(Location => $url);
}
***************
*** 122,137 ****
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);
}
--- 84,87 ----
Index: Actions.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Actions.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Actions.pm 5 Apr 2003 09:59:22 -0000 1.6
--- Actions.pm 22 Apr 2003 21:43:48 -0000 1.7
***************
*** 3,21 ****
use strict;
use base qw(Exporter);
use vars qw(@EXPORT_OK %EXPORT_TAGS);
! @EXPORT_OK = qw(default_action enable_action list_action
request_action response_content_action
delete_action wtscript_action filter_action);
%EXPORT_TAGS = (all => [@EXPORT_OK]);
! use HTTP::WebTest::Parser;
!
! sub default_action {
my $controller = shift;
! return(controller => $controller);
}
--- 3,50 ----
use strict;
+ use HTTP::Status;
+ use Template;
+
+ use HTTP::WebTest::Parser;
+
use base qw(Exporter);
use vars qw(@EXPORT_OK %EXPORT_TAGS);
! @EXPORT_OK = qw(render_template_action enable_action list_action
request_action response_content_action
delete_action wtscript_action filter_action);
%EXPORT_TAGS = (all => [@EXPORT_OK]);
! sub render_template_action {
my $controller = shift;
! my $content = '';
! my $template = create_template();
!
! if($template->process($controller->view, $controller->heap, \$content)) {
! $controller->heap->{response}->header(Content_Type => 'text/html');
! $controller->heap->{response}->content($content);
! } elsif($template->error =~ /file error - .*: not found/) {
! $controller->heap->{response}->code(RC_NOT_FOUND);
! $controller->heap->{response}->header(Content_Type => 'text/plain');
! $controller->heap->{response}->content('Not Found');
! } else {
! $controller->heap->{response}->code(RC_INTERNAL_SERVER_ERROR);
! $controller->heap->{response}->header(Content_Type => 'text/plain');
! $controller->heap->{response}->content($template->error);
! }
!
! return;
! }
!
! # creates template toolkit object
! sub create_template {
! # 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);
}
***************
*** 27,30 ****
--- 56,60 ----
$controller->redirect('list');
+ return;
}
***************
*** 32,37 ****
my $controller = shift;
! return(default_action($controller),
! tests => $controller->recorder->tests);
}
--- 62,68 ----
my $controller = shift;
! $controller->heap->{tests} = $controller->recorder->tests;
!
! return 'render_template';
}
***************
*** 40,47 ****
my $num = $controller->cgi->param('num');
- my $test = $controller->recorder->tests->[$num];
! return(default_action($controller),
! test => $test, num => $num);
}
--- 71,79 ----
my $num = $controller->cgi->param('num');
! $controller->heap->{num} = $num;
! $controller->heap->{test} = $controller->recorder->tests->[$num];
!
! return 'render_template';
}
***************
*** 49,63 ****
my $controller = shift;
! my $num = $controller->cgi->param('num');
my $view = $controller->cgi->param('view');
my $test = $controller->recorder->tests->[$num];
if($view eq 'raw') {
! $controller->raw_response(headers => [ 'Content-Type' =>
! $test->response->content_type ],
! content => $test->response->content);
} else {
! return(default_action($controller),
! content => $test->response->content);
}
}
--- 81,98 ----
my $controller = shift;
! my $num = $controller->cgi->param('num');
my $view = $controller->cgi->param('view');
my $test = $controller->recorder->tests->[$num];
if($view eq 'raw') {
! $controller->heap->{response}->header('Content-Type' =>
! $test->response->content_type);
! $controller->heap->{response}->content($test->response->content);
!
! return;
} else {
! $controller->heap->{content} = $test->response->content;
!
! return 'render_template';
}
}
***************
*** 69,74 ****
@{$controller->recorder->tests});
! return(default_action($controller),
! wtscript => $wtscript);
}
--- 104,110 ----
@{$controller->recorder->tests});
! $controller->heap->{wtscript} = $wtscript;
!
! return 'render_template';
}
***************
*** 80,83 ****
--- 116,120 ----
$controller->redirect('list');
+ return;
}
***************
*** 96,99 ****
--- 133,137 ----
$controller->redirect('list');
+ return;
}
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:42:39
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv28722 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/MANIFEST,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MANIFEST 22 Apr 2003 20:09:35 -0000 1.5 --- MANIFEST 22 Apr 2003 21:42:36 -0000 1.6 *************** *** 6,10 **** lib/HTTP/WebTest/Recorder/Config.pm lib/HTTP/WebTest/Recorder/Controller.pm - lib/HTTP/WebTest/Recorder/Exceptions.pm lib/HTTP/WebTest/Recorder/POE.pm lib/HTTP/WebTest/Recorder/template/list --- 6,9 ---- |
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:42:23
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv28633/lib/HTTP/WebTest/Recorder Removed Files: Exceptions.pm Log Message: Removed as it is not used anymore --- Exceptions.pm DELETED --- |
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:41:01
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv27890/lib/HTTP/WebTest/Recorder
Modified Files:
Config.pm
Log Message:
Do not use default_action()
Index: Config.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Config.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Config.pm 22 Apr 2003 21:40:18 -0000 1.1
--- Config.pm 22 Apr 2003 21:40:55 -0000 1.2
***************
*** 14,19 ****
enable => \&enable_action,
delete => \&delete_action,
! filter => \&filter_action,
! default => \&default_action);
1;
--- 14,18 ----
enable => \&enable_action,
delete => \&delete_action,
! filter => \&filter_action);
1;
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 21:40:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv27675/lib/HTTP/WebTest/Recorder
Added Files:
Config.pm
Log Message:
Added
--- NEW FILE: Config.pm ---
package HTTP::WebTest::Recorder::Config;
use base qw(Exporter);
@EXPORT_OK = qw(%DISPATCH);
use HTTP::WebTest::Recorder::Actions qw(:all);
%DISPATCH = (render_template => \&render_template_action,
list => \&list_action,
request => \&request_action,
response_content => \&response_content_action,
wtscript => \&wtscript_action,
enable => \&enable_action,
delete => \&delete_action,
filter => \&filter_action,
default => \&default_action);
1;
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 20:10:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv15955
Modified Files:
Controller.pm
Log Message:
Move %DISPATCH defenition into HTTP::WebTest::Recorder::Config
Index: Controller.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Controller.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Controller.pm 5 Apr 2003 09:59:59 -0000 1.7
--- Controller.pm 22 Apr 2003 20:10:19 -0000 1.8
***************
*** 11,16 ****
use Template;
use HTTP::WebTest::Recorder::Exceptions;
- use HTTP::WebTest::Recorder::Actions qw(:all);
# constructor
--- 11,16 ----
use Template;
+ use HTTP::WebTest::Recorder::Config qw(%DISPATCH);
use HTTP::WebTest::Recorder::Exceptions;
# constructor
***************
*** 31,45 ****
# request object
*request = make_access_method('REQUEST');
-
- use vars qw(%DISPATCH);
-
- %DISPATCH = (list => \&list_action,
- request => \&request_action,
- response_content => \&response_content_action,
- wtscript => \&wtscript_action,
- enable => \&enable_action,
- delete => \&delete_action,
- filter => \&filter_action,
- default => \&default_action);
# serves requests for web interface of the proxy
--- 31,34 ----
|
|
From: Ilya M. <m_...@us...> - 2003-04-22 20:09:42
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv15544 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MANIFEST 2 Feb 2003 17:30:24 -0000 1.4 --- MANIFEST 22 Apr 2003 20:09:35 -0000 1.5 *************** *** 4,9 **** --- 4,11 ---- lib/HTTP/WebTest/Recorder.pm lib/HTTP/WebTest/Recorder/Actions.pm + lib/HTTP/WebTest/Recorder/Config.pm lib/HTTP/WebTest/Recorder/Controller.pm lib/HTTP/WebTest/Recorder/Exceptions.pm + lib/HTTP/WebTest/Recorder/POE.pm lib/HTTP/WebTest/Recorder/template/list lib/HTTP/WebTest/Recorder/template/page.inc |
|
From: Ilya M. <m_...@us...> - 2003-04-05 10:00:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template
In directory sc8-pr-cvs1:/tmp/cvs-serv6157/lib/HTTP/WebTest/Recorder/template
Modified Files:
list
Log Message:
UI for header filters
Index: list
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/template/list,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** list 4 Apr 2003 21:42:12 -0000 1.4
--- list 5 Apr 2003 10:00:49 -0000 1.5
***************
*** 1,9 ****
[% WRAPPER page.inc
! title => 'List of Request/Response Pairs'
%]
! [% USE enable_url = URL('enable') %]
!
! <form action="[% enable_url %]" method="get">
[% IF controller.recorder.is_recording %]
<input type="hidden" name="enable" value="0">
--- 1,7 ----
[% WRAPPER page.inc
! title => 'HTTP::WebTest::Recorder'
%]
! <form action="enable" method="get">
[% IF controller.recorder.is_recording %]
<input type="hidden" name="enable" value="0">
***************
*** 16,23 ****
</form>
[% IF tests.size > 0 %]
[% USE request_url = URL('request') %]
- [% USE delete_url = URL('delete') %]
<table>
--- 14,41 ----
</form>
+ <h2>Response headers filter settings</h2>
+
+ [% header_filter = controller.recorder.filter.header %]
+
+ [% IF header_filter %]
+ [% FOREACH field = header_filter.sort %]
+ <p>
+ [% field | html %]: [% header_filter.$field | html %]
+ </p>
+ [% END %]
+ [% END %]
+
+ <form action="filter" method="get">
+ <input type="hidden" name="type" value="header">
+ <input type="text" name="field" value="">
+ <input type="text" name="value" value="">
+ <input type="submit" value="Add/Modify Filter">
+ </form>
+
+ <h2>List of Request/Response Pairs</h2>
+
[% IF tests.size > 0 %]
[% USE request_url = URL('request') %]
<table>
***************
*** 31,35 ****
</td>
<td>
! <form action="[% delete_url %]" method="get">
<input type="hidden" name="num" value="[% loop.index %]">
<input type="submit" value="Delete">
--- 49,53 ----
</td>
<td>
! <form action="delete" method="get">
<input type="hidden" name="num" value="[% loop.index %]">
<input type="submit" value="Delete">
|