Author: jasons
Date: Mon Aug 28 04:15:42 2006
New Revision: 437660
URL: http://svn.apache.org/viewvc?rev=437660&view=rev
Log:
new tests for DOMConfig
Added:
xerces/c/trunk/swig/perl/t/DOMConfig.t
Added: xerces/c/trunk/swig/perl/t/DOMConfig.t
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMConfig.t?rev=437660&view=auto
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMConfig.t (added)
+++ xerces/c/trunk/swig/perl/t/DOMConfig.t Mon Aug 28 04:15:42 2006
@@ -0,0 +1,65 @@
+# Before `make install' is performed this script should be runnable
+# with `make test'. After `make install' it should work as `perl
+# DOMConfig.t'
+
+######################### Begin module loading
+
+# use blib;
+use Test::More tests => 20;
+
+BEGIN{use_ok('XML::Xerces')};
+
+use lib 't';
+use TestUtils qw($PERSONAL_FILE_NAME);
+use vars qw($error);
+use strict;
+
+######################### Begin Test
+
+my $document = q[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<contributors>
+ <person Role="manager">
+ <name>Mike Pogue</name>
+ <email>[EMAIL PROTECTED]</email>
+ </person>
+ <person Role="developer">
+ <name>Tom Watson</name>
+ <email>[EMAIL PROTECTED]</email>
+ </person>
+ <person Role="tech writer">
+ <name>Susan Hardenbrook</name>
+ <email>[EMAIL PROTECTED]</email>
+ </person>
+</contributors>];
+
+my $impl = XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');
+my $DOM =
$impl->createLSParser($XML::Xerces::DOMImplementationLS::MODE_SYNCHRONOUS,'');
+my $conf = $DOM->getDomConfig();
+isa_ok($conf, 'XML::Xerces::DOMConfiguration');
+
+my @param_names = ($XML::Xerces::XMLUni::fgDOMErrorHandler,
+ $XML::Xerces::XMLUni::fgDOMSchemaType,
+ $XML::Xerces::XMLUni::fgDOMSchemaLocation,
+ $XML::Xerces::XMLUni::fgDOMCanonicalForm,
+ $XML::Xerces::XMLUni::fgDOMCDATASections,
+ $XML::Xerces::XMLUni::fgDOMComments,
+ $XML::Xerces::XMLUni::fgDOMDatatypeNormalization,
+ $XML::Xerces::XMLUni::fgDOMWRTDiscardDefaultContent,
+ $XML::Xerces::XMLUni::fgDOMEntities,
+ $XML::Xerces::XMLUni::fgDOMInfoset,
+ $XML::Xerces::XMLUni::fgDOMNamespaces,
+ $XML::Xerces::XMLUni::fgDOMNamespaceDeclarations,
+ $XML::Xerces::XMLUni::fgDOMNormalizeCharacters,
+ $XML::Xerces::XMLUni::fgDOMSplitCDATASections,
+ $XML::Xerces::XMLUni::fgDOMValidate,
+ $XML::Xerces::XMLUni::fgDOMValidateIfSchema,
+ $XML::Xerces::XMLUni::fgDOMElementContentWhitespace);
+
+my @accepted_param_names = $conf->getParameterNames();
+ok(scalar @accepted_param_names, "got parameter name list");
+
+my %param_names = map {$_=>1} @param_names;
+foreach my $param_name (@param_names) {
+ ok(exists $param_names{$param_name}, "can set $param_name");
+}
+my $handler = XML::Xerces::PerlErrorHandler->new();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]