Author: jasons
Date: Fri Oct 13 14:16:19 2006
New Revision: 463834

URL: http://svn.apache.org/viewvc?view=rev&rev=463834
Log:
updated tests

Added:
    xerces/c/trunk/swig/perl/t/DOMLSParser.t
      - copied, changed from r442160, xerces/c/trunk/swig/perl/t/DOMBuilder.t
Removed:
    xerces/c/trunk/swig/perl/t/DOMBuilder.t
    xerces/c/trunk/swig/perl/t/DOMWriter.t
Modified:
    xerces/c/trunk/swig/perl/t/00basic.t
    xerces/c/trunk/swig/perl/t/01utf8.t
    xerces/c/trunk/swig/perl/t/AttributeList.t
    xerces/c/trunk/swig/perl/t/Attributes.t
    xerces/c/trunk/swig/perl/t/DOMConfig.t
    xerces/c/trunk/swig/perl/t/DOMDocument.t
    xerces/c/trunk/swig/perl/t/DOMElement.t
    xerces/c/trunk/swig/perl/t/DOMImplementation.t
    xerces/c/trunk/swig/perl/t/DOMParser.t
    xerces/c/trunk/swig/perl/t/DOMStringList.t
    xerces/c/trunk/swig/perl/t/Grammar.t
    xerces/c/trunk/swig/perl/t/SAX2Count.t
    xerces/c/trunk/swig/perl/t/SAX2XMLReader.t
    xerces/c/trunk/swig/perl/t/SAXCount.t
    xerces/c/trunk/swig/perl/t/SAXException.t
    xerces/c/trunk/swig/perl/t/SAXParser.t
    xerces/c/trunk/swig/perl/t/TestUtils.pm
    xerces/c/trunk/swig/perl/t/URLInputSource.t
    xerces/c/trunk/swig/perl/t/XMLUni.t
    xerces/c/trunk/swig/perl/t/actualCast.t

Modified: xerces/c/trunk/swig/perl/t/00basic.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/00basic.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/00basic.t (original)
+++ xerces/c/trunk/swig/perl/t/00basic.t Fri Oct 13 14:16:19 2006
@@ -1,13 +1,22 @@
+# Before `make install' is performed this script should be runnable
+# with `make test'. After `make install' it should work as `perl
+# 00basic.t'
+
+######################### Begin module loading
+
 # use blib;
-use XML::Xerces;
-use Cwd;
-use Test::More tests => 19;
+
+use Test::More tests => 20;
+BEGIN { use_ok(XML::Xerces::DOM) };
+
 use lib 't';
