http-webtest-commits Mailing List for HTTP-WebTest (Page 11)
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: Johannes la P. <joe...@us...> - 2003-01-02 16:52:20
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport In directory sc8-pr-cvs1:/tmp/cvs-serv8507 Modified Files: Changes MANIFEST README Added Files: TODO Log Message: Prepared for release, small fixes and more robust tests --- NEW FILE: TODO --- TODO HTTP::WebTest::Plugin::XMLReport In no particular order: o Add plugin parameter "time_zone" for date calculations This is needed for DateTest anyway, so why not? o Enhance output to feed back into WebTest, so we can do retries on failure. o Add sample scripts for post-processing of XML output o Add XML input module, either as script (proof of concept is done) or as an inherited WebTest module. o Implement missing functionality from DefaultReport: - show_headers - show_html - show_cookies Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/Changes,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Changes 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- Changes 2 Jan 2003 16:52:16 -0000 1.2 *************** *** 1,4 **** --- 1,13 ---- Revision history for Perl extension XMLReport. + 1.00 Thu Jan 2 17:44:33 CET 2003 + - removed XML::Parser from tests + - switched to HTTP::WebTest::SelfTest + - removed utils.pl (obsolete now) + - tweaked DTD (PASS/FAIL status) + + 0.92 Wed Oct 30 21:25:49 2002 UTC + - Upgraded for 2.x API by IlyaM + 0.90 Wed Jun 19 22:36:49 CEST 2002 - initial *working* version, edited from Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/MANIFEST,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MANIFEST 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- MANIFEST 2 Jan 2003 16:52:16 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- Makefile.PL README + TODO lib/HTTP/WebTest/Plugin/XMLReport.pm t/01_basic.t *************** *** 10,13 **** t/lib/HTTP/WebTest/Plugin/FileRequest.pm t/test.out/out-dtd.xml t/test.out/out.xml - t/utils.pl --- 11,15 ---- t/lib/HTTP/WebTest/Plugin/FileRequest.pm t/test.out/out-dtd.xml + t/test.out/out-missing-opts.xml + t/test.out/out-no-name.xml t/test.out/out.xml Index: README =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 26 Dec 2002 21:14:20 -0000 1.2 --- README 2 Jan 2003 16:52:16 -0000 1.3 *************** *** 1,3 **** ! HTTP::WebTest::Plugin::XMLReport version 0.92 ===================== --- 1,3 ---- ! HTTP::WebTest::Plugin::XMLReport version 1.00 ===================== *************** *** 27,31 **** XML::Writer (version 0.4 or newer reccommended) IO::Scalar (version 2.0 or later) ! HTTP::WebTest (duh!) BUGS --- 27,31 ---- XML::Writer (version 0.4 or newer reccommended) IO::Scalar (version 2.0 or later) ! HTTP::WebTest (version 2.x, install before this one!) BUGS *************** *** 39,43 **** COPYRIGHT AND LICENCE ! Copyright (C) 2002 Johannes la Poutre <ja...@la...> This program is free software; you can redistribute it and/or modify --- 39,43 ---- COPYRIGHT AND LICENCE ! Copyright (C) 2002 - 2003 Johannes la Poutre <ja...@la...> This program is free software; you can redistribute it and/or modify |
From: Johannes la P. <joe...@us...> - 2003-01-02 16:52:20
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv8507/lib/HTTP/WebTest/Plugin Modified Files: XMLReport.pm Log Message: Prepared for release, small fixes and more robust tests Index: XMLReport.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/lib/HTTP/WebTest/Plugin/XMLReport.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XMLReport.pm 26 Dec 2002 20:33:48 -0000 1.2 --- XMLReport.pm 2 Jan 2003 16:52:16 -0000 1.3 *************** *** 5,9 **** use XML::Writer; use vars qw($VERSION); ! $VERSION = '0.92'; =head1 NAME --- 5,9 ---- use XML::Writer; use vars qw($VERSION); ! $VERSION = '1.00'; =head1 NAME *************** *** 13,24 **** =head2 VERSION ! Pre release version 0.92 - $Revision$ ! This is *ALPHA* software, which means that its interfaces ! and output format may change. =head1 SYNOPSIS ! See L<HTTP::WebTest>, the section about plugins. =head1 DESCRIPTION --- 13,23 ---- =head2 VERSION ! version 1.00 - $Revision$ ! Compatible with L<HTTP::WebTest|HTTP::WebTest> version 2.x API =head1 SYNOPSIS ! See L<HTTP::WebTest|HTTP::WebTest>, the section about plugins. =head1 DESCRIPTION *************** *** 36,55 **** <group name="Homepage" url="http://www.mysite.com"> <test name="Status code check"> ! <result status="OK">200 OK</result> </test> <test name="Forbidden text"> ! <result status="OK">Premature end of script headers</result> </test> <test name="Required text"> ! <result status="OK">Please login:</result> ! <result status="OK"></html></result> </test> <test name="Content size check"> ! <result status="OK">Number of returned bytes ( 30381 ) is > or = 10000 ?</result> ! <result status="OK">Number of returned bytes ( 30381 ) is < or = 99000 ?</result> </test> <test name="Response time check"> ! <result status="OK">Response time ( 9.14 ) is > or = 0.01 ?</result> ! <result status="FAILED">Response time ( 9.14 ) is < or = 8.00 ?</result> </test> </group> --- 35,54 ---- <group name="Homepage" url="http://www.mysite.com"> <test name="Status code check"> ! <result status="PASS">200 OK</result> </test> <test name="Forbidden text"> ! <result status="PASS">Premature end of script headers</result> </test> <test name="Required text"> ! <result status="PASS">Please login:</result> ! <result status="PASS"></html></result> </test> <test name="Content size check"> ! <result status="PASS">Number of returned bytes ( 30381 ) is > or = 10000 ?</result> ! <result status="PASS">Number of returned bytes ( 30381 ) is < or = 99000 ?</result> </test> <test name="Response time check"> ! <result status="PASS">Response time ( 9.14 ) is > or = 0.01 ?</result> ! <result status="FAIL">Response time ( 9.14 ) is < or = 8.00 ?</result> </test> </group> *************** *** 71,74 **** --- 70,76 ---- xmllint --valid saved_xml_report.xml + (xmllint is a utility program that comes bundled with the Gnome + XML libraries, aka LibXML). + =head3 Allowed values *************** *** 79,94 **** C<no> =head1 TEST PARAMETERS ! Note: these are set from the test definitions, see L<HTTP::WebTest> for details. ! =head2 test_name, name ! Set C<test_name> from C<wtscript> or C<name> as the hash key from ! a test definition. ! Output as the C<name> attribute in for the C<group> element in the ! XML output document. =head1 REPORT DTD --- 81,117 ---- C<no> + =head2 default_report + + You may want to suppress the default report. + From C<wtscript>: + + default_report no + + Or as optional global parameter from Perl: + + $wt = new HTTP::WebTest($defs, { default_report => 'no' }); + + =head3 Allowed values + + C<yes>, C<no> + + =head3 Default value + + C<yes> + + =head1 TEST PARAMETERS ! Note: these are set from the test definitions, see L<HTTP::WebTest|HTTP::WebTest> for details. ! =head2 test_name ! The C<test_name> attribute from C<wtscript> will be used for the ! C<name> attribute of the C<group> element in the XML output document. ! This attribute is the easiest way to identify each test group, so ! it is adviced that you define one unique name per group in the ! test definitions. =head1 REPORT DTD *************** *** 112,116 **** <!ELEMENT result (#PCDATA)> <!ATTLIST result ! status (OK | FAILED) #REQUIRED > =cut --- 135,139 ---- <!ELEMENT result (#PCDATA)> <!ATTLIST result ! status (PASS | FAIL) #REQUIRED > =cut *************** *** 119,123 **** return shift->SUPER::param_types . "\n" . q(default_report yesno ! xml_report_dtd yesno test_name scalar ); --- 142,146 ---- return shift->SUPER::param_types . "\n" . q(default_report yesno ! xml_report_dtd yesno test_name scalar ); *************** *** 139,143 **** my $dtd = $self->global_test_param('xml_report_dtd'); if ($dtd && ($dtd eq 'yes')) { ! $dtd = "<!DOCTYPE testresults [\n" . join('', <DATA>) . "]>\n"; } else { $dtd = undef; --- 162,166 ---- my $dtd = $self->global_test_param('xml_report_dtd'); if ($dtd && ($dtd eq 'yes')) { ! $dtd = sprintf("<!DOCTYPE testresults [\n%s]>\n", &_DTD()); } else { $dtd = undef; *************** *** 153,170 **** } - ##FIXME: not sure if this will work... - sub output_dtd { - my $self = shift; - - $self->global_validate_params(qw(fh_out)); - my $fh_out = $self->global_test_param('fh_out'); - my $dtd = "<?xml version=\"1.0\" ?>\n" . join('', <DATA>); - if ($fh_out) { - $fh_out->print($dtd); - } else { - return $dtd; - } - } - sub start_tests { my $self = shift; --- 176,179 ---- *************** *** 183,188 **** # get test params we handle ! my $test_name = $self->test_param('test_name'); ! my $url = ''; if($self->webtest->current_request) { $url = $self->webtest->current_request->uri; --- 192,197 ---- # get test params we handle ! my $test_name = $self->test_param('test_name', 'untitled'); ! my $url = ''; if($self->webtest->current_request) { $url = $self->webtest->current_request->uri; *************** *** 196,201 **** for my $result (@{$self->webtest->current_results}) { # test results ! my $group_comment = $$result[0]; ! my @results = @$result[1 .. @$result - 1]; next unless @results; --- 205,210 ---- for my $result (@{$self->webtest->current_results}) { # test results ! my $group_comment = $$result[0] || ''; ! my @results = @$result[1 .. @$result - 1]; next unless @results; *************** *** 204,209 **** for my $subresult (@$result[1 .. @$result - 1]) { ! my $comment = $subresult->comment; ! my $ok = $subresult->ok ? 'OK' : 'FAILED'; $self->{x_out}->dataElement('result', $comment, 'status' => $ok); --- 213,218 ---- for my $subresult (@$result[1 .. @$result - 1]) { ! my $comment = $subresult->comment || ''; ! my $ok = $subresult->ok ? 'PASS' : 'FAIL'; $self->{x_out}->dataElement('result', $comment, 'status' => $ok); *************** *** 239,245 **** } ! =head1 VERSION - $Id$ =head1 COPYRIGHT --- 248,293 ---- } ! sub _DTD { ! return <<"DTD"; ! <!ELEMENT testresults (group+)> ! <!ATTLIST testresults ! date CDATA #REQUIRED > ! ! <!ELEMENT group (test+)> ! <!ATTLIST group ! name CDATA #REQUIRED ! url CDATA #REQUIRED > ! ! <!ELEMENT test (result+)> ! <!ATTLIST test ! name CDATA #REQUIRED > ! ! <!ELEMENT result (#PCDATA)> ! <!ATTLIST result ! status (PASS | FAIL) #REQUIRED > ! DTD ! } ! ! =head1 BUGS ! ! If the test run dies, the resulting XML report is not preperly ! terminated, resulting in malformed format which is not parsable ! by conforming XML processors. ! ! This can happen for example when a document could not be fetched ! and when subsequently a test with the Click plugin is used. ! ! The following limitations apply: ! ! These options from the DefaultReport are missing: ! ! show_headers ! show_html ! show_cookies ! ! Sending email from this module is not implemented; a work around ! would be to parse the resulting XML document and generate an ! email message whenever a test result has status C<FAIL>. =head1 COPYRIGHT *************** *** 266,284 **** 1; - __DATA__ - <!ELEMENT testresults (group+)> - <!ATTLIST testresults - date CDATA #REQUIRED > - - <!ELEMENT group (test+)> - <!ATTLIST group - name CDATA #REQUIRED - url CDATA #REQUIRED > - - <!ELEMENT test (result+)> - <!ATTLIST test - name CDATA #REQUIRED > - - <!ELEMENT result (#PCDATA)> - <!ATTLIST result - status (OK | FAILED) #REQUIRED > --- 314,315 ---- |
From: Johannes la P. <joe...@us...> - 2002-12-31 15:46:17
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/test.out In directory sc8-pr-cvs1:/tmp/cvs-serv21188/t/test.out Modified Files: basic Added Files: dyn.txt Log Message: Preparation for release, more test cases --- NEW FILE: dyn.txt --- Failed Succeeded Test Name 0 2 datetest Total web tests failed: 0 succeeded: 2 Index: basic =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/test.out/basic,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** basic 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- basic 31 Dec 2002 15:46:13 -0000 1.2 *************** *** 1,5 **** Failed Succeeded Test Name ! 0 3 datetest ! Total web tests failed: 0 succeeded: 3 --- 1,5 ---- Failed Succeeded Test Name ! 0 4 datetest ! Total web tests failed: 0 succeeded: 4 |
From: Johannes la P. <joe...@us...> - 2002-12-31 15:46:17
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t In directory sc8-pr-cvs1:/tmp/cvs-serv21188/t Modified Files: 01_basic.t in.html Added Files: dyn.txt Log Message: Preparation for release, more test cases --- NEW FILE: dyn.txt --- File generated by 't/01_basic.t', do not edit START Tue Dec 31 12:16:40 2002 GMT END EOF Index: 01_basic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/01_basic.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 01_basic.t 26 Dec 2002 21:17:46 -0000 1.2 --- 01_basic.t 31 Dec 2002 15:46:13 -0000 1.3 *************** *** 4,8 **** ######################### ! use Test::More tests => 3; require 't/utils.pl'; my $loaded = 0; --- 4,8 ---- ######################### ! use Test::More tests => 4; require 't/utils.pl'; my $loaded = 0; *************** *** 22,28 **** test_name => 'datetest', url => 't/in.html', ! date_start => [ 'starttest', 'Updated:' ], ! date_maxage => [ '9999 weeks', '9999 weeks' ], ! date_end => [ 'endtest', '</p>' ], } ]; --- 22,28 ---- test_name => 'datetest', url => 't/in.html', ! date_start => [ 'starttest', 'Updated:', '$Date:' ], ! date_maxage => [ '9999 weeks', '9999 weeks', '9999 weeks' ], ! date_end => [ 'endtest', '</p>', '$' ], } ]; *************** *** 31,34 **** --- 31,56 ---- opts => { plugins => ['::DateTest', '::FileRequest'], terse => 'summary' }, check_file => 't/test.out/basic'); + } + + + # 4 - dynamically generated file + { + my $tmdiff = 10 + time() - 1041337000; + open(FH, '> t/dyn.txt') or die "Can't create t/dyn.txt, $!"; + print FH "File generated by 't/01_basic.t', do not edit\n"; + print FH "START Tue Dec 31 12:16:40 2002 GMT END\nEOF\n"; + close FH; + my $tests = [ + { + test_name => 'datetest', + url => 't/dyn.txt', + date_start => [ 'START' ], + date_maxage => [ "$tmdiff s" ], + date_end => [ 'END' ], + } ]; + check_webtest(webtest => $WEBTEST, + tests => $tests, + opts => { plugins => ['::DateTest', '::FileRequest'], terse => 'summary' }, + check_file => 't/test.out/dyn.txt'); } Index: in.html =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/in.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** in.html 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- in.html 31 Dec 2002 15:46:13 -0000 1.2 *************** *** 7,9 **** --- 7,11 ---- <h1>A Title Here</h1> + <p>Play nice with CVS $Date$</p> + </html> |
From: Johannes la P. <joe...@us...> - 2002-12-31 15:46:16
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv21188/lib/HTTP/WebTest/Plugin Modified Files: DateTest.pm Log Message: Preparation for release, more test cases Index: DateTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/lib/HTTP/WebTest/Plugin/DateTest.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DateTest.pm 30 Dec 2002 17:22:19 -0000 1.4 --- DateTest.pm 31 Dec 2002 15:46:12 -0000 1.5 *************** *** 7,11 **** use vars qw($VERSION); ! $VERSION = '0.99'; =head1 NAME --- 7,11 ---- use vars qw($VERSION); ! $VERSION = '1.00'; =head1 NAME *************** *** 15,24 **** =head1 VERSION ! Version 0.99 - $Revision$ ! Pre release for WebTest 2.00 =head1 SYNOPSIS ! Not Applicable --- 15,24 ---- =head1 VERSION ! Version 1.00 - $Revision$ ! Compatible with L<HTTP::WebTest|HTTP::WebTest> 2.00 =head1 SYNOPSIS ! Not Applicable - see HTTP::WEBTEST *************** *** 30,35 **** There is limited support for other locales for which a C<Date::Language::*> module exist. ! The C<Date::Languge> and C<Date::Parse> modules are ! part of the L<Time::Date> distribution, available from a CPAN near you. --- 30,35 ---- There is limited support for other locales for which a C<Date::Language::*> module exist. ! The C<Date::Languge> and L<Date::Parse|Date::Parse> modules are ! part of the C<TimeDate> distribution, available from a CPAN near you. *************** *** 45,49 **** Text string which marks the start of a date string in the returned page. ! The date string should look like anything that L<Date::Parse> is able to understand. Leading/trailing whitespace is no problem --- 45,49 ---- Text string which marks the start of a date string in the returned page. ! The date string should look like anything that L<Date::Parse|Date::Parse> is able to understand. Leading/trailing whitespace is no problem *************** *** 53,57 **** Text string which marks the end of a date string in the returned page. ! The date string should look like anything that L<Date::Parse> is able to understand. Leading/trailing whitespace is no problem --- 53,57 ---- Text string which marks the end of a date string in the returned page. ! The date string should look like anything that L<Date::Parse|Date::Parse> is able to understand. Leading/trailing whitespace is no problem *************** *** 85,89 **** Specify the language in which the date string is written. Locales are taken from C<Date::Language::(Locale)> modules (part ! of L<Date::Parse>). The value of C<date_locale> is normalized to Capitalized notation, so this parameter is not case sensitive. --- 85,89 ---- Specify the language in which the date string is written. Locales are taken from C<Date::Language::(Locale)> modules (part ! of L<Date::Parse|Date::Parse>). The value of C<date_locale> is normalized to Capitalized notation, so this parameter is not case sensitive. *************** *** 155,159 **** if ($content =~ /\Q$start\E\s*(.+?)\s*\Q$end\E/) { $datestr = $1; ! $pgdate = _str2time_locale($datestr, $locale); } my $age = ($pgdate) ? $now - $pgdate : 'unknown'; --- 155,159 ---- if ($content =~ /\Q$start\E\s*(.+?)\s*\Q$end\E/) { $datestr = $1; ! $pgdate = &_str2time_locale($datestr, $locale); } my $age = ($pgdate) ? $now - $pgdate : 'unknown'; *************** *** 163,172 **** push @results, $self->test_result($ok, ! sprintf("%s %s %s (%s > %s)", $start, $datestr, $end, &_seconds2str($age, $units), $maxage) ); } push @ret, ['Max. age of date string', @results] if @results; - return @ret; } --- 163,172 ---- push @results, $self->test_result($ok, ! sprintf("Wanted max %s and got %s (%s)", ! $maxage, &_seconds2str($age, $units), $datestr) ); } push @ret, ['Max. age of date string', @results] if @results; return @ret; } *************** *** 202,206 **** my ($date, $units) = @_; if (&TIMETAB($units)) { ! return sprintf("%4.2f %s", $date/&TIMETAB($units), $units); } my $str = ''; --- 202,207 ---- my ($date, $units) = @_; if (&TIMETAB($units)) { ! return ($units eq 's') ? "$date s" ! : sprintf("%4.2f %s", $date/&TIMETAB($units), $units); } my $str = ''; *************** *** 275,287 **** =head1 SEE ALSO ! L<Date::Parse> ! L<HTTP::WebTest> ! L<HTTP::WebTest::API> ! L<HTTP::WebTest::Plugin> ! L<HTTP::WebTest::Plugins> =cut --- 276,288 ---- =head1 SEE ALSO ! L<Date::Parse|Date::Parse> ! L<HTTP::WebTest|HTTP::WebTest> ! L<HTTP::WebTest::API|HTTP::WebTest::API> ! L<HTTP::WebTest::Plugin|HTTP::WebTest::Plugin> ! L<HTTP::WebTest::Plugins|HTTP::WebTest::Plugins> =cut |
From: Johannes la P. <joe...@us...> - 2002-12-31 15:46:15
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest In directory sc8-pr-cvs1:/tmp/cvs-serv21188 Modified Files: Changes MANIFEST README Added Files: TODO Log Message: Preparation for release, more test cases --- NEW FILE: TODO --- TODO HTTP::WebTest::Plugin::DateTest In no particular order: o Add plugin parameter "time_zone" for date calculations This could be useful for other plugins as well, maybe o Use core param "ignore_case" for matching start/end markers If it's available, why not use it? o Add regex support for matching start/end markers More flexibility, also to match start or end of line or file o Add test cases for more Date::Language::* Keeping up with released versions of TimeDate seems reasonable, especially if the test is skipped on a platform where these languages are missing. o Think long and hard about character encoding issues The modules that come with Date::Language seem not to agree on one single encoding: - Roman languages seem to be encoded in ISO-8859-1 - Greek is encoded in UTF-8 Web servers sometimes set the encoding correctly in the HTTP headers, a html document may override this in a specific <meta ...> element and then the user agent may assume some default. What a mess! Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/Changes,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Changes 9 Oct 2002 22:15:16 -0000 1.2 --- Changes 31 Dec 2002 15:46:12 -0000 1.3 *************** *** 1,4 **** --- 1,15 ---- Revision history for Perl extension DateTest. + 1.00 Tue Dec 31 13:57:47 CET 2002 + - improved human readable result output + - added TODO list + - prepared for release on CPAN + + 0.99 Mon Dec 30 18:49:36 CET 2002 + - compatibility with HTTP::WebTest 2.00 (IlyaM) + - API change from 1.XX, be sure to upgrade! + - fixed time zone issues in testcases (IlyaM) + - fixed behaviour for empty date string + 0.91 Thu Oct 10 00:02:49 CEST 2002 - use same time units as test spec for return value Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/MANIFEST,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MANIFEST 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- MANIFEST 31 Dec 2002 15:46:12 -0000 1.2 *************** *** 4,14 **** --- 4,17 ---- Makefile.PL README + TODO lib/HTTP/WebTest/Plugin/DateTest.pm t/01_basic.t t/02_dateparsing.t t/03_timeunits.t + t/dyn.txt t/in.html t/lib/HTTP/WebTest/Plugin/Cookies.pm t/lib/HTTP/WebTest/Plugin/FileRequest.pm t/test.out/basic + t/test.out/dyn.txt t/utils.pl Index: README =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README 30 Dec 2002 17:22:19 -0000 1.3 --- README 31 Dec 2002 15:46:12 -0000 1.4 *************** *** 1,3 **** ! DateTest version 0.99 ===================== --- 1,3 ---- ! DateTest version 1.00 ===================== *************** *** 30,34 **** DEPENDENCIES ! This module requires these other modules and libraries: HTTP::WebTest (version 2.00 or newer) --- 30,34 ---- DEPENDENCIES ! This module requires the following other modules and libraries: HTTP::WebTest (version 2.00 or newer) |
From: Johannes la P. <joe...@us...> - 2002-12-30 17:22:22
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv25712/lib/HTTP/WebTest/Plugin Modified Files: DateTest.pm Log Message: Fix glitch for empty 'date' string, added test cases Index: DateTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/lib/HTTP/WebTest/Plugin/DateTest.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DateTest.pm 26 Dec 2002 21:15:30 -0000 1.3 --- DateTest.pm 30 Dec 2002 17:22:19 -0000 1.4 *************** *** 7,11 **** use vars qw($VERSION); ! $VERSION = '0.91'; =head1 NAME --- 7,11 ---- use vars qw($VERSION); ! $VERSION = '0.99'; =head1 NAME *************** *** 15,19 **** =head1 VERSION ! Pre release version 0.90 - $Revision$ =head1 SYNOPSIS --- 15,20 ---- =head1 VERSION ! Version 0.99 - $Revision$ ! Pre release for WebTest 2.00 =head1 SYNOPSIS *************** *** 154,158 **** if ($content =~ /\Q$start\E\s*(.+?)\s*\Q$end\E/) { $datestr = $1; ! $pgdate = ($locale) ? _str2time_locale($datestr, $locale) : str2time($datestr); } my $age = ($pgdate) ? $now - $pgdate : 'unknown'; --- 155,159 ---- if ($content =~ /\Q$start\E\s*(.+?)\s*\Q$end\E/) { $datestr = $1; ! $pgdate = _str2time_locale($datestr, $locale); } my $age = ($pgdate) ? $now - $pgdate : 'unknown'; *************** *** 226,229 **** --- 227,232 ---- my $date = shift; my $locale = ucfirst(lc(shift)) || 'English'; + # return if date is, well, empty... + return if ($date =~ /^\s*$/sg); return str2time $date if ($locale eq 'English'); *************** *** 258,261 **** --- 261,266 ---- } } + # explicitly return for empty or '0' date string + return unless $nwdate; return str2time $nwdate; } |
From: Johannes la P. <joe...@us...> - 2002-12-30 17:22:22
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t In directory sc8-pr-cvs1:/tmp/cvs-serv25712/t Modified Files: 02_dateparsing.t Log Message: Fix glitch for empty 'date' string, added test cases Index: 02_dateparsing.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/02_dateparsing.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 02_dateparsing.t 26 Dec 2002 21:17:15 -0000 1.2 --- 02_dateparsing.t 30 Dec 2002 17:22:20 -0000 1.3 *************** *** 1,3 **** ! use Test::More tests => 11; # for testing purposes configure ourselves with specific timezone --- 1,3 ---- ! use Test::More tests => 16; # for testing purposes configure ourselves with specific timezone *************** *** 59,61 **** --- 59,81 ---- $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); is($ret, 1016576700, "German with leading/trailing space '$date'"); + + $date = "Ceci n'est pas une date: 99-33-3333"; + $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); + is($ret, undef, "No date string '$date'"); + + $date = ""; + $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'Dutch'); + is($ret, undef, "Empty string with locale '$date'"); + + $date = ""; + $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); + is($ret, undef, "Empty string, default '$date'"); + + $date = "no numbers (Locale)"; + $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'Dutch'); + is($ret, undef, "No date string '$date'"); + + $date = "no numbers (default)"; + $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); + is($ret, undef, "No date string '$date'"); |
From: Johannes la P. <joe...@us...> - 2002-12-30 17:22:22
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest In directory sc8-pr-cvs1:/tmp/cvs-serv25712 Modified Files: Makefile.PL README Log Message: Fix glitch for empty 'date' string, added test cases Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/Makefile.PL,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.PL 26 Dec 2002 21:16:11 -0000 1.2 --- Makefile.PL 30 Dec 2002 17:22:19 -0000 1.3 *************** *** 12,16 **** ( ABSTRACT_FROM => 'lib/HTTP/WebTest/Plugin/DateTest.pm', ! AUTHOR => 'Johannes la Poutre <ya...@la...>', ) : ()), ); --- 12,16 ---- ( ABSTRACT_FROM => 'lib/HTTP/WebTest/Plugin/DateTest.pm', ! AUTHOR => 'Johannes la Poutre <ja...@la...>', ) : ()), ); Index: README =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 26 Dec 2002 21:15:53 -0000 1.2 --- README 30 Dec 2002 17:22:19 -0000 1.3 *************** *** 1,3 **** ! DateTest version 0.9 ===================== --- 1,3 ---- ! DateTest version 0.99 ===================== *************** *** 32,36 **** This module requires these other modules and libraries: ! HTTP::WebTest (version 1.99 or newer) DateTime (version 1.13 or newer recommended) --- 32,36 ---- This module requires these other modules and libraries: ! HTTP::WebTest (version 2.00 or newer) DateTime (version 1.13 or newer recommended) *************** *** 49,53 **** COPYRIGHT AND LICENCE ! Copyright (C) 2002 Johannes la Poutre <ya...@la...> This program is free software; you can redistribute it and/or --- 49,53 ---- COPYRIGHT AND LICENCE ! Copyright (C) 2002 Johannes la Poutre <ja...@la...> This program is free software; you can redistribute it and/or |
From: Ilya M. <m_...@us...> - 2002-12-29 14:30:48
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory sc8-pr-cvs1:/tmp/cvs-serv14763 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Changes 22 Dec 2002 21:25:50 -0000 1.66 --- Changes 29 Dec 2002 14:30:36 -0000 1.67 *************** *** 117,121 **** which set query parameters using HTTP::Request's methods 'content' and 'uri' are likely to be broken by this change. If you use such plugins ! then change them to use HTTP::WebTest::Request's method 'params'. DEPRECATIONS: --- 117,121 ---- which set query parameters using HTTP::Request's methods 'content' and 'uri' are likely to be broken by this change. If you use such plugins ! then modify them to use HTTP::WebTest::Request's method 'params'. DEPRECATIONS: |
From: Ilya M. <m_...@us...> - 2002-12-26 21:19:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t In directory sc8-pr-cvs1:/tmp/cvs-serv17547/t Modified Files: 03_timeunits.t Log Message: Use Test::More instead of Test::Simple Index: 03_timeunits.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/03_timeunits.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 03_timeunits.t 9 Oct 2002 22:15:16 -0000 1.2 --- 03_timeunits.t 26 Dec 2002 21:19:53 -0000 1.3 *************** *** 1,3 **** ! use Test::Simple tests => 22; use lib qw(./blib/lib); use HTTP::WebTest::Plugin::DateTest; --- 1,3 ---- ! use Test::More tests => 22; use lib qw(./blib/lib); use HTTP::WebTest::Plugin::DateTest; *************** *** 6,93 **** $date = '1'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 1, "1 second: '$date' - returned '$ret'"); $date = '1 minute'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 60, "60 seconds: '$date' - returned '$ret'"); $date = '1 hr'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 3600, "3600 seconds: '$date' - returned '$ret'"); $date = '1 day -- additional text ignored'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 86400, "86400 seconds: '$date' - returned '$ret'"); $date = ' 1 week -- leading space ignored'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 7*86400, "a week full of seconds: '$date' - returned '$ret'"); $date = '1 SECOND'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 1, "Case insensitive: '$date' - returned '$ret'"); $date = '1.5 hours'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 3600+1800, "Fractional value: '$date' - returned '$ret'"); $date = "\t1\thr"; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 3600, "Tabs as whitespace: '$date' - returned '$ret'"); $date = '1 dada -- nonsense units'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 86400, "Unit interpreted as 'd': '$date' - returned '$ret'"); $date = '10 foobar -- utmost nonsense units'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 10, "Default unit is 'seconds': '$date' - returned '$ret'"); $date = 'not numeric 10'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 0, "Zero: '$date' - returned '$ret'"); $date = '.5 minutes'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 30, "Fraction only: '$date' - returned '$ret'"); $date = '+10 secs'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 10, "Leading plus: '$date' - returned '$ret'"); $date = '-10 secs'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == -10, "Leading minus: '$date' - returned '$ret'"); $date = "\t+1.536 \t Hours (comment)\n1 more line"; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! ok($ret == 3600*1.536, "Baroque format: '$date' - returned '$ret'"); # reverse: date string rendering $date = "987653"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date); ! ok($ret eq '1w 4d 10:20:53', "$date seconds: '$ret'"); $date = "987653"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'w'); ! ok($ret eq '1.63 w', "$date seconds: '$ret'"); $date = "987653"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'd'); ! ok($ret eq '11.43 d', "$date seconds: '$ret'"); $date = "7200"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'h'); ! ok($ret eq '2.00 h', "$date seconds: '$ret'"); $date = "200"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'm'); ! ok($ret eq '3.33 m', "$date seconds: '$ret'"); $date = "653.74"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 's'); ! ok($ret eq '653.74 s', "$date seconds: '$ret'"); $date = "653.74"; # seconds ($ret) = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 's'); ! ok($ret eq '653.74 s', "List context: $date seconds: '$ret'"); --- 6,93 ---- $date = '1'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 1, "1 second: '$date' - returned '$ret'"); $date = '1 minute'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 60, "60 seconds: '$date' - returned '$ret'"); $date = '1 hr'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 3600, "3600 seconds: '$date' - returned '$ret'"); $date = '1 day -- additional text ignored'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 86400, "86400 seconds: '$date' - returned '$ret'"); $date = ' 1 week -- leading space ignored'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 7*86400, "a week full of seconds: '$date' - returned '$ret'"); $date = '1 SECOND'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 1, "Case insensitive: '$date' - returned '$ret'"); $date = '1.5 hours'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 3600+1800, "Fractional value: '$date' - returned '$ret'"); $date = "\t1\thr"; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 3600, "Tabs as whitespace: '$date' - returned '$ret'"); $date = '1 dada -- nonsense units'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 86400, "Unit interpreted as 'd': '$date' - returned '$ret'"); $date = '10 foobar -- utmost nonsense units'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 10, "Default unit is 'seconds': '$date' - returned '$ret'"); $date = 'not numeric 10'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 0, "Zero: '$date' - returned '$ret'"); $date = '.5 minutes'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 30, "Fraction only: '$date' - returned '$ret'"); $date = '+10 secs'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 10, "Leading plus: '$date' - returned '$ret'"); $date = '-10 secs'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, -10, "Leading minus: '$date' - returned '$ret'"); $date = "\t+1.536 \t Hours (comment)\n1 more line"; $ret = &HTTP::WebTest::Plugin::DateTest::_str2seconds($date); ! is($ret, 3600*1.536, "Baroque format: '$date' - returned '$ret'"); # reverse: date string rendering $date = "987653"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date); ! is($ret, '1w 4d 10:20:53', "$date seconds: '$ret'"); $date = "987653"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'w'); ! is($ret, '1.63 w', "$date seconds: '$ret'"); $date = "987653"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'd'); ! is($ret, '11.43 d', "$date seconds: '$ret'"); $date = "7200"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'h'); ! is($ret, '2.00 h', "$date seconds: '$ret'"); $date = "200"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 'm'); ! is($ret, '3.33 m', "$date seconds: '$ret'"); $date = "653.74"; # seconds $ret = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 's'); ! is($ret, '653.74 s', "$date seconds: '$ret'"); $date = "653.74"; # seconds ($ret) = &HTTP::WebTest::Plugin::DateTest::_seconds2str($date, 's'); ! is($ret, '653.74 s', "List context: $date seconds: '$ret'"); |
From: Ilya M. <m_...@us...> - 2002-12-26 21:17:49
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t In directory sc8-pr-cvs1:/tmp/cvs-serv16587/t Modified Files: 01_basic.t Log Message: Use Test::More instead of Test::Simple Index: 01_basic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/01_basic.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** 01_basic.t 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- 01_basic.t 26 Dec 2002 21:17:46 -0000 1.2 *************** *** 4,21 **** ######################### ! use Test::Simple tests => 3; require 't/utils.pl'; my $loaded = 0; use lib qw(./t/lib ./blib/lib); - use HTTP::WebTest::Plugin::DateTest; - $loaded++; ! # 1 - if we make it here loading was OK ! ok($loaded = 1, 'Import of HTTP::WebTest::Plugin::DateTest'); ! # 2 - test wether HTTP::WebTest is installed ! eval { require HTTP::WebTest }; my $WEBTEST = HTTP::WebTest->new; - ok($@ eq '', 'Check for HTTP::WebTest on this system'); # 3 - do some real request --- 4,18 ---- ######################### ! use Test::More tests => 3; require 't/utils.pl'; my $loaded = 0; use lib qw(./t/lib ./blib/lib); ! # 1 - test whether HTTP::WebTest::Plugin::DateTest can be loaded ! require_ok 'HTTP::WebTest::Plugin::DateTest'; ! # 2 - test whether HTTP::WebTest is installed ! require_ok 'HTTP::WebTest'; my $WEBTEST = HTTP::WebTest->new; # 3 - do some real request *************** *** 29,33 **** date_end => [ 'endtest', '</p>' ], } ]; ! check_webtest(webtest => $WEBTEST, tests => $tests, --- 26,30 ---- date_end => [ 'endtest', '</p>' ], } ]; ! check_webtest(webtest => $WEBTEST, tests => $tests, |
From: Ilya M. <m_...@us...> - 2002-12-26 21:17:18
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t In directory sc8-pr-cvs1:/tmp/cvs-serv16351/t Modified Files: 02_dateparsing.t Log Message: Do not depend on timezone settings Index: 02_dateparsing.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/02_dateparsing.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** 02_dateparsing.t 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- 02_dateparsing.t 26 Dec 2002 21:17:15 -0000 1.2 *************** *** 1,26 **** ! use Test::Simple tests => 11; use lib qw(./blib/lib); use HTTP::WebTest::Plugin::DateTest; # Tests for i10l date parsing ! my $date = 'ma 22 juli 2002, 14:05:44'; my $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'dutch'); ! ok($ret == 1027339544, "Dutch date '$date'"); $date = ' dinsdag 22 okt 2002 14:05 '; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'dutch'); ! ok($ret == 1035288300, "Dutch date string with extra spaces '$date'"); $date = '22 oct 2002, 14:05:44'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'fReNcH'); ! ok($ret == 1035288344, "'fReNcH' date '$date'"); $date = 'Mar 19 Mars 2002, 17:25'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'fReNcH'); ! ok($ret == 1016555100, "French ambiguity '$date'"); $date = '19 Mär 2002 17:25'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); ! ok($ret == 1016555100, "German '$date'"); $date = <<"EOD"; --- 1,34 ---- ! use Test::More tests => 11; ! ! # for testing purposes configure ourselves with specific timezone ! use POSIX; ! BEGIN { ! $ENV{TZ} = 'EST'; ! POSIX::tzset(); ! }; ! use lib qw(./blib/lib); use HTTP::WebTest::Plugin::DateTest; # Tests for i10l date parsing ! $date = 'ma 22 juli 2002, 14:05:44'; my $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'dutch'); ! is($ret, 1027364744, "Dutch date '$date'"); $date = ' dinsdag 22 okt 2002 14:05 '; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'dutch'); ! is($ret, 1035313500, "Dutch date string with extra spaces '$date'"); $date = '22 oct 2002, 14:05:44'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'fReNcH'); ! is($ret, 1035313544, "'fReNcH' date '$date'"); $date = 'Mar 19 Mars 2002, 17:25'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'fReNcH'); ! is($ret, 1016576700, "French ambiguity '$date'"); $date = '19 Mär 2002 17:25'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); ! is($ret, 1016576700, "German '$date'"); $date = <<"EOD"; *************** *** 29,46 **** EOD $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); ! ok($ret == 1016555100, "Same, multiple lines"); # default date parsing $date = 'Mon Jul 22 14:05:44 CEST 2002'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'English'); ! ok($ret == 1027339544, "English date as returned by date(1) '$date'"); $date = 'Mon Jul 22 14:05:44 CEST 2002'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); ! ok($ret == 1027339544, "Unspecified locale '$date'"); $date = "\t Mon Jul 22 14:05:44 CEST 2002 "; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); ! ok($ret == 1027339544, "Leading/trailing whitespace '$date'"); $date = "Mon Jul 22 14:05:44 CEST 2002 with nonsense"; --- 37,54 ---- EOD $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); ! is($ret, 1016576700, "Same, multiple lines"); # default date parsing $date = 'Mon Jul 22 14:05:44 CEST 2002'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'English'); ! is($ret, 1027339544, "English date as returned by date(1) '$date'"); $date = 'Mon Jul 22 14:05:44 CEST 2002'; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); ! is($ret, 1027339544, "Unspecified locale '$date'"); $date = "\t Mon Jul 22 14:05:44 CEST 2002 "; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date); ! is($ret, 1027339544, "Leading/trailing whitespace '$date'"); $date = "Mon Jul 22 14:05:44 CEST 2002 with nonsense"; *************** *** 50,53 **** $date = " 19 Mär 2002 17:25\t"; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); ! ok($ret == 1016555100, "German with leading/trailing space '$date'"); --- 58,61 ---- $date = " 19 Mär 2002 17:25\t"; $ret = &HTTP::WebTest::Plugin::DateTest::_str2time_locale($date, 'German'); ! is($ret, 1016576700, "German with leading/trailing space '$date'"); |
From: Ilya M. <m_...@us...> - 2002-12-26 21:16:42
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t In directory sc8-pr-cvs1:/tmp/cvs-serv16075/t Modified Files: utils.pl Log Message: Remove useless 'use POSIX' Index: utils.pl =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/utils.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** utils.pl 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- utils.pl 26 Dec 2002 21:16:39 -0000 1.2 *************** *** 8,12 **** use strict; use Algorithm::Diff qw(diff); - use POSIX qw(SIGTERM); # just reads file and returns its content --- 8,11 ---- |
From: Ilya M. <m_...@us...> - 2002-12-26 21:16:13
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest In directory sc8-pr-cvs1:/tmp/cvs-serv15879 Modified Files: Makefile.PL Log Message: Updated Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/Makefile.PL,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.PL 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- Makefile.PL 26 Dec 2002 21:16:11 -0000 1.2 *************** *** 5,11 **** 'VERSION_FROM' => 'lib/HTTP/WebTest/Plugin/DateTest.pm', 'PREREQ_PM' => { ! 'HTTP::WebTest' => 1.99, # should be installed to run tests ! 'Date::Parse' => 2.23, # includes Date::Language modules ! }, ($] >= 5.005 ? ( --- 5,12 ---- 'VERSION_FROM' => 'lib/HTTP/WebTest/Plugin/DateTest.pm', 'PREREQ_PM' => { ! 'HTTP::WebTest' => 2.00, # should be installed to run tests ! 'Date::Parse' => 2.23, # includes Date::Language modules ! 'Test::More' => 0, # require to do 'make test' ! }, ($] >= 5.005 ? ( |
From: Ilya M. <m_...@us...> - 2002-12-26 21:15:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest In directory sc8-pr-cvs1:/tmp/cvs-serv15750 Modified Files: README Log Message: Fix spelling Index: README =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- README 26 Dec 2002 21:15:53 -0000 1.2 *************** *** 2,6 **** ===================== ! ABSRACT DateTest is a plugin module for the HTTP::WebTest --- 2,6 ---- ===================== ! ABSTRACT DateTest is a plugin module for the HTTP::WebTest |
From: Ilya M. <m_...@us...> - 2002-12-26 21:15:33
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv15549/lib/HTTP/WebTest/Plugin Modified Files: DateTest.pm Log Message: Compatibility with HTTP::WebTest 2.00 Index: DateTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/lib/HTTP/WebTest/Plugin/DateTest.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DateTest.pm 9 Oct 2002 22:15:16 -0000 1.2 --- DateTest.pm 26 Dec 2002 21:15:30 -0000 1.3 *************** *** 45,49 **** in the returned page. The date string should look like anything that L<Date::Parse> is ! able to understand. Leading/trailing whitespace is no problem --- 45,49 ---- in the returned page. The date string should look like anything that L<Date::Parse> is ! able to understand. Leading/trailing whitespace is no problem *************** *** 53,57 **** in the returned page. The date string should look like anything that L<Date::Parse> is ! able to understand. Leading/trailing whitespace is no problem --- 53,57 ---- in the returned page. The date string should look like anything that L<Date::Parse> is ! able to understand. Leading/trailing whitespace is no problem *************** *** 74,78 **** w(eeks) ! The default is seconds. Only the first character is relevant, any leading text is ignored. An unknown unit specifier defaults to seconds. --- 74,78 ---- w(eeks) ! The default is seconds. Only the first character is relevant, any leading text is ignored. An unknown unit specifier defaults to seconds. *************** *** 80,84 **** =head2 date_locale ! Global parameter for all date tests. Specify the language in which the date string is written. --- 80,84 ---- =head2 date_locale ! Global parameter for all date tests. Specify the language in which the date string is written. *************** *** 132,136 **** # response content ! my $content = $self->webtest->last_response->content; $self->validate_params(qw(date_start date_end date_maxage date_locale)); --- 132,136 ---- # response content ! my $content = $self->webtest->current_response->content; $self->validate_params(qw(date_start date_end date_maxage date_locale)); *************** *** 244,248 **** my @MoY = eval "\@Date::Language::${locale}::MoY"; my $MoY_EN = \@Date::Language::English::MoY; ! my $nwdate = ''; foreach my $token (split(/(\s|-|:|\/)/, $date)) { --- 244,248 ---- my @MoY = eval "\@Date::Language::${locale}::MoY"; my $MoY_EN = \@Date::Language::English::MoY; ! my $nwdate = ''; foreach my $token (split(/(\s|-|:|\/)/, $date)) { |
From: Ilya M. <m_...@us...> - 2002-12-26 21:15:33
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv15549/t/lib/HTTP/WebTest/Plugin Modified Files: FileRequest.pm Log Message: Compatibility with HTTP::WebTest 2.00 Index: FileRequest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-DateTest/t/lib/HTTP/WebTest/Plugin/FileRequest.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FileRequest.pm 12 Sep 2002 13:11:01 -0000 1.1.1.1 --- FileRequest.pm 26 Dec 2002 21:15:30 -0000 1.2 *************** *** 4,20 **** # Utility package to allow opening a a file from the local file system ! use base qw(HTTP::WebTest::Plugin); sub prepare_request { my $self = shift; ! my $url = $self->test_param('url'); my $path = URI::file->new_abs($url); ! # get user agent object my $user_agent = $self->webtest->user_agent; ! # get request object ! my $request = $self->webtest->last_request; $request->uri($path); $request->method('GET'); --- 4,20 ---- # Utility package to allow opening a a file from the local file system ! use base qw(HTTP::WebTest::Plugin); sub prepare_request { my $self = shift; ! my $url = $self->test_param('url'); my $path = URI::file->new_abs($url); ! # get user agent object my $user_agent = $self->webtest->user_agent; ! # get request object ! my $request = $self->webtest->current_request; $request->uri($path); $request->method('GET'); |
From: Ilya M. <m_...@us...> - 2002-12-26 21:14:23
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport In directory sc8-pr-cvs1:/tmp/cvs-serv14957 Modified Files: README Log Message: Fix spelling Index: README =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- README 26 Dec 2002 21:14:20 -0000 1.2 *************** *** 2,6 **** ===================== ! ABSRACT DateTest is a plugin module for the HTTP::WebTest --- 2,6 ---- ===================== ! ABSTRACT DateTest is a plugin module for the HTTP::WebTest |
From: Ilya M. <m_...@us...> - 2002-12-26 21:13:33
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport In directory sc8-pr-cvs1:/tmp/cvs-serv14592 Modified Files: Makefile.PL Log Message: Added Test::More to list of dependancies Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/Makefile.PL,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.PL 26 Dec 2002 20:34:23 -0000 1.2 --- Makefile.PL 26 Dec 2002 21:13:24 -0000 1.3 *************** *** 5,11 **** 'VERSION_FROM' => 'lib/HTTP/WebTest/Plugin/XMLReport.pm', 'PREREQ_PM' => { ! 'HTTP::WebTest' => 2.00, ! 'XML::Writer' => 0.4, ! 'IO::Scalar' => 2.0, }, 'AUTHOR' => 'Johannes la Poutre <ja...@la...>', --- 5,12 ---- 'VERSION_FROM' => 'lib/HTTP/WebTest/Plugin/XMLReport.pm', 'PREREQ_PM' => { ! 'HTTP::WebTest' => 2.00, ! 'XML::Writer' => 0.4, ! 'IO::Scalar' => 2.0, ! 'Test::More' => 0, }, 'AUTHOR' => 'Johannes la Poutre <ja...@la...>', |
From: Ilya M. <m_...@us...> - 2002-12-26 20:34:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport In directory sc8-pr-cvs1:/tmp/cvs-serv27741 Modified Files: Makefile.PL Log Message: Updated Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/Makefile.PL,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.PL 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- Makefile.PL 26 Dec 2002 20:34:23 -0000 1.2 *************** *** 2,13 **** WriteMakefile( ! 'NAME' => 'HTTP::WebTest::Plugin::XMLReport', ! 'VERSION_FROM' => 'lib/HTTP/WebTest/Plugin/XMLReport.pm', ! 'PREREQ_PM' => { ! 'HTTP::WebTest' => 1.9906, ! 'XML::Writer' => 0.4, ! 'IO::Scalar' => 2.0, ! }, ! 'AUTHOR' => 'Johannes la Poutre <ja...@la...>', ! 'ABSTRACT_FROM' => 'lib/HTTP/WebTest/Plugin/XMLReport.pm', ); --- 2,13 ---- WriteMakefile( ! 'NAME' => 'HTTP::WebTest::Plugin::XMLReport', ! 'VERSION_FROM' => 'lib/HTTP/WebTest/Plugin/XMLReport.pm', ! 'PREREQ_PM' => { ! 'HTTP::WebTest' => 2.00, ! 'XML::Writer' => 0.4, ! 'IO::Scalar' => 2.0, ! }, ! 'AUTHOR' => 'Johannes la Poutre <ja...@la...>', ! 'ABSTRACT_FROM' => 'lib/HTTP/WebTest/Plugin/XMLReport.pm', ); |
From: Ilya M. <m_...@us...> - 2002-12-26 20:33:51
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv27424/lib/HTTP/WebTest/Plugin Modified Files: XMLReport.pm Log Message: Compatiblity with HTTP::WebTest 2.00 Index: XMLReport.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/lib/HTTP/WebTest/Plugin/XMLReport.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** XMLReport.pm 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- XMLReport.pm 26 Dec 2002 20:33:48 -0000 1.2 *************** *** 12,16 **** =head2 VERSION ! Pre release version 0.92 - $Revision$ --- 12,16 ---- =head2 VERSION ! Pre release version 0.92 - $Revision$ *************** *** 56,60 **** [...] </testresults> ! =head1 GLOBAL PARAMETERS --- 56,60 ---- [...] </testresults> ! =head1 GLOBAL PARAMETERS *************** *** 86,90 **** =head2 test_name, name ! Set C<test_name> from C<wtscript> or C<name> as the hash key from a test definition. --- 86,90 ---- =head2 test_name, name ! Set C<test_name> from C<wtscript> or C<name> as the hash key from a test definition. *************** *** 185,190 **** my $test_name = $self->test_param('test_name'); my $url = ''; ! if($self->webtest->last_request) { ! $url = $self->webtest->last_request->uri; } --- 185,190 ---- my $test_name = $self->test_param('test_name'); my $url = ''; ! if($self->webtest->current_request) { ! $url = $self->webtest->current_request->uri; } *************** *** 194,198 **** my $out = ''; ! for my $result (@{$self->webtest->last_results}) { # test results my $group_comment = $$result[0]; --- 194,198 ---- my $out = ''; ! for my $result (@{$self->webtest->current_results}) { # test results my $group_comment = $$result[0]; |
From: Ilya M. <m_...@us...> - 2002-12-26 20:32:51
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t In directory sc8-pr-cvs1:/tmp/cvs-serv26732/t Modified Files: 01_basic.t Log Message: Use Test::More instead of Test::Simple Index: 01_basic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t/01_basic.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** 01_basic.t 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- 01_basic.t 26 Dec 2002 20:32:42 -0000 1.2 *************** *** 3,15 **** use HTTP::WebTest::Plugin::XMLReport; # XML::Parser is a prerequisite for XML::Simple, so it should be installed ! use XML::Parser; ! use Test::Simple tests => 4; ! ok(1, "Load HTTP::WebTest::Plugin::XMLReport"); ! # 2 - test wether HTTP::WebTest is installed ! eval { require HTTP::WebTest }; my $WEBTEST = HTTP::WebTest->new; - ok($@ eq '', 'Check for HTTP::WebTest on this system'); my $p1 = new XML::Parser(Style => 'Tree'); --- 3,15 ---- use HTTP::WebTest::Plugin::XMLReport; # XML::Parser is a prerequisite for XML::Simple, so it should be installed ! use XML::Parser; ! use Test::More tests => 4; ! # 1 - test whether HTTP::WebTest::Plugin::XMLReport can be loaded ! require_ok 'HTTP::WebTest::Plugin::XMLReport'; ! # 2 - test whether HTTP::WebTest is installed ! require_ok 'HTTP::WebTest'; my $WEBTEST = HTTP::WebTest->new; my $p1 = new XML::Parser(Style => 'Tree'); |
From: Ilya M. <m_...@us...> - 2002-12-26 20:28:17
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t In directory sc8-pr-cvs1:/tmp/cvs-serv24579/t Modified Files: utils.pl Log Message: Remove useless 'use POSIX' Index: utils.pl =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t/utils.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** utils.pl 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- utils.pl 26 Dec 2002 20:28:15 -0000 1.2 *************** *** 7,11 **** use strict; - use POSIX qw(SIGTERM); # XML::Parser is a prerequisite for XML::Simple, so it should be installed use XML::Parser; --- 7,10 ---- |
From: Ilya M. <m_...@us...> - 2002-12-26 20:27:27
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t/lib/HTTP/WebTest/Plugin In directory sc8-pr-cvs1:/tmp/cvs-serv24172/t/lib/HTTP/WebTest/Plugin Modified Files: FileRequest.pm Log Message: Make compatible with HTTP::WebTest 2.00 Index: FileRequest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t/lib/HTTP/WebTest/Plugin/FileRequest.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FileRequest.pm 30 Oct 2002 21:25:49 -0000 1.1.1.1 --- FileRequest.pm 26 Dec 2002 20:27:19 -0000 1.2 *************** *** 3,20 **** use URI::file; ! # Utility package to allow opening a a file from the local file system ! use base qw(HTTP::WebTest::Plugin); sub prepare_request { my $self = shift; ! my $url = $self->test_param('url'); my $path = URI::file->new_abs($url); ! # get user agent object my $user_agent = $self->webtest->user_agent; # get request object ! my $request = $self->webtest->last_request; $request->uri($path); $request->method('GET'); --- 3,20 ---- use URI::file; ! # Utility package to allow opening a file from the local file system ! use base qw(HTTP::WebTest::Plugin); sub prepare_request { my $self = shift; ! my $url = $self->test_param('url'); my $path = URI::file->new_abs($url); ! # get user agent object my $user_agent = $self->webtest->user_agent; # get request object ! my $request = $self->webtest->current_request; $request->uri($path); $request->method('GET'); |