org.webdocwf.util.loader.test
Class LoaderTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.webdocwf.util.loader.test.LoaderTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class LoaderTestCase
extends junit.framework.TestCase

Basic class for using Loader as a test case (extends Junit Test class)

Version:
$Revision: 1.2 $
Author:
Sinisa Milosevic

Constructor Summary
LoaderTestCase(java.lang.String name)
           
 
Method Summary
protected  void closeConnection(java.sql.Connection connection)
          Close the specified connection.
protected abstract  java.sql.Connection getConnection()
          Returns the test database connection.
protected  java.lang.String getDatabaseName()
          Returns the name of test database.
protected abstract  Loader getLoader()
          Returns the test Loader class (loaderjob).
protected  DatabaseOperation[] getSetUpOperation()
          Returns the database operations executed in test setup.
protected  DatabaseOperation[] getTearDownOperation()
          Returns the database operation executed in test cleanup.
protected  void setUp()
           
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 

Constructor Detail

LoaderTestCase

public LoaderTestCase(java.lang.String name)
Method Detail

getConnection

protected abstract java.sql.Connection getConnection()
                                              throws java.lang.Exception
Returns the test database connection.

Throws:
java.lang.Exception

getDatabaseName

protected java.lang.String getDatabaseName()
                                    throws java.lang.Exception
Returns the name of test database.

Throws:
java.lang.Exception

getLoader

protected abstract Loader getLoader()
                             throws java.lang.Exception
Returns the test Loader class (loaderjob).

Throws:
java.lang.Exception

closeConnection

protected void closeConnection(java.sql.Connection connection)
                        throws java.lang.Exception
Close the specified connection. Override this method of you want to keep your connection alive between tests.

Throws:
java.lang.Exception

getSetUpOperation

protected DatabaseOperation[] getSetUpOperation()
                                         throws java.lang.Exception
Returns the database operations executed in test setup. First operation will be executed dbOperation[0], then dbOperation[1]... Override this method of you want to change database operations before the start test.

Throws:
java.lang.Exception

getTearDownOperation

protected DatabaseOperation[] getTearDownOperation()
                                            throws java.lang.Exception
Returns the database operation executed in test cleanup. First operation will be executed dbOperation[0], then dbOperation[1]... Override this method of you want to change database operations after the test execution.

Throws:
java.lang.Exception

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception


Copyright © 2002-2007 Together - the Workgroup. All Rights Reserved.