-use TestUtils qw(
-                $SYSTEM_RESOLVER_FILE_NAME
+use TestUtils qw($SYSTEM_RESOLVER_FILE_NAME $SAMPLE_DIR
+                $PERSONAL_FILE_NAME
+                $PERSONAL_INVALID_FILE_NAME
+                $PERSONAL_NOT_WELL_FORMED_FILE_NAME
                );
 
-pass("loaded");
+######################### Begin Test
 
   # NOTICE: We must now explicitly call XMLPlatformUtils::Initialize()
   #   when the module is loaded. Xerces.pm no longer does this.
@@ -25,12 +34,10 @@
 my $tmp = $parser->getErrorHandler();
 isa_ok($tmp,'XML::Xerces::ErrorHandler');
 
-my $cwd = cwd();
-$cwd =~ s|/t/?$||;
-my $SAMPLE_DIR = "$cwd/samples";
-my $PERSONAL_FILE_NAME = "$SAMPLE_DIR/personal.xml";
-my $PERSONAL_INVALID_FILE_NAME = "$SAMPLE_DIR/personal-invalid.xml";
-my $PERSONAL_NOT_WELL_FORMED_FILE_NAME = 
"$SAMPLE_DIR/personal-not-well-formed.xml";
+my $resolver = XML::Xerces::PerlEntityResolver->new();
+$parser->setEntityResolver($resolver);
+$tmp = $parser->getEntityResolver();
+isa_ok($tmp,'XML::Xerces::EntityResolver');
 
 $parser->setValidationScheme($XML::Xerces::AbstractDOMParser::Val_Never);
 $tmp = $parser->getValidationScheme();

Modified: xerces/c/trunk/swig/perl/t/01utf8.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/01utf8.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/01utf8.t (original)
+++ xerces/c/trunk/swig/perl/t/01utf8.t Fri Oct 13 14:16:19 2006
@@ -12,7 +12,7 @@
 use lib 't';
 use TestUtils qw($PERSONAL_NO_DOCTYPE);
 
-BEGIN { use_ok("XML::Xerces") };
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use strict;
 

Modified: xerces/c/trunk/swig/perl/t/AttributeList.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/AttributeList.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/AttributeList.t (original)
+++ xerces/c/trunk/swig/perl/t/AttributeList.t Fri Oct 13 14:16:19 2006
@@ -2,25 +2,17 @@
 # with `make test'. After `make install' it should work as `perl
 # AttributeList.t'
 
-######################### We start with some black magic to print on failure.
+######################### Begin module loading
 
-END {fail() unless $loaded;}
-
-use Carp;
-use blib;
-use XML::Xerces;
+#use blib;
 use Test::More tests => 11;
-use Config;
+BEGIN {use_ok("XML::Xerces::SAX")};
 
 use lib 't';
 use TestUtils qw($PERSONAL_FILE_NAME);
-use vars qw($loaded);
 use strict;
 
-$loaded = 1;
-pass("module loaded");
-
-######################### End of black magic.
+######################### Begin test
 
   # NOTICE: We must now explicitly call XMLPlatformUtils::Initialize()
   #   when the module is loaded. Xerces.pm no longer does this.

Modified: xerces/c/trunk/swig/perl/t/Attributes.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/Attributes.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/Attributes.t (original)
+++ xerces/c/trunk/swig/perl/t/Attributes.t Fri Oct 13 14:16:19 2006
@@ -6,7 +6,7 @@
 
 # use blib;
 use Test::More tests => 19;
-BEGIN { use_ok("XML::Xerces") };
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use strict;
 

Modified: xerces/c/trunk/swig/perl/t/DOMConfig.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMConfig.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMConfig.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMConfig.t Fri Oct 13 14:16:19 2006
@@ -4,8 +4,8 @@
 
 ######################### Begin module loading
 
-# use blib;
-use Test::More tests => 20;
+use blib;
+use Test::More tests => 106;
 
 BEGIN{use_ok('XML::Xerces::DOM')};
 
@@ -16,6 +16,12 @@
 
 ######################### Begin Test
 
+  # NOTICE: We must now explicitly call XMLPlatformUtils::Initialize()
+  #   when the module is loaded. Xerces.pm no longer does this.
+  #
+  #
+XML::Xerces::XMLPlatformUtils::Initialize();
+
 my $document = q[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <contributors>
   <person Role="manager">
@@ -37,29 +43,165 @@
 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 @other_param_names = ($XML::Xerces::XMLUni::fgDOMErrorHandler,
+                        $XML::Xerces::XMLUni::fgXercesEntityResolver,
+                        $XML::Xerces::XMLUni::fgDOMResourceResolver,
+                        $XML::Xerces::XMLUni::fgXercesSecurityManager,
+                        $XML::Xerces::XMLUni::fgXercesScannerName,
+                        
$XML::Xerces::XMLUni::fgXercesSchemaExternalSchemaLocation,
+                        
$XML::Xerces::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation,
+                        
$XML::Xerces::XMLUni::fgXercesParserUseDocumentFromImplementation,
+                       );
+
+my @false_bool_param_names = (
+                     $XML::Xerces::XMLUni::fgDOMSupportedMediatypesOnly,
+);
+
+my @true_bool_param_names = (
+                     $XML::Xerces::XMLUni::fgDOMNamespaceDeclarations,
+                     $XML::Xerces::XMLUni::fgDOMWellFormed,
+                     $XML::Xerces::XMLUni::fgDOMInfoset,
+                     $XML::Xerces::XMLUni::fgDOMCharsetOverridesXMLEncoding,
+                     $XML::Xerces::XMLUni::fgDOMNamespaces,
+                     $XML::Xerces::XMLUni::fgDOMValidate,
+                     $XML::Xerces::XMLUni::fgDOMValidateIfSchema,
+                     $XML::Xerces::XMLUni::fgDOMComments,
+                     $XML::Xerces::XMLUni::fgDOMDatatypeNormalization,
+                     $XML::Xerces::XMLUni::fgDOMElementContentWhitespace,
+                     $XML::Xerces::XMLUni::fgDOMEntities,
+                     $XML::Xerces::XMLUni::fgXercesSchema,
+                     $XML::Xerces::XMLUni::fgXercesSchemaFullChecking,
+                     $XML::Xerces::XMLUni::fgXercesUserAdoptsDOMDocument,
+                     $XML::Xerces::XMLUni::fgXercesLoadExternalDTD,
+                     $XML::Xerces::XMLUni::fgXercesContinueAfterFatalError,
+                     $XML::Xerces::XMLUni::fgXercesValidationErrorAsFatal,
+                     $XML::Xerces::XMLUni::fgXercesCacheGrammarFromParse,
+                     $XML::Xerces::XMLUni::fgXercesUseCachedGrammarInParse,
+                     $XML::Xerces::XMLUni::fgXercesCalculateSrcOfs,
+                     $XML::Xerces::XMLUni::fgXercesStandardUriConformant,
+                     $XML::Xerces::XMLUni::fgXercesDOMHasPSVIInfo,
+                     
$XML::Xerces::XMLUni::fgXercesGenerateSyntheticAnnotations,
+                     $XML::Xerces::XMLUni::fgXercesValidateAnnotations,
+                     $XML::Xerces::XMLUni::fgXercesIdentityConstraintChecking,
+                     $XML::Xerces::XMLUni::fgXercesIgnoreCachedDTD,
+                     $XML::Xerces::XMLUni::fgXercesIgnoreAnnotations,
+                     
$XML::Xerces::XMLUni::fgXercesDisableDefaultEntityResolution,
+                     $XML::Xerces::XMLUni::fgXercesSkipDTDValidation);
+
+my @todo_param_names = ($XML::Xerces::XMLUni::fgDOMSchemaLocation,
+                       $XML::Xerces::XMLUni::fgDOMSchemaType,
+                       $XML::Xerces::XMLUni::fgDOMDisallowDoctype,
+                       $XML::Xerces::XMLUni::fgDOMCanonicalForm,
+                       
$XML::Xerces::XMLUni::fgDOMIgnoreUnknownCharacterDenormalization,
+                       $XML::Xerces::XMLUni::fgDOMCDATASections,
+                       $XML::Xerces::XMLUni::fgDOMCheckCharacterNormalization,
+                       $XML::Xerces::XMLUni::fgDOMNormalizeCharacters,
+                       $XML::Xerces::XMLUni::fgDOMSplitCDATASections,
+                      );
+
+my @bool_param_names = (@true_bool_param_names, @false_bool_param_names);
+
+my @ls_param_names = (@bool_param_names, @other_param_names, 
@todo_param_names);
 
 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 %accepted_param_names = map {$_=>1} @accepted_param_names;
+foreach my $param_name (@ls_param_names) {
+  ok(exists $accepted_param_names{$param_name}, "$param_name in param list");
+}
+
+# test bool value
+foreach my $param_name (@true_bool_param_names) {
+  ok($conf->canSetParameter($param_name, 1),
+     "setting bool value: $param_name");
+}
+
+foreach my $param_name (@false_bool_param_names) {
+  ok($conf->canSetParameter($param_name, 0),
+     "setting bool value: $param_name");
+}
+
+TODO: {
+  local $TODO = "unimplemented params";
+
+  foreach my $param_name (@todo_param_names) {
+    ok($conf->canSetParameter($param_name, 0),
+       "todo param: $param_name");
+  }
+}
+
+#
+# test setting object values
+#
+my $handler;
+
+$handler = XML::Xerces::PerlErrorHandler->new();
+ok($conf->canSetParameter($XML::Xerces::XMLUni::fgDOMErrorHandler, undef),
+   'can set error handler');
+
+eval {XML::Xercesc::DOMConfiguration_canSetParameter($conf, 
$XML::Xerces::XMLUni::fgXercesEntityResolver, $handler)};
+ok($@,
+   'can set with bad value causes exception');
+
+$handler = XML::Xerces::PerlEntityResolver->new();
+ok($conf->canSetParameter($XML::Xerces::XMLUni::fgXercesEntityResolver, undef),
+   'can set entity resolver');
+
+eval {$conf->setParameter($XML::Xerces::XMLUni::fgDGXMLScanner, $handler)};
+ok($@,
+   'setParameter with bad value causes exception');
+isa_ok($@, "XML::Xerces::DOMException");
+
+$handler = XML::Xerces::PerlDOMErrorHandler->new();
+isa_ok($handler, "XML::Xerces::DOMErrorHandler",
+       'error handler to set');
+eval {$conf->setParameter($XML::Xerces::XMLUni::fgDOMErrorHandler, $handler)};
+ok((not $@),
+   'setting error handler')
+  or XML::Xerces::error($@);
+
+isa_ok($conf->getParameter($XML::Xerces::XMLUni::fgDOMErrorHandler), 
"XML::Xerces::DOMErrorHandler",
+      'getParameter');
+
+eval {$conf->setParameter($XML::Xerces::XMLUni::fgDOMErrorHandler, undef)};
+ok((not $@),
+   'setting null error handler')
+  or XML::Xerces::error($@);
+
+ok((not defined $conf->getParameter($XML::Xerces::XMLUni::fgDOMErrorHandler)),
+   'getting null error handler');
+
+$handler = XML::Xerces::PerlEntityResolver->new();
+isa_ok($handler, "XML::Xerces::XMLEntityResolver",
+       'handler to set');
+eval {$conf->setParameter($XML::Xerces::XMLUni::fgXercesEntityResolver, 
$handler)};
+ok((not $@),
+   'setting XMLEntityResolver')
+  or XML::Xerces::error($@);
+
+isa_ok($conf->getParameter($XML::Xerces::XMLUni::fgXercesEntityResolver), 
"XML::Xerces::XMLEntityResolver",
+      'getParameter');
+
+eval {$conf->setParameter($XML::Xerces::XMLUni::fgXercesEntityResolver, 
undef)};
+ok((not $@),
+   'setting null XMLEntityResolver')
+  or XML::Xerces::error($@);
+
+ok((not defined 
$conf->getParameter($XML::Xerces::XMLUni::fgXercesEntityResolver)),
+   'getting null XMLEntityResolver');
+
+eval {$conf->setParameter($XML::Xerces::XMLUni::fgDOMResourceResolver, 
$handler)};
+ok((not $@),
+   'setting DOMLSResourceResolver')
+  or XML::Xerces::error($@);
+
+isa_ok($conf->getParameter($XML::Xerces::XMLUni::fgDOMResourceResolver), 
"XML::Xerces::DOMLSResourceResolver");
+
+END {
+  # NOTICE: We must now explicitly call XMLPlatformUtils::Terminate()
+  #   when the module is unloaded. Xerces.pm no longer does this for us
+  #
+  #
+  XML::Xerces::XMLPlatformUtils::Terminate();
 }
-my $handler = XML::Xerces::PerlErrorHandler->new();

Modified: xerces/c/trunk/swig/perl/t/DOMDocument.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMDocument.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMDocument.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMDocument.t Fri Oct 13 14:16:19 2006
@@ -83,7 +83,7 @@
 isa_ok($error,$isa)
   or diag($error);
 
-my $expect = "$XML::Xerces::DOMException::INVALID_CHARACTER_ERR";
+my $expect = $XML::Xerces::DOMException::INVALID_CHARACTER_ERR;
 ok(UNIVERSAL::isa($error,$isa)
    && $error->getCode == $expect,
   "received correct error code")
@@ -105,23 +105,16 @@
   || diag("found code: $error->{code}, expected code: $expect");
 
 # check that an element can start with an underscore
-eval {
-  my $el = $doc1->createElement('_');
-};
+$el = eval{$doc1->createElement('_')};
 ok(!$@,
   "element can start with underscore");
 
 # check that an element can start with an colon
-eval {
-  my $el = $doc1->createElement(':');
-};
+$el = eval {$doc1->createElement(':')};
 ok(!$@,
-  "element cannot start with colon");
+  "element can start with colon");
 
 # check that getElementById() doesn't segfault on undef ID
-eval {
-  $doc1->getElementById(undef);
-};
-ok($@,
-  "calling getElementById with null string causes exception");
-
+$el = eval {$doc1->getElementById(undef)};
+ok((not defined $el),
+  "calling getElementById with undef returns undef");

Modified: xerces/c/trunk/swig/perl/t/DOMElement.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMElement.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMElement.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMElement.t Fri Oct 13 14:16:19 2006
@@ -4,7 +4,7 @@
 
 ######################### Begin module loading
 
-use blib;
+# use blib;
 use Test::More tests => 23;
 BEGIN { use_ok("XML::Xerces::DOM") };
 
@@ -68,8 +68,8 @@
 
 # try to set an Attribute, 'foo', to undef
 eval{$persons[0]->setAttribute('foo',undef)};
-ok($@,
-  "setAttribute - undef value fails");
+ok(!$@,
+  "setAttribute - undef value succeeds");
 
 # try to set an Attribute, undef, to 'foo'
 eval{$persons[0]->setAttribute(undef,'foo')};
@@ -104,8 +104,8 @@
 
 # try to set an Attribute, 'foo', to undef
 eval{$element->setAttributeNS($uri,'foo',undef)};
-ok($@,
-  "setAttributeNS - undef value fails");
+ok(!$@,
+  "setAttributeNS - undef value succeeds");
 
 # try to set an Attribute, undef, to 'foo'
 eval{$element->setAttributeNS($uri,undef,'foo')};
@@ -114,8 +114,8 @@
 
 # try to set an Attribute, with uri == undef
 eval{$element->setAttributeNS(undef,'foo','foo')};
-ok($@,
-  "setAttributeNS - undef uri fails");
+ok(!$@,
+  "setAttributeNS - undef uri succeeds");
 
 $uri = 'http://example.org/';
 $document = <<XML;

Modified: xerces/c/trunk/swig/perl/t/DOMImplementation.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMImplementation.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMImplementation.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMImplementation.t Fri Oct 13 14:16:19 2006
@@ -4,8 +4,8 @@
 
 ######################### Begin module loading
 
-# use blib;
-use Test::More tests => 6;
+use blib;
+use Test::More tests => 26;
 BEGIN { use_ok("XML::Xerces::DOM") };
 
 use lib 't';
@@ -22,32 +22,104 @@
 
 my $domImpl = 
XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');
 isa_ok($domImpl,"XML::Xerces::DOMImplementation");
+isa_ok($domImpl,"XML::Xerces::DOMImplementationLS");
 
 my $dt  = eval{$domImpl->createDocumentType('x', 'x', 'x')};
 XML::Xerces::error($@) if $@;
 isa_ok($dt,"XML::Xerces::DOMDocumentType");
 
+$dt  = eval{$domImpl->createDocumentType(undef, 'x', 'x')};
+ok($@,
+   'exception with undef as qualified name');
+
+$dt  = eval{$domImpl->createDocumentType('x', undef, 'x')};
+ok(!$@,
+   'no exception with undef as public id');
+
+$dt  = eval{$domImpl->createDocumentType('x', 'x', undef)};
+ok(!$@,
+   'no exception with undef as system id');
+
+# test exceptions
+$dt  = eval{$domImpl->createDocumentType('!', 'x', 'x')};
+ok($@,
+   'exception with invalid char in qualified name');
+isa_ok($@,"XML::Xerces::DOMException");
+is([EMAIL 
PROTECTED]>getCode(),$XML::Xerces::DOMException::INVALID_CHARACTER_ERR,
+  'invalid char exception code is returned');
+
+TODO: {
+  local $TODO = 'NAMESPACE_ERR not thrown';
+  $dt  = eval{$domImpl->createDocumentType('!malformed', 'x', 'x')};
+  is([EMAIL PROTECTED]>getCode(),$XML::Xerces::DOMException::NAMESPACE_ERR,
+     'exception in qualified name');
+}
+
+my $mode_synch = $XML::Xerces::DOMImplementationLS::MODE_SYNCHRONOUS;
+is($mode_synch,1,
+   'mode synchronous');
+my $mode_asynch = $XML::Xerces::DOMImplementationLS::MODE_ASYNCHRONOUS;
+is($mode_asynch,2,
+   'mode asynchronous');
+
+my $dtd_type = $XML::Xerces::XMLUni::fgDOMDTDType;
+is($dtd_type, 'http://www.w3.org/TR/REC-xml',
+   'dtd type');
+my $schema_type = $XML::Xerces::XMLUni::fgDOMXMLSchemaType;
+is($schema_type, 'http://www.w3.org/2001/XMLSchema',
+   'schema type');
+
+TODO: {
+  local $TODO = 'asynchronous mode not supported';
+  my $parser = eval {$domImpl->createLSParser($mode_asynch, $dtd_type)};
+  ok((not $@),
+     'asynch mode, dtd type');
+  $parser = eval {$domImpl->createLSParser($mode_asynch, $schema_type)};
+  ok((not $@),
+     'asynch mode, schema type');
+}
+
+my $parser = eval {$domImpl->createLSParser($mode_synch, $dtd_type)};
+XML::Xerces::error($@)
+  if $@;
+ok((not $@),
+   'synch mode, dtd type');
+isa_ok($parser,"XML::Xerces::DOMLSParser");
+
+$parser = eval {$domImpl->createLSParser($mode_synch, $schema_type)};
+XML::Xerces::error($@)
+  if $@;
+ok((not $@),
+   'synch mode, schema type');
+isa_ok($parser,"XML::Xerces::DOMLSParser");
+
+my $writer = $domImpl->createLSSerializer();
+isa_ok($writer,"XML::Xerces::DOMLSSerializer");
+
+my $input = $domImpl->createLSInput();
+isa_ok($input,"XML::Xerces::DOMLSInput");
+
+my $output = $domImpl->createLSOutput();
+isa_ok($output,"XML::Xerces::DOMLSOutput");
+
 my $doc = $domImpl->createDocument('myns', 'HISTORY', $dt);
 isa_ok($doc,"XML::Xerces::DOMDocument");
 
 ok(keys %XML::Xerces::DOMDocument::OWNER == 0,
   "DOMDocument not owned after creation");
 
-$doc->getDocumentElement->setAttributeNS("http://www.w3.org/2000/xmlns/";, 
"xmlns:myns", 'myns');
+# test exceptions
+my $domImpl2 = 
XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');
+my $doc2 = eval{$domImpl2->createDocument('myns', 'BAR', $dt)};
+XML::Xerces::error($@) if $@;
 
-for (my $i = 0; $i < 10; $i++) {
-  my $record = $doc->createElement('RECORD');
-  $doc->getDocumentElement->appendChild($record);
-  $record->setAttribute('ID', '0');
-  $record->setAttribute('PRICE', '1.1');
-  $record->setAttribute('VOl', '10');
-}
-my @elements = $doc->getElementsByTagName('*');
-ok(scalar @elements == 11,
-  "Found all created elements")
-  or diag("Found only " . scalar @elements . " elements");
 
-$doc->release();
+my $doc3 = eval{$domImpl->createDocument('myns', '!', $dt)};
+ok($@,
+   'exception with invalid char in qualified name');
+isa_ok($@,"XML::Xerces::DOMException");
+is([EMAIL 
PROTECTED]>getCode(),$XML::Xerces::DOMException::INVALID_CHARACTER_ERR,
+  'invalid char exception code is returned');
 
 END {
   # NOTICE: We must now explicitly call XMLPlatformUtils::Terminate()

Copied: xerces/c/trunk/swig/perl/t/DOMLSParser.t (from r442160, 
xerces/c/trunk/swig/perl/t/DOMBuilder.t)
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMLSParser.t?view=diff&rev=463834&p1=xerces/c/trunk/swig/perl/t/DOMBuilder.t&r1=442160&p2=xerces/c/trunk/swig/perl/t/DOMLSParser.t&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMBuilder.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMLSParser.t Fri Oct 13 14:16:19 2006
@@ -5,12 +5,12 @@
 ######################### Begin module loading
 
 # use blib;
-use Test::More tests => 12;
+use Test::More tests => 16;
 
 BEGIN{use_ok('XML::Xerces::DOM')};
 
 use lib 't';
-use TestUtils qw($PERSONAL_FILE_NAME);
+use TestUtils qw($PERSONAL_FILE_NAME $PERSONAL_DTD_NAME $PERSONAL_SCHEMA_NAME);
 use vars qw($error);
 use strict;
 
@@ -70,3 +70,34 @@
 @persons = $doc->getElementsByTagName('person');
 is(scalar @persons, 6,'getting <person>s');
 
+my $grammar = $DOM->loadGrammar($PERSONAL_DTD_NAME,
+                               $XML::Xerces::Grammar::DTDGrammarType,
+                               my $to_cache = 1);
+isa_ok($grammar, "XML::Xerces::DTDGrammar",
+       'loadGrammar(path)');
+
+eval{
+  my $sax_is = XML::Xerces::LocalFileInputSource->new($PERSONAL_DTD_NAME);
+  $dom_is = XML::Xerces::Wrapper4InputSource->new($sax_is);
+};
+$grammar = $DOM->loadGrammar($dom_is,
+                            $XML::Xerces::Grammar::DTDGrammarType,
+                            $to_cache = 1);
+isa_ok($grammar, "XML::Xerces::DTDGrammar",
+       'loadGrammar(is)');
+
+$grammar = $DOM->loadGrammar($PERSONAL_SCHEMA_NAME,
+                               $XML::Xerces::Grammar::SchemaGrammarType,
+                               my $to_cache = 1);
+isa_ok($grammar, "XML::Xerces::SchemaGrammar",
+       'loadGrammar(path)');
+
+eval{
+  my $sax_is = XML::Xerces::LocalFileInputSource->new($PERSONAL_SCHEMA_NAME);
+  $dom_is = XML::Xerces::Wrapper4InputSource->new($sax_is);
+};
+$grammar = $DOM->loadGrammar($dom_is,
+                            $XML::Xerces::Grammar::SchemaGrammarType,
+                            $to_cache = 1);
+isa_ok($grammar, "XML::Xerces::SchemaGrammar",
+       'loadGrammar(is)');

Modified: xerces/c/trunk/swig/perl/t/DOMParser.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMParser.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMParser.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMParser.t Fri Oct 13 14:16:19 2006
@@ -4,8 +4,8 @@
 
 ######################### Begin module loading
 
-# use blib;
-use Test::More tests => 11;
+use blib;
+use Test::More tests => 13;
 BEGIN { use_ok("XML::Xerces::DOM") };
 
 use lib 't';
@@ -38,7 +38,23 @@
 eval{$DOM->parse(XML::Xerces::MemBufInputSource->new($document, 'foo'))};
 ok($@,'no dtd');
 
-$DOM = XML::Xerces::XercesDOMParser->new();
+# this is stupid!! We should be able to reset the parser
+# after a fatal error - FIXME
+TODO: {
+  local $TODO = "cannot reuse parser after fatal error";
+  $DOM = XML::Xerces::XercesDOMParser->new();
+  fail("reset parser");
+}
+
+# ensure we can unset the error handler using undef
+$DOM->setErrorHandler(undef);
+$DOM->setValidationScheme ($XML::Xerces::AbstractDOMParser::Val_Always);
+eval{$DOM->parse(XML::Xerces::MemBufInputSource->new($document))};
+ok((not $@),'unsetting error handler')
+  or XML::Xerces::error($@);
+
+# no validation allows skipping the DTD
+$DOM->setValidationScheme ($XML::Xerces::AbstractDOMParser::Val_Never);
 $DOM->setErrorHandler(XML::Xerces::PerlErrorHandler->new());
 
 eval{$DOM->parse(XML::Xerces::MemBufInputSource->new($document, 'foo'))};
@@ -123,8 +139,10 @@
   while ($DOM->parseNext($token)) {
   }
 };
-ok($::error,'fatal error in progressive parse')
-  or diag("Here's the error: $@");
+ok($::error,
+   'fatal error in progressive parse')
+  or XML::Xerces::error($@);
+
 my $doc = $DOM->getDocument();
 ok($doc,'doc');
 my $root = $doc->getDocumentElement();

Modified: xerces/c/trunk/swig/perl/t/DOMStringList.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMStringList.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMStringList.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMStringList.t Fri Oct 13 14:16:19 2006
@@ -5,7 +5,7 @@
 ######################### Begin module loading
 
 # use blib;
-use Test::More tests => 20;
+use Test::More tests => 52;
 
 BEGIN{use_ok('XML::Xerces::DOM')};
 
@@ -18,23 +18,54 @@
 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 @ls_param_names = (
+                     $XML::Xerces::XMLUni::fgDOMResourceResolver,
+                     $XML::Xerces::XMLUni::fgDOMErrorHandler,
+                     $XML::Xerces::XMLUni::fgXercesEntityResolver,
+                     
$XML::Xerces::XMLUni::fgXercesSchemaExternalSchemaLocation,
+                     
$XML::Xerces::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation,
+                     $XML::Xerces::XMLUni::fgXercesSecurityManager,
+                     $XML::Xerces::XMLUni::fgXercesScannerName,
+                     
$XML::Xerces::XMLUni::fgXercesParserUseDocumentFromImplementation,
+                     $XML::Xerces::XMLUni::fgDOMCharsetOverridesXMLEncoding,
+                     $XML::Xerces::XMLUni::fgDOMDisallowDoctype,
+                     
$XML::Xerces::XMLUni::fgDOMIgnoreUnknownCharacterDenormalization,
+                     $XML::Xerces::XMLUni::fgDOMNamespaces,
+                     $XML::Xerces::XMLUni::fgDOMSupportedMediatypesOnly,
+                     $XML::Xerces::XMLUni::fgDOMValidate,
+                     $XML::Xerces::XMLUni::fgDOMValidateIfSchema,
+                     $XML::Xerces::XMLUni::fgDOMWellFormed,
+                     $XML::Xerces::XMLUni::fgDOMCanonicalForm,
+                     $XML::Xerces::XMLUni::fgDOMCDATASections,
+                     $XML::Xerces::XMLUni::fgDOMCheckCharacterNormalization,
+                     $XML::Xerces::XMLUni::fgDOMComments,
+                     $XML::Xerces::XMLUni::fgDOMDatatypeNormalization,
+                     $XML::Xerces::XMLUni::fgDOMElementContentWhitespace,
+                     $XML::Xerces::XMLUni::fgDOMEntities,
+                     $XML::Xerces::XMLUni::fgDOMNamespaceDeclarations,
+                     $XML::Xerces::XMLUni::fgDOMNormalizeCharacters,
+                     $XML::Xerces::XMLUni::fgDOMSchemaLocation,
+                     $XML::Xerces::XMLUni::fgDOMSchemaType,
+                     $XML::Xerces::XMLUni::fgDOMSplitCDATASections,
+                     $XML::Xerces::XMLUni::fgDOMInfoset,
+                     $XML::Xerces::XMLUni::fgXercesSchema,
+                     $XML::Xerces::XMLUni::fgXercesSchemaFullChecking,
+                     $XML::Xerces::XMLUni::fgXercesUserAdoptsDOMDocument,
+                     $XML::Xerces::XMLUni::fgXercesLoadExternalDTD,
+                     $XML::Xerces::XMLUni::fgXercesContinueAfterFatalError,
+                     $XML::Xerces::XMLUni::fgXercesValidationErrorAsFatal,
+                     $XML::Xerces::XMLUni::fgXercesCacheGrammarFromParse,
+                     $XML::Xerces::XMLUni::fgXercesUseCachedGrammarInParse,
+                     $XML::Xerces::XMLUni::fgXercesCalculateSrcOfs,
+                     $XML::Xerces::XMLUni::fgXercesStandardUriConformant,
+                     $XML::Xerces::XMLUni::fgXercesDOMHasPSVIInfo,
+                     
$XML::Xerces::XMLUni::fgXercesGenerateSyntheticAnnotations,
+                     $XML::Xerces::XMLUni::fgXercesValidateAnnotations,
+                     $XML::Xerces::XMLUni::fgXercesIdentityConstraintChecking,
+                     $XML::Xerces::XMLUni::fgXercesIgnoreCachedDTD,
+                     $XML::Xerces::XMLUni::fgXercesIgnoreAnnotations,
+                     
$XML::Xerces::XMLUni::fgXercesDisableDefaultEntityResolution,
+                     $XML::Xerces::XMLUni::fgXercesSkipDTDValidation);
 
 my @accepted_param_names = $conf->getParameterNames();
 ok(scalar @accepted_param_names, "StringList to_list()");
@@ -46,8 +77,8 @@
    'StringList length equal overload list length')
   or diag("Found items: " . join(':', @accepted_param_names));
 
-my %param_names = map {$_=>1} @param_names;
-foreach my $param_name (@param_names) {
+my %param_names = map {$_=>1} @ls_param_names;
+foreach my $param_name (@ls_param_names) {
   ok($accepted_params_list->contains($param_name),
      "can set $param_name");
 }

Modified: xerces/c/trunk/swig/perl/t/Grammar.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/Grammar.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/Grammar.t (original)
+++ xerces/c/trunk/swig/perl/t/Grammar.t Fri Oct 13 14:16:19 2006
@@ -2,27 +2,64 @@
 # with `make test'. After `make install' it should work as `perl
 # Grammar.t'
 
-######################### We start with some black magic to print on failure.
+######################### Begin module loading
 
-END {fail() unless $loaded;}
-
-use Carp;
 # use blib;
-use XML::Xerces;
-use Test::More tests => 2;
+use Test::More tests => 13;
+BEGIN { use_ok(XML::Xerces::DOM) };
 
 use lib 't';
-use TestUtils qw($DOM $PERSONAL_FILE_NAME);
-use vars qw($loaded);
-use strict;
+use TestUtils qw($DOM $PERSONAL_FILE_NAME $PERSONAL_SCHEMA_FILE_NAME 
$SAMPLE_DIR);
 
-$loaded = 1;
-pass("module loaded");
+use strict;
 
-######################### End of black magic.
+######################### Begin Test
 
+$DOM->setValidationScheme($XML::Xerces::AbstractDOMParser::Val_Auto);
 $DOM->parse($PERSONAL_FILE_NAME);
 
 # test that we can fetch the grammar
-my $grammar = $DOM->getValidator->getGrammar->getGrammarType();
-ok($grammar == $XML::Xerces::Grammar::DTDGrammarType);
+my $grammar = $DOM->getValidator->getGrammar();
+isa_ok($grammar, "XML::Xerces::DTDGrammar",
+       'DTD grammar');
+is($grammar->getGrammarType, $XML::Xerces::Grammar::DTDGrammarType,
+   'getGrammarType - DTD');
+
+ok($grammar->getValidated(),
+   'grammar validated');
+
+my $desc = $grammar->getGrammarDescription();
+isa_ok($desc, "XML::Xerces::XMLGrammarDescription",
+       'grammar description');
+isa_ok($desc, "XML::Xerces::XMLDTDDescription",
+       'grammar description');
+
+$DOM->setDoNamespaces(1);
+$DOM->setDoSchema(1);
+$DOM->parse($PERSONAL_SCHEMA_FILE_NAME);
+
+$grammar = $DOM->getValidator->getGrammar();
+isa_ok($grammar, "XML::Xerces::SchemaGrammar",
+       'schema grammar');
+is($grammar->getGrammarType, $XML::Xerces::Grammar::SchemaGrammarType,
+   'getGrammarType - Schema');
+ok($grammar->getValidated(),
+   'grammar validated');
+
+my $impl = XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');
+my $DOM = 
$impl->createLSParser($XML::Xerces::DOMImplementationLS::MODE_SYNCHRONOUS,'');
+$grammar = $DOM->loadGrammar("$SAMPLE_DIR/SecondSchema.xsd",
+                            $XML::Xerces::Grammar::SchemaGrammarType,
+                            my $to_cache = 0);
+
+is($grammar->getTargetNamespace, 'http://www.secondSchema',
+   'target namespace');
+ok((not $grammar->getValidated()),
+   'grammar loaded, not validated');
+
+$desc = $grammar->getGrammarDescription();
+isa_ok($desc, "XML::Xerces::XMLGrammarDescription",
+       'getGrammarDescription');
+isa_ok($desc, "XML::Xerces::XMLSchemaDescription",
+       'getGrammarDescription');
+

Modified: xerces/c/trunk/swig/perl/t/SAX2Count.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/SAX2Count.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/SAX2Count.t (original)
+++ xerces/c/trunk/swig/perl/t/SAX2Count.t Fri Oct 13 14:16:19 2006
@@ -1,35 +1,32 @@
 # Before `make install' is performed this script should be runnable
 # with `make test'. After `make install' it should work as `perl
-# SAX2Count.t
+# SAX2Count.t`
 
-######################### We start with some black magic to print on failure.
+######################### Begin module loading
 
-END {fail() unless $loaded;}
-
-use Carp;
 # use blib;
-use XML::Xerces;
 use Test::More tests => 5;
-use Config;
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use lib 't';
 use TestUtils qw($PERSONAL_FILE_NAME $SAMPLE_DIR);
-use vars qw($loaded $file);
 use strict;
+use Config;
 
-$loaded = 1;
-pass("module loaded");
-
-######################### End of black magic.
+######################### Begin Test
 
 my $perl = $Config{startperl};
 $perl =~ s/^\#!//;
 my @output = split(/\n/,`$perl -Mblib $SAMPLE_DIR/SAX2Count.pl 
$PERSONAL_FILE_NAME 2>/dev/null`);
 $output[1] =~ /\s(\d+)/;
-ok($1 == 37);
+is($1, 37,
+   'elems');
 $output[2] =~ /\b(\d+)\b/;
-ok($1 == 12);
+is($1, 12,
+  'attrs');
 $output[3] =~ /\b(\d+)\b/;
-ok($1 == 134);
+is($1, 134,
+   'whitespace');
 $output[4] =~ /\b(\d+)\b/;
-ok($1 == 134);
+is($1, 134,
+   'characters');

Modified: xerces/c/trunk/swig/perl/t/SAX2XMLReader.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/SAX2XMLReader.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/SAX2XMLReader.t (original)
+++ xerces/c/trunk/swig/perl/t/SAX2XMLReader.t Fri Oct 13 14:16:19 2006
@@ -6,9 +6,8 @@
 
 # use blib;
 use Test::More tests => 26;
-BEGIN { use_ok("XML::Xerces") };
+BEGIN { use_ok("XML::Xerces::SAX") };
 
-use Carp;
 use lib 't';
 use TestUtils qw($PERSONAL_FILE_NAME $SCHEMA_FILE_NAME 
$PERSONAL_SCHEMA_INVALID_FILE_NAME);
 use vars qw($error);

Modified: xerces/c/trunk/swig/perl/t/SAXCount.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/SAXCount.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/SAXCount.t (original)
+++ xerces/c/trunk/swig/perl/t/SAXCount.t Fri Oct 13 14:16:19 2006
@@ -1,35 +1,32 @@
 # Before `make install' is performed this script should be runnable
 # with `make test'. After `make install' it should work as `perl
-# SAXCount.t
+# SAXCount.t`
 
-######################### We start with some black magic to print on failure.
+######################### Begin module loading
 
-END {fail() unless $loaded;}
-
-use Carp;
 # use blib;
-use XML::Xerces;
 use Test::More tests => 5;
-use Config;
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use lib 't';
 use TestUtils qw($PERSONAL_FILE_NAME $SAMPLE_DIR);
-use vars qw($loaded $file);
 use strict;
+use Config;
 
-$loaded = 1;
-pass("module loaded");
-
-######################### End of black magic.
+######################### Begin Test
 
 my $perl = $Config{startperl};
 $perl =~ s/^\#!//;
 my @output = split(/\n/,`$perl -Mblib $SAMPLE_DIR/SAXCount.pl 
$PERSONAL_FILE_NAME 2>/dev/null`);
 $output[1] =~ /\s(\d+)/;
-ok($1 == 37);
+is($1, 37,
+   'elems');
 $output[2] =~ /\b(\d+)\b/;
-ok($1 == 12);
+is($1, 12,
+  'attrs');
 $output[3] =~ /\b(\d+)\b/;
-ok($1 == 134);
+is($1, 134,
+   'whitespace');
 $output[4] =~ /\b(\d+)\b/;
-ok($1 == 134);
+is($1, 134,
+   'characters');

Modified: xerces/c/trunk/swig/perl/t/SAXException.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/SAXException.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/SAXException.t (original)
+++ xerces/c/trunk/swig/perl/t/SAXException.t Fri Oct 13 14:16:19 2006
@@ -6,14 +6,12 @@
 
 # use blib;
 use Test::More tests => 17;
-BEGIN { use_ok("XML::Xerces") };
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use lib 't';
-# use TestUtils qw($PERSONAL_FILE_NAME);
+use TestUtils qw($PERSONAL_FILE_NAME);
 use strict;
 
-my $PERSONAL_FILE_NAME = 'samples/personal.xml';
-
 ######################### Begin Test
 
 # test that we get an SAXNotRecognizedException
@@ -30,18 +28,26 @@
 
   skip "setFeature didn't raise an exception", 2, if not $error;
 
-  isa_ok($error,'XML::Xerces::SAXNotRecognizedException');
+  my $skip = 0;
+  isa_ok($error,'XML::Xerces::SAXNotRecognizedException')
+    or $skip = 1;
+
+  skip "bad exception: $error", 1, if $skip;
   ok($error->getMessage(),"message");
 }
 
-SKSIP: {
+SKIP: {
   eval {$parser->getFeature($feature)};
   $error = $@;
   ok($error,"getFeature: $feature");
 
   skip "setFeature didn't raise an exception", 2, if not $error;
 
-  isa_ok($error,'XML::Xerces::SAXNotRecognizedException');
+  my $skip = 0;
+  isa_ok($error,'XML::Xerces::SAXNotRecognizedException')
+    or $skip = 1;
+
+  skip "bad exception: $error", 1, if $skip;
   ok($error->getMessage(),"message");
 }
 
@@ -52,7 +58,11 @@
 
   skip "setFeature didn't raise an exception", 2, if not $@;
 
-  isa_ok($error,'XML::Xerces::SAXNotRecognizedException');
+  my $skip = 0;
+  isa_ok($error,'XML::Xerces::SAXNotRecognizedException')
+    or $skip = 1;
+
+  skip "bad exception: $error", 1, if $skip;
   ok($error->getMessage(),"message");
 }
 
@@ -63,7 +73,11 @@
 
   skip "setFeature didn't raise an exception", 2, if not $error;
 
-  isa_ok($error,'XML::Xerces::SAXNotRecognizedException');
+  my $skip = 0;
+  isa_ok($error,'XML::Xerces::SAXNotRecognizedException')
+    or $skip = 1;
+
+  skip "bad exception: $error", 1, if $skip;
   ok($error->getMessage(),"message");
 }
 
