jasons 2002/08/27 12:29:05
Modified: perl/t AttributeList.t Attributes.t DOMCount.t DOMCreate.t
EntityResolver.t Grammar.t LocalFileInputSource.t
MemBufInputSource.t PerlErrorHandler.t SAXParser.t
Schema.t TestUtils.pm XMLScanner.t actualCast.t
domTest.t
Log:
* t/domTest.t (Repository):
* t/actualCast.t (Repository):
DOM_ => DOM
* t/TestUtils.pm (Repository):
* t/Schema.t (Repository):
* t/PerlErrorHandler.t (Repository):
fixed parser name
* t/MemBufInputSource.t (Repository):
added tests to check that the returned input source provides the
proper information after a parse
* t/EntityResolver.t (Repository):
Fixed class name for parser
Fixed evals
* t/SAXParser.t (Repository):
* t/DOMCount.t (Repository):
* t/Attributes.t (Repository):
* t/AttributeList.t (Repository):
* t/XMLScanner.t (Repository):
fixed UTF-8 encoding
added eval's
* t/Grammar.t (Repository):
* t/DOMCreate.t (Repository):
name typo
Revision Changes Path
1.3 +7 -5 xml-xerces/perl/t/AttributeList.t
Index: AttributeList.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/AttributeList.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AttributeList.t 12 Oct 2001 04:16:15 -0000 1.2
+++ AttributeList.t 27 Aug 2002 19:29:04 -0000 1.3
@@ -10,7 +10,7 @@
BEGIN { $| = 1; print "1..8\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
-# use blib;
+use blib;
use XML::Xerces;
use Config;
@@ -52,9 +52,9 @@
my $local = 'Rank';
my $ns = 'Scout';
my $value = 'eagle scout';
-my $document = qq[<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+my $document = qq[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bar>
- <foo xmlns:Scout="$url"
+ <foo xmlns:$ns="$url"
Role="manager" $ns:$local="$value">
</foo>
</bar>];
@@ -68,7 +68,9 @@
# test getLength
my $is = XML::Xerces::MemBufInputSource->new($document);
$DOCUMENT_HANDLER->{test} = '';
-$SAX->parse($is);
+eval {$SAX->parse($is)};
+XML::Xerces::error($@) if $@;
+
result($DOCUMENT_HANDLER->{test} == 3);
$DOCUMENT_HANDLER->{test} = '';
@@ -123,7 +125,7 @@
&& keys %{$hash_ref} == 3
&& $hash_ref->{"$ns:$local"} eq $value);
-$document = qq[<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+$document = qq[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE bar SYSTEM "foo.dtd" [
<!ELEMENT bar (foo)>
<!ELEMENT foo EMPTY>
1.5 +3 -3 xml-xerces/perl/t/Attributes.t
Index: Attributes.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/Attributes.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Attributes.t 24 Mar 2002 23:07:25 -0000 1.4
+++ Attributes.t 27 Aug 2002 19:29:04 -0000 1.5
@@ -10,7 +10,7 @@
BEGIN { $| = 1; print "1..14\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
-# use blib;
+use blib;
use XML::Xerces;
use Config;
@@ -52,7 +52,7 @@
my $local = 'Rank';
my $ns = 'Scout';
my $value = 'eagle scout';
-my $document = qq[<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+my $document = qq[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bar>
<foo xmlns:Scout="$url"
Role="manager" $ns:$local="$value">
@@ -169,7 +169,7 @@
&& $hash_ref->{"$ns:$local"}{URI} eq $url
);
-$document = qq[<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+$document = qq[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE bar SYSTEM "foo.dtd" [
<!ELEMENT bar (foo)>
<!ELEMENT foo EMPTY>
1.7 +1 -1 xml-xerces/perl/t/DOMCount.t
Index: DOMCount.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/DOMCount.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMCount.t 24 Mar 2002 23:06:46 -0000 1.6
+++ DOMCount.t 27 Aug 2002 19:29:04 -0000 1.7
@@ -29,7 +29,7 @@
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
-my $document = q[<?xml version="1.0" encoding="utf-8"?>
+my $document = q[<?xml version="1.0" encoding="UTF-8"?>
<contributors>
<person Role="manager">
<name>Mike Pogue</name>
1.8 +1 -1 xml-xerces/perl/t/DOMCreate.t
Index: DOMCreate.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/DOMCreate.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DOMCreate.t 24 Mar 2002 23:06:46 -0000 1.7
+++ DOMCreate.t 27 Aug 2002 19:29:04 -0000 1.8
@@ -1,6 +1,6 @@
# Before `make install' is performed this script should be runnable
# with `make test'. After `make install' it should work as `perl
-# DOM_NamedNodeMap.t'
+# DOMCreate.t'
######################### We start with some black magic to print on failure.
1.6 +20 -16 xml-xerces/perl/t/EntityResolver.t
Index: EntityResolver.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/EntityResolver.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- EntityResolver.t 3 Nov 2001 05:29:51 -0000 1.5
+++ EntityResolver.t 27 Aug 2002 19:29:04 -0000 1.6
@@ -49,15 +49,21 @@
sub resolve_entity {
my ($self,$pub,$sys) = @_;
-# print STDERR "Got PUBLIC: $pub\n";
-# print STDERR "Got SYSTEM: $sys\n";
+# print STDERR "Got PUBLIC: $pub\n";
+# print STDERR "Got SYSTEM: $sys\n";
$main::test = 1;
# we parse the example XML Catalog
- my $DOM = XML::Xerces::DOMParser->new();
+ my $DOM = XML::Xerces::XercesDOMParser->new();
my $ERROR_HANDLER = XML::Xerces::PerlErrorHandler->new();
$DOM->setErrorHandler($ERROR_HANDLER);
- $DOM->parse(XML::Xerces::LocalFileInputSource->new($CATALOG));
+ eval{$DOM->parse($CATALOG)};
+ if ($@) {
+ my $msg = "Resolver: Couldn't parse catalog:";
+ $@ = $@->getMessage()
+ if ref $@;
+ print STDERR "$msg $@\n";
+ }
# now retrieve the mappings
my $doc = $DOM->getDocument();
@@ -77,21 +83,19 @@
} else {
croak("Neither PublicId or SystemId were defined");
}
- my $is;
- eval {
- $is = XML::Xerces::LocalFileInputSource->new($href);
- };
+ my $is = eval {XML::Xerces::LocalFileInputSource->new($href)};
if ($@) {
- print STDERR "Resolver: ", $@->getMessage(), "\n"
+ my $msg = "Resolver: Couldn't create input source for entity:";
+ $@ = $@->getMessage()
if ref $@;
- print STDERR "Resolver: $@\n";
+ print STDERR "$msg $@\n";
}
return $is;
}
package main;
$test = 0;
-my $DOM = XML::Xerces::DOMParser->new();
+my $DOM = XML::Xerces::XercesDOMParser->new();
my $ERROR_HANDLER = XML::Xerces::PerlErrorHandler->new();
$DOM->setErrorHandler($ERROR_HANDLER);
@@ -120,11 +124,11 @@
if ref $@;
print STDERR $@;
}
-result(ref $doc && $doc->isa('XML::Xerces::DOM_Document'));
+result(ref $doc && $doc->isa('XML::Xerces::DOMDocument'));
my $root = $doc->getDocumentElement();
result(ref $root &&
- $root->isa('XML::Xerces::DOM_Element') &&
+ $root->isa('XML::Xerces::DOMElement') &&
$root->getNodeName() eq 'personnel'
);
@@ -141,11 +145,11 @@
result($test);
$doc = $DOM->getDocument();
-result(ref $doc && $doc->isa('XML::Xerces::DOM_Document'));
+result(ref $doc && $doc->isa('XML::Xerces::DOMDocument'));
$root = $doc->getDocumentElement();
result(ref $root &&
- $root->isa('XML::Xerces::DOM_Element') &&
+ $root->isa('XML::Xerces::DOMElement') &&
$root->getNodeName() eq 'personnel'
);
@@ -196,7 +200,7 @@
$DOM->reset();
$DOM->setDoSchema(1);
$DOM->setDoNamespaces(1);
-# $DOM->setValidationScheme($XML::Xerces::DOMParser::Val_Always);
+# $DOM->setValidationScheme($XML::Xerces::AbstractDOMParser::Val_Always);
eval {
$DOM->parse(XML::Xerces::MemBufInputSource->new($document));
};
1.2 +1 -1 xml-xerces/perl/t/Grammar.t
Index: Grammar.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/Grammar.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Grammar.t 21 Feb 2002 03:28:52 -0000 1.1
+++ Grammar.t 27 Aug 2002 19:29:04 -0000 1.2
@@ -1,6 +1,6 @@
# Before `make install' is performed this script should be runnable
# with `make test'. After `make install' it should work as `perl
-# DOM_Attr.t'
+# Grammar.t'
######################### We start with some black magic to print on failure.
1.11 +21 -11 xml-xerces/perl/t/LocalFileInputSource.t
Index: LocalFileInputSource.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/LocalFileInputSource.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LocalFileInputSource.t 25 Mar 2002 00:41:03 -0000 1.10
+++ LocalFileInputSource.t 27 Aug 2002 19:29:04 -0000 1.11
@@ -7,15 +7,15 @@
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
-BEGIN { $| = 1; print "1..5\n"; }
+BEGIN { $| = 1; print "1..7\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
-# use blib;
+use blib;
use XML::Xerces;
use Cwd;
use lib 't';
-use TestUtils qw(result is_object $DOM $PERSONAL_FILE_NAME $SAMPLE_DIR);
+use TestUtils qw(result is_object $DOM $PERSONAL_NO_DOCTYPE_FILE_NAME $SAMPLE_DIR
$PERSONAL_NO_DOCTYPE);
use vars qw($i $loaded $error);
use strict;
@@ -29,27 +29,37 @@
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
-my $is = XML::Xerces::LocalFileInputSource->new($PERSONAL_FILE_NAME);
+my $is =
eval{XML::Xerces::LocalFileInputSource->new($PERSONAL_NO_DOCTYPE_FILE_NAME)};
+XML::Xerces::error($@) if $@;
result(is_object($is)
&& $is->isa('XML::Xerces::InputSource')
&& $is->isa('XML::Xerces::LocalFileInputSource')
);
# test that a bogus relative path causes an exception
-eval {
- $is = XML::Xerces::LocalFileInputSource->new('../foo/bar.xml');
-};
+$is = eval {XML::Xerces::LocalFileInputSource->new('../foo/bar.xml')};
my $error = $@;
result($error &&
is_object($error) &&
$error->isa('XML::Xerces::XMLException'));
# test that relative paths work
-$is = XML::Xerces::LocalFileInputSource->new("$SAMPLE_DIR/personal.xml");
-result(is_object($is) && $is->isa('XML::Xerces::LocalFileInputSource'));
+$is = eval{XML::Xerces::LocalFileInputSource->new($PERSONAL_NO_DOCTYPE_FILE_NAME)};
+XML::Xerces::error($@) if $@;
+result(is_object($is)
+ && $is->isa('XML::Xerces::LocalFileInputSource'));
+
+eval{$DOM->parse($is)};
+XML::Xerces::error($@) if $@;
+my $serialize = $DOM->getDocument->serialize;
+result($serialize eq $PERSONAL_NO_DOCTYPE);
# test the overloaded constructor
-# this currently segfaults
my $cwd = cwd();
-# $is = XML::Xerces::LocalFileInputSource->new($cwd, "$SAMPLE_DIR/personal.xml");
+$is = XML::Xerces::LocalFileInputSource->new($cwd,
"$SAMPLE_DIR/personal-no-doctype.xml");
result(is_object($is) && $is->isa('XML::Xerces::LocalFileInputSource'));
+
+eval{$DOM->parse($is)};
+XML::Xerces::error($@) if $@;
+$serialize = $DOM->getDocument->serialize;
+result($serialize eq $PERSONAL_NO_DOCTYPE);
1.8 +7 -4 xml-xerces/perl/t/MemBufInputSource.t
Index: MemBufInputSource.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/MemBufInputSource.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MemBufInputSource.t 6 Oct 2001 23:54:47 -0000 1.7
+++ MemBufInputSource.t 27 Aug 2002 19:29:04 -0000 1.8
@@ -10,7 +10,7 @@
BEGIN { $| = 1; print "1..4\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
-# use blib;
+use blib;
use XML::Xerces;
use lib 't';
@@ -27,16 +27,19 @@
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
-my $is = XML::Xerces::MemBufInputSource->new($PERSONAL_NO_DOCTYPE, 'foo');
+my $is = eval{XML::Xerces::MemBufInputSource->new($PERSONAL_NO_DOCTYPE,'foo')};
+XML::Xerces::error($@) if $@;
result(is_object($is)
&& $is->isa('XML::Xerces::InputSource')
&& $is->isa('XML::Xerces::MemBufInputSource')
);
-$DOM->parse($is);
+eval {$DOM->parse($is)};
+XML::Xerces::error($@) if $@;
my $serialize = $DOM->getDocument->serialize;
result($serialize eq $PERSONAL_NO_DOCTYPE);
# now test that the fake system ID is optional
-$is = XML::Xerces::MemBufInputSource->new($PERSONAL_NO_DOCTYPE);
+$is = eval{XML::Xerces::MemBufInputSource->new($PERSONAL_NO_DOCTYPE)};
+XML::Xerces::error($@) if $@;
result($is->getSystemId() eq 'FAKE_SYSTEM_ID');
1.9 +5 -5 xml-xerces/perl/t/PerlErrorHandler.t
Index: PerlErrorHandler.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/PerlErrorHandler.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- PerlErrorHandler.t 25 Apr 2002 04:04:43 -0000 1.8
+++ PerlErrorHandler.t 27 Aug 2002 19:29:04 -0000 1.9
@@ -123,7 +123,7 @@
{
$error = "";
- my $dom = XML::Xerces::DOMParser->new();
+ my $dom = XML::Xerces::XercesDOMParser->new();
my $error_handler = MyErrorHandler->new();
$dom->setErrorHandler($error_handler);
@@ -145,12 +145,12 @@
{
$error = "";
- my $dom = XML::Xerces::DOMParser->new();
+ my $dom = XML::Xerces::XercesDOMParser->new();
my $error_handler = MyErrorHandler->new();
$dom->setErrorHandler($error_handler);
- $dom->setValidationScheme($XML::Xerces::DOMParser::Val_Always);
+ $dom->setValidationScheme($XML::Xerces::AbstractDOMParser::Val_Always);
eval {
$dom->parse(XML::Xerces::MemBufInputSource->new($document, 'foo') );
};
@@ -168,7 +168,7 @@
{
$error = "";
- my $dom = XML::Xerces::DOMParser->new();
+ my $dom = XML::Xerces::XercesDOMParser->new();
my $error_handler = MyErrorHandler->new();
my $error_handler2 = MyErrorHandler->new();
@@ -178,7 +178,7 @@
$tmp = $dom->setErrorHandler($error_handler2);
result(defined $tmp, my $fail=1);
- $dom->setValidationScheme($XML::Xerces::DOMParser::Val_Always);
+ $dom->setValidationScheme($XML::Xerces::AbstractDOMParser::Val_Always);
eval {
$dom->parse(XML::Xerces::MemBufInputSource->new($document, 'foo') );
};
1.7 +1 -1 xml-xerces/perl/t/SAXParser.t
Index: SAXParser.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/SAXParser.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SAXParser.t 10 Oct 2001 19:49:46 -0000 1.6
+++ SAXParser.t 27 Aug 2002 19:29:04 -0000 1.7
@@ -29,7 +29,7 @@
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
-my $document = q[<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+my $document = q[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contributors>
<person Role="manager">
<name>Mike Pogue</name>
1.5 +1 -1 xml-xerces/perl/t/Schema.t
Index: Schema.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/Schema.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Schema.t 21 Feb 2002 03:06:25 -0000 1.4
+++ Schema.t 27 Aug 2002 19:29:04 -0000 1.5
@@ -28,7 +28,7 @@
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
-my $dom = XML::Xerces::DOMParser->new();
+my $dom = XML::Xerces::XercesDOMParser->new();
my $handler = XML::Xerces::PerlErrorHandler->new();
$dom->setDoSchema(1);
$dom->setDoNamespaces(1);
1.18 +1 -1 xml-xerces/perl/t/TestUtils.pm
Index: TestUtils.pm
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/TestUtils.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TestUtils.pm 25 Apr 2002 01:52:41 -0000 1.17
+++ TestUtils.pm 27 Aug 2002 19:29:04 -0000 1.18
@@ -48,7 +48,7 @@
# turn off annoying warnings
$SIG{__WARN__} = 'IGNORE';
- $DOM = new XML::Xerces::DOMParser;
+ $DOM = XML::Xerces::XercesDOMParser->new();
my $ERROR_HANDLER = XML::Xerces::PerlErrorHandler->new();
$DOM->setErrorHandler($ERROR_HANDLER);
1.2 +1 -1 xml-xerces/perl/t/XMLScanner.t
Index: XMLScanner.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/XMLScanner.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLScanner.t 25 Apr 2002 01:43:35 -0000 1.1
+++ XMLScanner.t 27 Aug 2002 19:29:04 -0000 1.2
@@ -28,7 +28,7 @@
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
-my $document = q[<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+my $document = q[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contributors>
<person Role="manager">
<name>Mike Pogue</name>
1.7 +3 -3 xml-xerces/perl/t/actualCast.t
Index: actualCast.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/actualCast.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- actualCast.t 13 Apr 2001 22:25:45 -0000 1.6
+++ actualCast.t 27 Aug 2002 19:29:04 -0000 1.7
@@ -29,9 +29,9 @@
$DOM->parse( new XML::Xerces::LocalFileInputSource($PERSONAL_FILE_NAME) );
-# test that we get a subclass of DOM_Node back
+# test that we get a subclass of DOMNode back
my $name = $DOM->getDocument->getElementsByTagName('link')->item(0);
-result(ref($name) && $name->isa('XML::Xerces::DOM_Node'));
+result(ref($name) && $name->isa('XML::Xerces::DOMNode'));
# test that it really is a subclass
-result(ref($name) ne 'XML::Xerces::DOM_Node');
+result(ref($name) ne 'XML::Xerces::DOMNode');
1.9 +1 -1 xml-xerces/perl/t/domTest.t
Index: domTest.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/domTest.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- domTest.t 24 Mar 2002 23:06:46 -0000 1.8
+++ domTest.t 27 Aug 2002 19:29:04 -0000 1.9
@@ -40,7 +40,7 @@
sub create_doc {
- my $impl = XML::Xerces::DOM_DOMImplementation::getImplementation();
+ my $impl = XML::Xerces::DOMImplementation::getImplementation();
my $dt = eval{$impl->createDocumentType('personnel', '', 'personal.dtd')};
error($@) if $@;
my $doc = eval{$impl->createDocument('personnel', 'personnel',$dt)};
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]