|
UTF-X, Unit Testing Framework - Xslt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
utfx.framework.UTFXTestCase
utfx.framework.XSLTTransformTestCase
public class XSLTTransformTestCase
JUnit extension for testing XSLT stylesheets.
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/XSLTTransformTestCase.java,v $
Field Summary | |
---|---|
private org.w3c.dom.DOMConfiguration |
domConfig
DOM Configuration object |
private org.w3c.dom.ls.DOMImplementationLS |
domImplLS
DOM Load/Save implementation |
private org.w3c.dom.bootstrap.DOMImplementationRegistry |
domRegistry
DOM3 implementation registry |
private org.w3c.dom.ls.LSSerializer |
domSerializer
DOM Load/Save serializer |
private java.lang.String |
expectedDocType
|
private java.lang.String |
expectedString
The expected output |
private java.lang.String |
failureMessage
The message to output when the assertion fails |
private org.apache.log4j.Logger |
log
LOG4J logging facility |
private MalformedTestException |
mte
We need to flag badly formed tests at assambly time and throw an exception at test run time; this is due to JUnit limitation; |
private XSLTTestFileSuite |
parentSuite
XSLTTestFileSuite that is the parent of this XSLTTransformTestCase |
private SourceParser |
sourceBuilder
source builder used to parse utfx:source fragments |
private java.lang.String |
sourceString
The source input |
private java.lang.String |
templateName
|
private java.lang.String |
testName
The name of this test case |
private javax.xml.transform.Transformer |
transformer
XSLT transformer used to transform the source |
private javax.xml.transform.Source |
transformSource
transformer.Source |
private boolean |
useSourceParser
|
private boolean |
validateExpected
|
private boolean |
validateSource
|
private javax.xml.xpath.XPath |
xpath
XPath |
private javax.xml.xpath.XPathFactory |
xpf
XPath factory |
Constructor Summary | |
---|---|
XSLTTransformTestCase(org.w3c.dom.Element elem,
XSLTTestFileSuite parentSuite)
Constructs an XsltTestCase. |
Method Summary | |
---|---|
private java.lang.String |
getDocType(java.lang.String rootTagName,
java.lang.String publicID,
java.lang.String systemID)
Generate doctype declaration from root element name, public identifier and system identifier. |
private java.lang.String |
getExpectedDocType(java.lang.String rootTagName)
|
java.lang.String |
getFailureMessage()
Get the failureMessage. |
private java.lang.String |
getSourceDocType(java.lang.String rootTagName)
|
boolean |
isUsingCallTemplate()
Tests if this is using a named-template transformer. |
private boolean |
isValid(org.w3c.dom.Element e)
|
private void |
processNode(org.w3c.dom.Element testElement)
Process utfx:test element and create appropriate test components. |
java.lang.String |
serializeNode(org.w3c.dom.Node node)
Serialize the given node to a String. |
private void |
setExpectedString(org.w3c.dom.Element testElement)
|
private void |
setTestSourceBuilder(org.w3c.dom.Element testElement)
Set source builder for this test. |
void |
setTransformer(javax.xml.transform.Transformer transformer)
Sets the transformer to be used. |
private void |
setTransformSource(org.w3c.dom.Element testElement)
Set transform.Source object. |
void |
testTransform()
Transforms the source using the transformer and asserts their equivalence. |
java.lang.String |
toString()
|
boolean |
useSourceParser()
Get the useSourceParser value. |
boolean |
validateExpected()
Get the validateExpected value. |
boolean |
validateSource()
Get the validateExpected value. |
Methods inherited from class utfx.framework.UTFXTestCase |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquivXML, assertEquivXML, assertEquivXML, assertEquivXML |
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.xpath.XPathFactory xpf
private javax.xml.xpath.XPath xpath
private java.lang.String testName
private javax.xml.transform.Transformer transformer
private javax.xml.transform.Source transformSource
private java.lang.String sourceString
private java.lang.String expectedString
private java.lang.String failureMessage
private java.lang.String templateName
private org.apache.log4j.Logger log
private SourceParser sourceBuilder
private org.w3c.dom.bootstrap.DOMImplementationRegistry domRegistry
private org.w3c.dom.ls.DOMImplementationLS domImplLS
private org.w3c.dom.ls.LSSerializer domSerializer
private org.w3c.dom.DOMConfiguration domConfig
private boolean validateSource
private boolean validateExpected
private boolean useSourceParser
private java.lang.String expectedDocType
private MalformedTestException mte
private XSLTTestFileSuite parentSuite
Constructor Detail |
---|
public XSLTTransformTestCase(org.w3c.dom.Element elem, XSLTTestFileSuite parentSuite) throws java.lang.Exception
testName
- the name of this testsource
- the source inputexpected
- the expected output
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
javax.xml.xpath.XPathExpressionException
MalformedTestException
java.lang.Exception
Method Detail |
---|
public java.lang.String getFailureMessage()
public boolean useSourceParser()
useSourceParser
value. Method used for testing.
public boolean validateExpected()
validateExpected
value. Method used for testing.
public boolean validateSource()
validateExpected
value. Method used for testing.
private void processNode(org.w3c.dom.Element testElement) throws java.lang.Exception
testElement
- dom.Element representing utfx:test
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
javax.xml.xpath.XPathExpressionException
MalformedTestException
java.lang.Exception
private void setTestSourceBuilder(org.w3c.dom.Element testElement) throws java.lang.Exception
testElement
- this UTF-X test as DOM Element.
javax.xml.xpath.XPathExpressionException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.Exception
public java.lang.String serializeNode(org.w3c.dom.Node node) throws java.lang.Exception
node
-
java.lang.Exception
private void setTransformSource(org.w3c.dom.Element testElement) throws java.lang.Exception
testElement
- dom.Element representing the UTF-X test.
java.lang.Exception
private void setExpectedString(org.w3c.dom.Element testElement) throws java.lang.Exception
testElement
-
java.lang.Exception
private boolean isValid(org.w3c.dom.Element e) throws javax.xml.xpath.XPathExpressionException
e
-
javax.xml.xpath.XPathExpressionException
public boolean isUsingCallTemplate()
public void setTransformer(javax.xml.transform.Transformer transformer)
public void testTransform() throws java.lang.Exception
java.lang.Exception
private java.lang.String getDocType(java.lang.String rootTagName, java.lang.String publicID, java.lang.String systemID)
rootTagName
- publicID
- systemID
-
private java.lang.String getSourceDocType(java.lang.String rootTagName)
private java.lang.String getExpectedDocType(java.lang.String rootTagName)
public java.lang.String toString()
toString
in class junit.framework.TestCase
|
UTF-X, Unit Testing Framework - Xslt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |