com.flexiblewebsolutions.xdriveunit
Class XDriveTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.flexiblewebsolutions.xdriveunit.XDriveTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
WebXDriveTestCase

public abstract class XDriveTestCase
extends junit.framework.TestCase

A TestCase implementation that uses XML files to drive test behavior

Author:
Donavon Buss

Field Summary
protected  java.lang.StringBuffer _TestInput
          Data that will be available to test methods during execution.
protected  java.lang.String _ThreadName
          Name of thread for differentiating test instances.
 
Constructor Summary
protected XDriveTestCase()
          Internal method only.
  XDriveTestCase(java.lang.String pName, java.lang.StringBuffer pTestInput, java.lang.StringBuffer pTestOptions, java.lang.String pThreadName)
          Init the web client test case
 
Method Summary
protected  boolean checkBooleanParameter(java.lang.String pPropName)
          Retrieve property from Map and return it's boolean value
 java.lang.String getClassName()
           
protected  java.io.File getFile(java.lang.String pFilePath)
          Attempts to load requested file from getTestDirectory and then from the current directory
 java.io.File getTestDirectory()
           
protected  java.util.HashMap getTestOptions()
           
 java.io.File getTestTmpDirectory()
           
protected  junit.framework.Test init(java.lang.String pConfigFile)
          Creates the test suite using an XML configuration file.
protected  junit.framework.Test init(java.lang.StringBuffer pConfigInfo, java.lang.String pThreadName)
          Builds a test suite based on a configuration String.
protected  void setupTestOptions(java.lang.StringBuffer pTestOptions)
          Parse out the passed in xml string for different options to be applied to all tests
 
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

_TestInput

protected java.lang.StringBuffer _TestInput
Data that will be available to test methods during execution.


_ThreadName

protected java.lang.String _ThreadName
Name of thread for differentiating test instances.

Constructor Detail

XDriveTestCase

public XDriveTestCase(java.lang.String pName,
                      java.lang.StringBuffer pTestInput,
                      java.lang.StringBuffer pTestOptions,
                      java.lang.String pThreadName)
Init the web client test case

Parameters:
pName - - Name of test to be run
pTestInput - - data needed for input during test
pTestOptions - - different options that control behavior of all tests
pTheadName - - User supplied name of thread running test

XDriveTestCase

protected XDriveTestCase()
Internal method only. Needed for loading parameters for test lookup.

Method Detail

getTestOptions

protected java.util.HashMap getTestOptions()

setupTestOptions

protected void setupTestOptions(java.lang.StringBuffer pTestOptions)
Parse out the passed in xml string for different options to be applied to all tests

Parameters:
pTestOptions - - xml containing test options

checkBooleanParameter

protected boolean checkBooleanParameter(java.lang.String pPropName)
Retrieve property from Map and return it's boolean value

Parameters:
pPropName -
Returns:
true or false

init

protected junit.framework.Test init(java.lang.String pConfigFile)
                             throws MissingConfigException
Creates the test suite using an XML configuration file.

Parameters:
pConfigFile - - Relative path of file from TestDirectory setting or current directory
Returns:
TestSuite
Throws:
MissingConfigException

getFile

protected java.io.File getFile(java.lang.String pFilePath)
                        throws java.io.FileNotFoundException
Attempts to load requested file from getTestDirectory and then from the current directory

Parameters:
pFilePath - - relative path to file
Returns:
Path to the located file
Throws:
java.io.FileNotFoundException

init

protected junit.framework.Test init(java.lang.StringBuffer pConfigInfo,
                                    java.lang.String pThreadName)
Builds a test suite based on a configuration String.

Parameters:
pConfigInfo - StringBuffer which contains XML configuration for the test.
pThreadName - Name to be used to differeniate different threads running same test.
Returns:
Suite of tests to be run.

getClassName

public java.lang.String getClassName()

getTestDirectory

public java.io.File getTestDirectory()

getTestTmpDirectory

public java.io.File getTestTmpDirectory()


Copyright © -2005 . All Rights Reserved.