org.kuali.rice.test
Class ClearDatabaseLifecycle

java.lang.Object
  extended by org.kuali.rice.core.api.lifecycle.BaseLifecycle
      extended by org.kuali.rice.test.ClearDatabaseLifecycle
All Implemented Interfaces:
Lifecycle

public class ClearDatabaseLifecycle
extends BaseLifecycle

Lifecycle class to clean up the database for use in testing. This lifecycle will not be run (even if it is listed in the lifecycles list) if the 'use.use.clearDatabaseLifecycle' configuration property is defined, and is not 'true'. If the property is omitted the lifecycle runs as normal.

Since:
0.9
Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected static org.apache.log4j.Logger LOG
           
static String TEST_TABLE_NAME
           
 
Constructor Summary
ClearDatabaseLifecycle()
           
ClearDatabaseLifecycle(List<String> tablesToClear, List<String> tablesNotToClear)
           
 
Method Summary
protected  void addStandardTables()
           
protected  void clearTables(org.springframework.transaction.PlatformTransactionManager transactionManager, DataSource dataSource)
           
 List<String> getTablesNotToClear()
           
 List<String> getTablesToClear()
           
protected  Map<String,List<String[]>> indexExportedKeys(DatabaseMetaData metaData, String schemaName)
           
protected  Boolean isTestTableInSchema(Connection connection)
           
 void start()
           
protected  void verifyTestEnvironment(DataSource dataSource)
           
 
Methods inherited from class org.kuali.rice.core.api.lifecycle.BaseLifecycle
isStarted, setStarted, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG

TEST_TABLE_NAME

public static final String TEST_TABLE_NAME
See Also:
Constant Field Values
Constructor Detail

ClearDatabaseLifecycle

public ClearDatabaseLifecycle()

ClearDatabaseLifecycle

public ClearDatabaseLifecycle(List<String> tablesToClear,
                              List<String> tablesNotToClear)
Method Detail

addStandardTables

protected void addStandardTables()

start

public void start()
           throws Exception
Specified by:
start in interface Lifecycle
Overrides:
start in class BaseLifecycle
Throws:
Exception

isTestTableInSchema

protected Boolean isTestTableInSchema(Connection connection)
                               throws SQLException
Throws:
SQLException

verifyTestEnvironment

protected void verifyTestEnvironment(DataSource dataSource)

clearTables

protected void clearTables(org.springframework.transaction.PlatformTransactionManager transactionManager,
                           DataSource dataSource)

indexExportedKeys

protected Map<String,List<String[]>> indexExportedKeys(DatabaseMetaData metaData,
                                                       String schemaName)
                                                throws SQLException
Throws:
SQLException

getTablesToClear

public List<String> getTablesToClear()

getTablesNotToClear

public List<String> getTablesNotToClear()


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.