@@ -98,6 +112,10 @@
   skip "modifying a feature during a parse didn't raise a not supported 
exception", 2,
     if not $error;
 
-  isa_ok($error,'XML::Xerces::SAXNotSupportedException');
+  my $skip = 0;
+  isa_ok($error,'XML::Xerces::SAXNotSupportedException')
+    or $skip = 1;
+
+  skip "bad exception: $error", 1, if $skip;
   ok($error->getMessage(),"message");
 }

Modified: xerces/c/trunk/swig/perl/t/SAXParser.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/SAXParser.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/SAXParser.t (original)
+++ xerces/c/trunk/swig/perl/t/SAXParser.t Fri Oct 13 14:16:19 2006
@@ -5,8 +5,8 @@
 ######################### Begin module loading
 
 # use blib;
-use Test::More tests => 12;
-BEGIN { use_ok("XML::Xerces") };
+use Test::More tests => 13;
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use lib 't';
 use TestUtils qw($PERSONAL_FILE_NAME);
@@ -85,7 +85,8 @@
   # do nothing
 }
 pass('successful progressive parse');
-ok($DOCUMENT_HANDLER->{elements} == 37, 'element count after progressive 
parse');
+ok($DOCUMENT_HANDLER->{elements} == 37,
+   'element count after progressive parse');
 
 # reset the counts
 $DOCUMENT_HANDLER->reset_document();
@@ -175,8 +176,13 @@
 # reset the state for a new parse
 $::error = '';
 $SAX->parseReset($token);
-$SAX->setErrorHandler(XML::Xerces::PerlErrorHandler->new());
 
+$SAX->setErrorHandler(undef);
+eval {$SAX->parse(XML::Xerces::MemBufInputSource->new($document))};
+ok((not $@),'unset error handler')
+  or XML::Xerces::error($@);
+
+$SAX->setErrorHandler(XML::Xerces::PerlErrorHandler->new());
 eval {$SAX->parse($PERSONAL_FILE_NAME)};
 ok((not $@),'successful parse after fatal error');
 

Modified: xerces/c/trunk/swig/perl/t/TestUtils.pm
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/TestUtils.pm?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/TestUtils.pm (original)
+++ xerces/c/trunk/swig/perl/t/TestUtils.pm Fri Oct 13 14:16:19 2006
@@ -14,12 +14,19 @@
            $PERSONAL_SCHEMA_FILE_NAME
            $SCHEMA_FILE_NAME
            $SAMPLE_DIR
+               $PERSONAL_INVALID_FILE_NAME
+               $PERSONAL_NOT_WELL_FORMED_FILE_NAME
            $PERSONAL_FILE_NAME
            $PERSONAL_DTD_NAME
+           $PERSONAL_SCHEMA_NAME
            $PERSONAL_NO_DOCTYPE
            $PERSONAL_NO_DOCTYPE_FILE_NAME
                $PERSONAL_NO_XMLDECL_FILE_NAME
                $PERSONAL_NO_XMLDECL
+               $TYPEINFO_NAME
+               $TYPEINFO_NO_DTD_NAME
+               $TYPEINFO_COMBINED_NAME
+               $TYPEINFO_JUST_DTD_NAME
           );
 use Carp;
 use Cwd;
@@ -32,12 +39,19 @@
                $DOM
                $CATALOG
                $PERSONAL_FILE_NAME
+               $PERSONAL_INVALID_FILE_NAME
+               $PERSONAL_NOT_WELL_FORMED_FILE_NAME
                $PUBLIC_RESOLVER_FILE_NAME
                $SYSTEM_RESOLVER_FILE_NAME
                $SCHEMA_FILE_NAME
                $PERSONAL_SCHEMA_FILE_NAME
                $PERSONAL_SCHEMA_INVALID_FILE_NAME
                $PERSONAL_DTD_NAME
+               $PERSONAL_SCHEMA_NAME
+               $TYPEINFO_NAME
+               $TYPEINFO_NO_DTD_NAME
+               $TYPEINFO_COMBINED_NAME
+               $TYPEINFO_JUST_DTD_NAME
                $PERSONAL_NO_DOCTYPE_FILE_NAME
                $PERSONAL_NO_DOCTYPE
                $PERSONAL_NO_XMLDECL_FILE_NAME
@@ -56,20 +70,30 @@
   #
 XML::Xerces::XMLPlatformUtils::Initialize();
 
-  $DOM = XML::Xerces::XercesDOMParser->new();
+$DOM = XML::Xerces::XercesDOMParser->new();
 
