|
UTF-X, Unit Testing Framework - Xslt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase utfx.framework.XMLValidationTestCase
public class XMLValidationTestCase
Validation Test Case. This test case uses a DOM validating parser to parse
the document and reports any warnings, errors and fatal error using the
weblogic logging facility. Please see the Extensible Markup
Language (XML) 1.0 (Second Edition) W3C recommendation for a full
definition of error
and fatal
error
.
Copyright © 2004 - University of Southern Queensland.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
$Source: /cvs/utf-x/framework/src/java/utfx/framework/XMLValidationTestCase.java,v $
Field Summary | |
---|---|
private javax.xml.parsers.DocumentBuilder |
db
document builder |
private javax.xml.parsers.DocumentBuilderFactory |
dbf
document builder factory |
private java.lang.StringBuffer |
errors
this is where we log validation errors |
private boolean |
isValid
true iff the xml content is valid |
private org.apache.log4j.Logger |
log
logging facility |
private java.lang.String |
testName
name of this test |
private java.lang.String |
xml
the XML content we are to validate |
Constructor Summary | |
---|---|
XMLValidationTestCase(java.lang.String testName,
java.lang.String xml)
Construct a new XML Validator from a URI pointing to an XML doc. |
Method Summary | |
---|---|
void |
error(org.xml.sax.SAXParseException e)
Handle parse error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Handle fatal error. |
java.lang.String |
toString()
|
void |
validate()
Perform validation. |
void |
warning(org.xml.sax.SAXParseException e)
Handle warning but take no further action. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private javax.xml.parsers.DocumentBuilderFactory dbf
private javax.xml.parsers.DocumentBuilder db
private org.apache.log4j.Logger log
private java.lang.String testName
private java.lang.StringBuffer errors
private java.lang.String xml
private boolean isValid
Constructor Detail |
---|
public XMLValidationTestCase(java.lang.String testName, java.lang.String xml)
is
- the XML document to be validated, as an input streamMethod Detail |
---|
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
e
- instance of SAXParserException containing the details of the
error.
SAXException.
org.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
e
- instance of SAXParserException containing the details of the
warning.
SAXException.
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
e
- instance of SAXParserException containing the details of the
error.
SAXException.
org.xml.sax.SAXException
public void validate() throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class junit.framework.TestCase
|
UTF-X, Unit Testing Framework - Xslt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |