Skip to content
Snippets Groups Projects
Commit fabd5112 authored by Jason Edward Stewart's avatar Jason Edward Stewart
Browse files

new tests for DOMConfig

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@437660 13f79535-47bb-0310-9956-ffa450edef68
parent f0fba46c
No related branches found
No related tags found
No related merge requests found
# 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>mpogue@us.ibm.com</email>
</person>
<person Role="developer">
<name>Tom Watson</name>
<email>rtwatson@us.ibm.com</email>
</person>
<person Role="tech writer">
<name>Susan Hardenbrook</name>
<email>susanhar@us.ibm.com</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();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment