xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jas...@apache.org
Subject cvs commit: xml-xerces/perl/t XMLException.t
Date Thu, 14 Jun 2001 05:24:30 GMT
jasons      01/06/13 22:24:30

  Added:       perl/t   XMLException.t
  Log:
  	* t/XMLException.t (Message):
  	Test for exception handler
  
  Revision  Changes    Path
  1.1                  xml-xerces/perl/t/XMLException.t
  
  Index: XMLException.t
  ===================================================================
  # Before `make install' is performed this script should be runnable
  # with `make test'. After `make install' it should work as `perl
  # SAXParser.t'
  
  ######################### We start with some black magic to print on failure.
  
  # 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..2\n"; }
  END {print "not ok 1\n" unless $loaded;}
  use Carp;
  
  # use blib;
  use XML::Xerces;
  use Config;
  
  use lib 't';
  use TestUtils qw(result);
  use vars qw($i $loaded $error);
  use strict;
  
  $loaded = 1;
  $i = 1;
  result($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):
  
  sub handle_xml_exception {
    my $exception = shift;
    print STDERR "Received Exception, Found Exception Object\n";
    print STDERR "Received Exception, Exception Object Missing!!!\n";
  }
  
  # test that we get an XMLException with a bogus InputSource
  $error = 0;
  XML::Xerces::PerlExceptionHandler->setExceptionHandler(sub{
    my $exception = shift;
    $error = 1;
  						       });
  XML::Xerces::LocalFileInputSource->new('../I/AM/NOT/A/FILE');
  result($error);
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org


Mime
View raw message