UTF-X, Unit Testing Framework - Xslt

utfx.framework
Class TestFileSuiteAssembler

java.lang.Object
  extended by utfx.framework.TestFileSuiteAssembler

public class TestFileSuiteAssembler
extends java.lang.Object

Builds XSLTTestFileSuite from an XML test definition document. The tests created are compatible with the JUnit testing framework.

Copyright © 2004 - 2005 USQ and others.

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/TestFileSuiteAssembler.java,v $

Version:
$Revision: 1.11.2.2 $ $Date: 2006/08/11 14:23:57 $ $Name: release_0_0_8_alpha $
Author:
Jacek Radajewski, Oliver Lucido, Sally MacFarlane, Alex Daniel

Field Summary
private  javax.xml.parsers.DocumentBuilder db
          DOM Document builder
private  javax.xml.parsers.DocumentBuilderFactory dbf
          DOM Document builder factory
private  java.lang.String filename
          Filename of this test definition document (test file suite)
private  org.apache.log4j.Logger log
          log4j logging facility
private  XSLTTestFileSuite suite
          test file suite we are going to assemble
private  javax.xml.transform.TransformerFactory tf
          XSLT transformer factory
private  javax.xml.xpath.XPath xpath
          Xpath
private  javax.xml.xpath.XPathFactory xpf
          XPath factory
 
Constructor Summary
TestFileSuiteAssembler(java.lang.String filename)
          Construct a new TestFileSuiteAssembler.
 
Method Summary
 void assemble()
          Assemble a test file suite.
private  java.lang.String getStylesheetUnderTestURI(org.w3c.dom.Document testDoc)
          Get the absolute URI of the stylesheet under test.
 XSLTTestFileSuite getTestSuite()
          Gets the XSLTTestFileSuite constructed by this assembler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

private java.lang.String filename
Filename of this test definition document (test file suite)


suite

private XSLTTestFileSuite suite
test file suite we are going to assemble


xpf

private javax.xml.xpath.XPathFactory xpf
XPath factory


xpath

private javax.xml.xpath.XPath xpath
Xpath


tf

private javax.xml.transform.TransformerFactory tf
XSLT transformer factory


dbf

private javax.xml.parsers.DocumentBuilderFactory dbf
DOM Document builder factory


db

private javax.xml.parsers.DocumentBuilder db
DOM Document builder


log

private org.apache.log4j.Logger log
log4j logging facility

Constructor Detail

TestFileSuiteAssembler

public TestFileSuiteAssembler(java.lang.String filename)
                       throws javax.xml.parsers.ParserConfigurationException
Construct a new TestFileSuiteAssembler.

Parameters:
filename - the UTF-X test definition file to use for assembling the test suite.
Throws:
javax.xml.parsers.ParserConfigurationException - if this constructor cannot create a document builder or its factory..
Method Detail

assemble

public void assemble()
              throws java.lang.Exception
Assemble a test file suite. This method does the actual work of assembling the test file suite with its test cases.

Throws:
java.lang.Exception - if the XLSTTestFileSuite cannot be assembled.

getTestSuite

public XSLTTestFileSuite getTestSuite()
Gets the XSLTTestFileSuite constructed by this assembler.

Returns:
XSLTTestFileSuite constructed by this assembler.

getStylesheetUnderTestURI

private java.lang.String getStylesheetUnderTestURI(org.w3c.dom.Document testDoc)
                                            throws java.net.MalformedURLException
Get the absolute URI of the stylesheet under test. The stylesheet under test is retrieved from the TDF file

Parameters:
testDoc - the TDF file
Returns:
The absolute URI of the stylesheet under test
Throws:
java.net.MalformedURLException

UTF-X, Unit Testing Framework - Xslt