org.progeeks.junit
Class XmlTestLoader

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.progeeks.junit.XmlTestLoader
All Implemented Interfaces:
junit.framework.Test

public class XmlTestLoader
extends junit.framework.TestCase

Class from running tests that are loaded from XML This class is set up so that it can either be run as a standalone program (with the test configuration supplied as an argument or via a system property) or via a JUnit TestRunner (with its test configuraiton specified as a system property).

Version:
$Revision: 1.9 $
Author:
Paul Wisneskey

Field Summary
static java.lang.String CONFIG_FILE_PROPERTY
          System property that should contain the name of the test configuration file.
 
Constructor Summary
XmlTestLoader()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main class - launches the
static junit.framework.TestSuite suite()
          Method invoked by a general test runner to get the suite of tests to run.
static junit.framework.TestSuite suite(java.io.Reader in)
          Method invoked to actually load the test suite from a reader.
static junit.framework.TestSuite suite(java.lang.String configFile)
          Method invoked by a test runner or this application's main method to create a test suite from the supplied configuration file.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
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

CONFIG_FILE_PROPERTY

public static final java.lang.String CONFIG_FILE_PROPERTY
System property that should contain the name of the test configuration file.

See Also:
Constant Field Values
Constructor Detail

XmlTestLoader

public XmlTestLoader()
Method Detail

suite

public static junit.framework.TestSuite suite()
Method invoked by a general test runner to get the suite of tests to run. This method uses the system property to determine the proper test configuration file to load the test suite using.

Returns:
Test suite for all of the loaded tests.

suite

public static junit.framework.TestSuite suite(java.lang.String configFile)
Method invoked by a test runner or this application's main method to create a test suite from the supplied configuration file.

Parameters:
configFile - Configuration file to create test suite from.
Returns:
Test suite for use by a test runner to conduct the tests.

suite

public static junit.framework.TestSuite suite(java.io.Reader in)
Method invoked to actually load the test suite from a reader. In practice this will be a file reader to read the test configuration from a file. For testing purposes, other types of readers (such as string readers) will likely be used.

Parameters:
in - Reader to read the tests from.
Returns:
Test suite for use by a test runner to conduct the tests.

main

public static void main(java.lang.String[] args)
Main class - launches the

Parameters:
args -


Copyright © 2002-2003 Paul Speed. All Rights Reserved.