UTF-X, Unit Testing Framework - Xslt

utfx.framework
Class ConfigurationManager

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

public class ConfigurationManager
extends java.lang.Object

UTF-X framework configuration manager.

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

Version:
$Revision: 1.7.2.1 $Date: 2006/08/22 04:59:44 $ $ $Name: release_0_0_8_alpha $
Author:
Jacek Radajewski

Field Summary
private static ConfigurationManager instance
          singleton instance of the ConfigurationManager
private  org.apache.log4j.Logger log
          logger
private  java.lang.String osName
          operating system *
private static java.lang.String propertiesFilename
          name of the properties file
private  java.util.Properties utfxProperties
          UTF-X properties
 
Constructor Summary
private ConfigurationManager()
          Create a new instance of ConfigurationManager.
 
Method Summary
 boolean generateHTMLReport()
          Check if HTML report of the test run should be generrated.
 java.lang.String getHTMLReportFilename()
           
static ConfigurationManager getInstance()
           
 java.lang.Class getResultPrinterClass()
          Get a ResultPrinter Class object for the result printer as specified in the utfx.result-printer.class property.
 java.io.OutputStream getResultPrinterOutputStream()
           
 SourceParser getSourceBuilder()
           
 java.io.FilenameFilter getTestFileFilter()
          This methods creates and returns java.io.FilenameFilter used for filtering UTF-X test definition files.
 boolean openHTMLReportInBrowser()
          Check if UTF-X should attempt to open the generated HTML report in a browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertiesFilename

private static final java.lang.String propertiesFilename
name of the properties file

See Also:
Constant Field Values

instance

private static ConfigurationManager instance
singleton instance of the ConfigurationManager


utfxProperties

private java.util.Properties utfxProperties
UTF-X properties


log

private org.apache.log4j.Logger log
logger


osName

private java.lang.String osName
operating system *

Constructor Detail

ConfigurationManager

private ConfigurationManager()
Create a new instance of ConfigurationManager. This constructor is private and should never be called from outside this class.

Method Detail

getInstance

public static ConfigurationManager getInstance()
Returns:
an instance of the ConfigurationManager singleton.

getTestFileFilter

public java.io.FilenameFilter getTestFileFilter()
This methods creates and returns java.io.FilenameFilter used for filtering UTF-X test definition files. The filter class name is obtained from the utfx.testfile-filter.class property. If the class cannot be loaded or the instance cannot be created then a default test file filter will be used. The default test file filter is TestFileFilter.

Returns:
FilenameFilter
See Also:
TestFileFilter

getSourceBuilder

public SourceParser getSourceBuilder()
Returns:
default SourceParser. This SourceParser will be used throughout the test run unles overwritten test file suite or test case level (in UTF-X test definition files).

getResultPrinterClass

public java.lang.Class getResultPrinterClass()
Get a ResultPrinter Class object for the result printer as specified in the utfx.result-printer.class property. If the property is not set then return a default ResultPrinter, ie JunitResultPrinter

Returns:
a result printer class
See Also:
JunitResultPrinter

getResultPrinterOutputStream

public java.io.OutputStream getResultPrinterOutputStream()
                                                  throws java.io.FileNotFoundException
Returns:
result printer outout stream
Throws:
java.io.FileNotFoundException - if the file specified in the properties file cannot be created

generateHTMLReport

public boolean generateHTMLReport()
Check if HTML report of the test run should be generrated.

Returns:
true iff property utfx.html-report.generate=yes

getHTMLReportFilename

public java.lang.String getHTMLReportFilename()
Returns:
the name of the file into which the HTML report should be written to. This filename is obtained from the utfx.html-report.filename property.

openHTMLReportInBrowser

public boolean openHTMLReportInBrowser()
Check if UTF-X should attempt to open the generated HTML report in a browser.

Returns:
true iff property utfx.html-report.open-in-browser=yes

UTF-X, Unit Testing Framework - Xslt