You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/07/10 01:12:26 UTC
cvs commit: xml-xerces/perl/t IDOM_DOMException.t
jasons 01/07/09 16:12:26
Modified: perl/t IDOM_DOMException.t
Log:
* t/IDOM_DOMException.t (Repository):
Fixed all tests to not use any method that needed a string as an
input parameter
Revision Changes Path
1.3 +10 -10 xml-xerces/perl/t/IDOM_DOMException.t
Index: IDOM_DOMException.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/IDOM_DOMException.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IDOM_DOMException.t 2001/07/09 15:27:56 1.2
+++ IDOM_DOMException.t 2001/07/09 23:12:23 1.3
@@ -7,11 +7,11 @@
# 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..7\n"; }
+BEGIN { $| = 1; print "1..6\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
-# use blib;
+use blib;
use XML::Xerces;
use Config;
@@ -33,7 +33,7 @@
# test that we get an IDOM_DOMException trying to reuse a DocType
$error = 0;
my $handler = XML::Xerces::PerlExceptionHandler::getInstance();
-$handler->setDOMExceptionHandler(sub{
+$handler->setIDOMExceptionHandler(sub{
my $exception = shift;
$code = $exception->{code};
$error = 1;
@@ -85,11 +85,11 @@
my $doc2 = $DOM2->getDocument();
my $root1 = $doc1->getDocumentElement();
-my @persons1 = $doc1->getElementsByTagName('person');
-my @names1 = $doc1->getElementsByTagName('name');
+my @persons1 = $root1->getChildNodes();
+my $name1 = ($persons1[1]->getChildNodes())[1];
my $root2 = $doc2->getDocumentElement();
-my @persons2 = $doc2->getElementsByTagName('person');
-my @names2 = $doc1->getElementsByTagName('name');
+my @persons2 = $root2->getChildNodes();
+my $name2 = ($persons2[1]->getChildNodes())[1];
# Trying to append to a IDOM_Document node gives a hierarchy error
eval {
@@ -115,7 +115,7 @@
# Trying to insert to a different IDOM_Document gives a wrong doc error
eval {
- $persons1[0]->insertBefore($persons2[0],$persons1[0]);
+ $persons1[1]->insertBefore($persons2[1],$persons1[1]);
};
result($@ &&
$error &&
@@ -126,7 +126,7 @@
# Trying to insert to a IDOM_Document node gives a wrong doc error
eval {
- $doc1->insertBefore($persons2[0],$root1);
+ $doc1->insertBefore($persons2[1],$root1);
};
result($@ &&
@@ -139,7 +139,7 @@
# Trying to insert before a node that is not a subnode of the calling node
# gives a not found error
eval {
- $persons1[0]->insertBefore($persons1[1],$names1[2]);
+ $persons1[1]->insertBefore($name1,$persons1[3]);
};
result($@ &&
$error &&
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org