-  my $ERROR_HANDLER = XML::Xerces::PerlErrorHandler->new();
-  $DOM->setErrorHandler($ERROR_HANDLER);
+my $ERROR_HANDLER = XML::Xerces::PerlErrorHandler->new();
+$DOM->setErrorHandler($ERROR_HANDLER);
 
-  my $cwd = cwd();
-  $cwd =~ s|/t/?$||;
-  $SAMPLE_DIR = "$cwd/samples";
-  $PERSONAL_FILE_NAME = "$SAMPLE_DIR/personal.xml";
-  $PERSONAL_NO_DOCTYPE_FILE_NAME = "$SAMPLE_DIR/personal-no-doctype.xml";
-  $PERSONAL_NO_XMLDECL_FILE_NAME = "$SAMPLE_DIR/personal-no-xmldecl.xml";
+my $cwd = cwd();
+$cwd =~ s|/t/?$||;
+$SAMPLE_DIR = "$cwd/samples";
+$PERSONAL_FILE_NAME = "$SAMPLE_DIR/personal.xml";
+$PERSONAL_NO_DOCTYPE_FILE_NAME = "$SAMPLE_DIR/personal-no-doctype.xml";
+$PERSONAL_NO_XMLDECL_FILE_NAME = "$SAMPLE_DIR/personal-no-xmldecl.xml";
+$PERSONAL_FILE_NAME = "$SAMPLE_DIR/personal.xml";
+$PERSONAL_INVALID_FILE_NAME = "$SAMPLE_DIR/personal-invalid.xml";
+$PERSONAL_NOT_WELL_FORMED_FILE_NAME = 
"$SAMPLE_DIR/personal-not-well-formed.xml";
+
+$TYPEINFO_NAME = "$SAMPLE_DIR/TypeInfo.xml";
+$TYPEINFO_NO_DTD_NAME = "$SAMPLE_DIR/TypeInfoNoDTD.xml";
+$TYPEINFO_COMBINED_NAME = "$SAMPLE_DIR/TypeInfoCombined.xml";
+$TYPEINFO_JUST_DTD_NAME = "$SAMPLE_DIR/TypeInfoJustDTD.xml";
 
   $PERSONAL_DTD_NAME = $PERSONAL_FILE_NAME;
   $PERSONAL_DTD_NAME =~ s/\.xml/\.dtd/;
