Nitido Inc.

com.nitido.qabase
Class BaseTestDriver

java.lang.Object
  extended by com.nitido.qabase.BaseTestDriver

public abstract class BaseTestDriver
extends java.lang.Object

The BaseTestDrive is base class for test drivers used to qa and unit test components. This class takes as parameter a list of class names that extend the BaseTestCore interface. It will then invoke and log every method in the extender of BaseTestCore that has the following signature:

See Also:
BaseTestCore, ResultStatus

Field Summary
protected  Configurator _configurator
           
protected  java.util.Properties _properties
           
static java.lang.String SECTION_QA
           
 
Constructor Summary
BaseTestDriver()
          Default constructor and configurer the BaseTestDriver
 
Method Summary
 ResultStatus cleanup()
          The cleanup method should be used to clean the QA environment used to perform the test cases described in the TestCore class.
protected static Logger getLogger()
          This method returns a reference to the _logger associated to the BaseTestDriver.
protected static Logger getLogger(java.lang.Class categoryName)
          This method returns a Category class used for logging QA executions
 java.util.Properties getProperties()
          This method returns a Properties object, corresponding to the global properties for the QA environment.
 java.util.Properties getProperties(java.lang.String section)
          Returns a specific secion of the confiugrator properties.
 java.lang.String getProperty(java.lang.String propKey)
          Retrieves the value associated to the key from the default property section.
 java.lang.String getProperty(java.lang.String section, java.lang.String propKey)
          Retrieves the value associated to the key from the specified property section.
 java.lang.String getPropertyWithDefault(java.lang.String propKey, java.lang.String defaultValue)
          Retrieves the value associated to the key from the default property section.
 java.lang.String getPropertyWithDefault(java.lang.String section, java.lang.String propKey, java.lang.String defaultValue)
          Retrieves the value associated to the key from the specified property section.
protected  void initConfigurator()
          The method for initializing the Configurator object.
 boolean isExcluded(java.lang.String coreClassName, java.lang.String testCaseName)
          The isExcluded method determines whether the specified test case is excluded from execution with this test driver.
static void main(java.lang.String[] args)
          main first intializes the test environment by calling the setup method of the desired TestDriver.
protected static void printUsage()
          Print out the usage of this executable, in case of error in the command line arguments.
 ResultStatus run(BaseTestCore tester)
          The run method invokes every test cases described in the implementor of the BaseTestCore interface.
 ResultStatus setup()
          The setup method should be used to ensure that the QA environment necessary to perform the test cases described in the TestCore class can be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECTION_QA

public static final java.lang.String SECTION_QA
See Also:
Constant Field Values

_properties

protected java.util.Properties _properties

_configurator

protected Configurator _configurator
Constructor Detail

BaseTestDriver

public BaseTestDriver()
               throws ConfiguratorException
Default constructor and configurer the BaseTestDriver

Throws:
ConfiguratorException
Method Detail

initConfigurator

protected void initConfigurator()
                         throws ConfiguratorException
The method for initializing the Configurator object. If you have additional settings to append to the default Configurator, you should override this method.

Throws:
ConfiguratorException

getLogger

protected static final Logger getLogger()
This method returns a reference to the _logger associated to the BaseTestDriver.

Returns:
The _logger associated to the BaseTestDriver

getLogger

protected static final Logger getLogger(java.lang.Class categoryName)
This method returns a Category class used for logging QA executions

Parameters:
categoryName - The name of the new _logger instance
Returns:
The Category class used to log QA executions

setup

public ResultStatus setup()
The setup method should be used to ensure that the QA environment necessary to perform the test cases described in the TestCore class can be performed. By default this method does nothing and returns as result object of type PASS.

Returns:
The final result of the operation.
See Also:
ResultStatus

run

public final ResultStatus run(BaseTestCore tester)
The run method invokes every test cases described in the implementor of the BaseTestCore interface. The execution and the result status of every test case invocation is logged by the system. This method will stop execution of any outstanding test cases when a FATAL result status of the operation is returned.

Parameters:
tester - A reference to an implementor of the BaseTestCore class. This reference describes all the test cases that are to be invoked by the test driver.
Returns:
The result status of the entire test suite.
See Also:
BaseTestCore, ResultStatus

cleanup

public ResultStatus cleanup()
The cleanup method should be used to clean the QA environment used to perform the test cases described in the TestCore class. By default this method does nothing and returns as result object of type PASS.

Returns:
The final result of the operation.
See Also:
ResultStatus

isExcluded

public boolean isExcluded(java.lang.String coreClassName,
                          java.lang.String testCaseName)
The isExcluded method determines whether the specified test case is excluded from execution with this test driver. This method is extremely helpful when you have some implementation that intentionally does not support a certain set up of features and you must disable the associate test cases.

By default, this method will always return false, indicating all test cases will be executed.

Parameters:
coreClassName - The test core class name.
testCaseName - The method name of the test case in question. This parameter comes from the Strings returned by the TestCore's getMethodNames().
Returns:
true if the specified test case should be EXCLUDED from the execution. Otherwise, the test case will be executed as normal.

main

public static void main(java.lang.String[] args)
main first intializes the test environment by calling the setup method of the desired TestDriver. Then, it runs the tests cases associated to each TestCore class. Finally it cleans the test environment by invoking the cleanup method of the TestDriver.

Parameters:
args - An array of class names, there must be one class name associated with the desired TestDriver and one or more class names associated with each of the TestCore classes.

getProperty

public final java.lang.String getProperty(java.lang.String propKey)
Retrieves the value associated to the key from the default property section.

Parameters:
propKey - The property key.
Returns:
The string value associated to the property key. If the key has no associated value, returns null.

getProperty

public final java.lang.String getProperty(java.lang.String section,
                                          java.lang.String propKey)
Retrieves the value associated to the key from the specified property section.

Parameters:
section - The section name.
propKey - The property key.
Returns:
The string value associated to the property key. If the key has no associated value, returns null.

getPropertyWithDefault

public final java.lang.String getPropertyWithDefault(java.lang.String propKey,
                                                     java.lang.String defaultValue)
Retrieves the value associated to the key from the default property section. If the key has no value, returns the default value.

Parameters:
propKey - The property key.
defaultValue - The default value to be returned if the property key has no value.
Returns:
The string value associated to the property key. If the key has no associated value, returns the default value.

getPropertyWithDefault

public final java.lang.String getPropertyWithDefault(java.lang.String section,
                                                     java.lang.String propKey,
                                                     java.lang.String defaultValue)
Retrieves the value associated to the key from the specified property section. If the key has no value, returns the default value.

Parameters:
section - The section name.
propKey - The property key.
defaultValue - The default value to be returned if the property key has no value.
Returns:
The string value associated to the property key. If the key has no associated value, returns the default value.

getProperties

public final java.util.Properties getProperties()
This method returns a Properties object, corresponding to the global properties for the QA environment.

Returns:
The Properties class, or null, if none is available

getProperties

public final java.util.Properties getProperties(java.lang.String section)
Returns a specific secion of the confiugrator properties.


printUsage

protected static void printUsage()
Print out the usage of this executable, in case of error in the command line arguments.


Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.