org.opensubsystems.core.persist.db
Class DatabaseTestSuite

java.lang.Object
  extended by junit.framework.TestSuite
      extended by org.opensubsystems.core.persist.db.DatabaseTestSuite
All Implemented Interfaces:
junit.framework.Test

public class DatabaseTestSuite
extends junit.framework.TestSuite

This test suite which should be used to group tests accessing database. It provides functionality necessary to run database tests, mainly it points all tests in the suite to the correct database.

Version:
$Id: DatabaseTestSuite.java,v 1.4 2007/01/07 06:14:20 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
protected  java.lang.String m_strDataSourceName
          Data source which will be used by all tests in this suite
 
Constructor Summary
DatabaseTestSuite(java.lang.String strName)
          Run all tests from
DatabaseTestSuite(java.lang.String strName, java.lang.String strDataSourceName, java.lang.String strDriverName, java.lang.String strUrl)
          Run all tests from
DatabaseTestSuite(java.lang.String strName, java.lang.String strDataSourceName, java.lang.String strDriverName, java.lang.String strUrl, java.lang.String strUser, java.lang.String strPassword)
          Run all tests from
 
Method Summary
 void runTest(junit.framework.Test testToRun, junit.framework.TestResult result)
          
protected  void setTestDataSource(junit.framework.Test testToSet)
          Set datasource for all database tests in specified test or test suite
 
Methods inherited from class junit.framework.TestSuite
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, run, setName, testAt, testCount, tests, toString, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_strDataSourceName

protected java.lang.String m_strDataSourceName
Data source which will be used by all tests in this suite

Constructor Detail

DatabaseTestSuite

public DatabaseTestSuite(java.lang.String strName)
Run all tests from

Parameters:
strName - - name of the test suite

DatabaseTestSuite

public DatabaseTestSuite(java.lang.String strName,
                         java.lang.String strDataSourceName,
                         java.lang.String strDriverName,
                         java.lang.String strUrl)
                  throws org.opensubsystems.core.error.OSSException
Run all tests from

Parameters:
strName - - name of the test suite
strDataSourceName - - data source which will be used by all tests in this suite
strDriverName - - driver name which will be used by by all tests in this suite
strUrl - - url this test connects to the database
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

DatabaseTestSuite

public DatabaseTestSuite(java.lang.String strName,
                         java.lang.String strDataSourceName,
                         java.lang.String strDriverName,
                         java.lang.String strUrl,
                         java.lang.String strUser,
                         java.lang.String strPassword)
                  throws org.opensubsystems.core.error.OSSException
Run all tests from

Parameters:
strName - - name of the test suite
strDataSourceName - - data source which will be used by all tests in this suite
strDriverName - - driver name which will be used by by all tests in this suite
strUrl - - url this test connects to the database
strUser - - user name to connects to the database
strPassword - - password to connects to the database
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
Method Detail

runTest

public void runTest(junit.framework.Test testToRun,
                    junit.framework.TestResult result)

Overrides:
runTest in class junit.framework.TestSuite

setTestDataSource

protected void setTestDataSource(junit.framework.Test testToSet)
                          throws org.opensubsystems.core.error.OSSException
Set datasource for all database tests in specified test or test suite

Parameters:
testToSet - - test or test suite to set the data source for
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.