+  $PERSONAL_SCHEMA_NAME = $PERSONAL_FILE_NAME;
+  $PERSONAL_SCHEMA_NAME =~ s/\.xml/\.xsd/;
   $PERSONAL_SCHEMA_FILE_NAME = $PERSONAL_FILE_NAME;
   $PERSONAL_SCHEMA_FILE_NAME =~ s/\.xml/-schema.xml/;
   $PERSONAL_SCHEMA_INVALID_FILE_NAME = $PERSONAL_SCHEMA_FILE_NAME;

Modified: xerces/c/trunk/swig/perl/t/URLInputSource.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/URLInputSource.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/URLInputSource.t (original)
+++ xerces/c/trunk/swig/perl/t/URLInputSource.t Fri Oct 13 14:16:19 2006
@@ -2,22 +2,16 @@
 # with `make test'. After `make install' it should work as `perl
 # URLInputSource.t'
 
-######################### We start with some black magic to print on failure.
+######################### Begin module loading
 
-END {fail() unless $loaded;}
-
-use Carp;
 # use blib;
-use XML::Xerces;
-use Test::More tests => 8;
+use Test::More tests => 9;
+BEGIN { use_ok("XML::Xerces") };
+BEGIN { use_ok("XML::Xerces::IO") };
 
-use vars qw($loaded $error);
 use strict;
 
-$loaded = 1;
-pass("module loaded");
-
-######################### End of black magic.
+######################### Begin Test
 
 # Insert your test code below (better if it prints "ok 13"
 # (correspondingly "not ok 13") depending on the success of chunk 13

Modified: xerces/c/trunk/swig/perl/t/XMLUni.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/XMLUni.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/XMLUni.t (original)
+++ xerces/c/trunk/swig/perl/t/XMLUni.t Fri Oct 13 14:16:19 2006
@@ -4,15 +4,26 @@
 #########################################
 
 # use blib;
-use Test::More tests => 5;
+use Test::More tests => 8;
 BEGIN {use_ok("XML::Xerces::DOM")};
+BEGIN {use_ok("XML::Xerces::SAX")};
 
 use strict;
 
 # once the unicode constants were not being properly exported
 # these tests guard against that happening again
-is($XML::Xerces::XMLUni::fgPCDATAString, '#PCDATA', 'XMLUni constants 
exported');
-is($XML::Xerces::XMLUni::fgPubIDString, 'PUBLIC', 'XMLUni constants exported');
+is($XML::Xerces::XMLUni::fgPCDATAString, '#PCDATA',
+   'XMLUni constants exported');
+is($XML::Xerces::XMLUni::fgPubIDString, 'PUBLIC',
+   'XMLUni constants exported');
+
+TODO: {
+  local $TODO = 'SWIG is exporting all class variables into top-level 
namespace';
+  ok((not defined $XML::Xerces::XMLUni_fgPCDATAString),
+     'XMLUni constants not in XML::Xerces namespace');
+  ok((not defined $XML::Xerces::XMLUni_fgPubIDString),
+     'XMLUni constants not in XML::Xerces namespace');
+}
 
 eval {
   my $parser = XML::Xerces::XMLReaderFactory::createXMLReader();

Modified: xerces/c/trunk/swig/perl/t/actualCast.t
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/actualCast.t?view=diff&rev=463834&r1=463833&r2=463834
==============================================================================
--- xerces/c/trunk/swig/perl/t/actualCast.t (original)
+++ xerces/c/trunk/swig/perl/t/actualCast.t Fri Oct 13 14:16:19 2006
@@ -2,28 +2,17 @@
 # with `make test'. After `make install' it should work as `perl
 # actualCast.t'
 
-######################### We start with some black magic to print on failure.
+######################### Begin module loading
 
-END {fail() unless $loaded;}
-
-use Carp;
 # use blib;
-use XML::Xerces;
 use Test::More tests => 9;
+BEGIN { use_ok("XML::Xerces::SAX") };
 
 use lib 't';
 use TestUtils qw($DOM $PERSONAL $PERSONAL_FILE_NAME 
$PERSONAL_SCHEMA_FILE_NAME);
-use vars qw($loaded);
 use strict;
 
-$loaded = 1;
-pass("module loaded");
-
-######################### End of black magic.
-
-# 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):
+######################### Begin Test
 
 $DOM->parse($PERSONAL_FILE_NAME);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to