Update of /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/t
In directory sc8-pr-cvs1:/tmp/cvs-serv8507/t
Modified Files:
01_basic.t
Removed Files:
utils.pl
Log Message:
Prepared for release, small fixes and more robust tests
Index: 01_basic.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Plugin-XMLReport/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 20:32:42 -0000 1.2
--- 01_basic.t 2 Jan 2003 16:52:17 -0000 1.3
***************
*** 1,8 ****
! use lib qw(./blib ./t/lib);
! require 't/utils.pl';
! 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
--- 1,6 ----
! #!/usr/bin/perl -w
! use lib qw(./blib/lib ./t/lib);
! use HTTP::WebTest::SelfTest;
! use Test::More tests => 6;
# 1 - test whether HTTP::WebTest::Plugin::XMLReport can be loaded
***************
*** 10,17 ****
# 2 - test whether HTTP::WebTest is installed
! require_ok 'HTTP::WebTest';
my $WEBTEST = HTTP::WebTest->new;
! my $p1 = new XML::Parser(Style => 'Tree');
# 3 - do some real request
--- 8,19 ----
# 2 - test whether HTTP::WebTest is installed
! require_ok 'HTTP::WebTest'; # Hmm, redundant after using ::SelfTest
!
my $WEBTEST = HTTP::WebTest->new;
! my $deffilter = sub {
! $_[0] =~ s/\s*date="[^"]+"/ date="A_DATESTAMP"/g;
! $_[0] =~ s/\s*url="[^"]+"/ url="A_URL"/g;
! };
# 3 - do some real request
***************
*** 19,30 ****
my $tests = [
{
! test_name => 'xmltest',
! url => 't/in.html',
! text_require => [ 'SEE_ALSO', '</html>' ],
! text_forbid => [ 'Internal Server Error' ],
} ];
! check_webtest(webtest => $WEBTEST,
! tests => $tests,
! opts => { plugins => ['::XMLReport', '::FileRequest'], default_report => 'no' },
check_file => 't/test.out/out.xml');
}
--- 21,35 ----
my $tests = [
{
! test_name => 'xmltest',
! url => 't/in.html',
! text_require => [ 'SEE_ALSO', '</html>', 'This SHOULD fail' ],
! text_forbid => [ 'Internal Server Error' ],
} ];
! my $opts = { plugins => ['::XMLReport', '::FileRequest'],
! default_report => 'no' };
! check_webtest(webtest => $WEBTEST,
! tests => $tests,
! out_filter => $deffilter,
! opts => $opts,
check_file => 't/test.out/out.xml');
}
***************
*** 34,46 ****
my $tests = [
{
! test_name => 'dtd-test',
! url => 't/in.html',
! text_require => [ 'SEE_ALSO', '</html>' ],
! text_forbid => [ 'Internal Server Error' ],
} ];
! check_webtest(webtest => $WEBTEST,
! tests => $tests,
! opts => { plugins => ['::XMLReport', '::FileRequest'],
! xml_report_dtd => 'yes', default_report => 'no' },
check_file => 't/test.out/out-dtd.xml');
}
--- 39,94 ----
my $tests = [
{
! test_name => 'dtd-test',
! url => 't/in.html',
! text_require => [ 'SEE_ALSO', '</html>' ],
! text_forbid => [ 'Internal Server Error' ],
} ];
! my $opts = { plugins => ['::XMLReport', '::FileRequest'],
! xml_report_dtd => 'yes',
! default_report => 'no' };
! check_webtest(webtest => $WEBTEST,
! tests => $tests,
! out_filter => $deffilter,
! opts => $opts,
check_file => 't/test.out/out-dtd.xml');
}
+
+ # 5 - missing wtscript param test_name
+ {
+ my $tests = [
+ {
+ url => 't/in.html',
+ text_require => [ 'SEE_ALSO', '</html>' ],
+ text_forbid => [ 'Internal Server Error' ],
+ } ];
+ my $opts = { plugins => ['::XMLReport', '::FileRequest'],
+ xml_report_dtd => 'yes',
+ default_report => 'no' };
+ check_webtest(webtest => $WEBTEST,
+ tests => $tests,
+ out_filter => $deffilter,
+ opts => $opts,
+ check_file => 't/test.out/out-no-name.xml');
+ }
+
+ # 6 - cooperation with unavailable params (normally used with default report)
+ {
+ my $tests = [
+ {
+ url => 't/in.html',
+ test_name => 'missing-opts',
+ show_headers => 'yes',
+ show_html => 'yes',
+ show_cookies => 'yes',
+ text_forbid => [ 'Internal Server Error' ],
+ } ];
+ my $opts = { plugins => ['::XMLReport', '::FileRequest'],
+ default_report => 'no' };
+ check_webtest(webtest => $WEBTEST,
+ tests => $tests,
+ out_filter => $deffilter,
+ opts => $opts,
+ check_file => 't/test.out/out-missing-opts.xml');
+ }
+
+
--- utils.pl DELETED ---
|