com.lucidera.farrago.test
Class LucidDbTestCleanup

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.test.DiffTestCase
              extended by net.sf.farrago.test.ResultSetTestCase
                  extended by net.sf.farrago.test.FarragoTestCase
                      extended by net.sf.farrago.test.FarragoTestCase.Cleanup
                          extended by com.lucidera.farrago.test.LucidDbTestCleanup
All Implemented Interfaces:
Test

public class LucidDbTestCleanup
extends FarragoTestCase.Cleanup

LucidDbTestCleanup takes care of cleaning up the catalog at the start of each LucidDB test suite.

Version:
$Id: //open/dev/farrago/src/com/lucidera/farrago/test/LucidDbTestCleanup.java#13 $
Author:
John V. Sichi

Nested Class Summary
private static class LucidDbTestCleanup.ShutdownThread
           
 
Nested classes/interfaces inherited from class net.sf.farrago.test.FarragoTestCase
FarragoTestCase.Cleanup, FarragoTestCase.CleanupFactory
 
Field Summary
private  FarragoRepos ldbRepos
           
private  Statement ldbStmt
           
private static Thread shutdownHook
           
 
Fields inherited from class net.sf.farrago.test.FarragoTestCase
allocOwner, connection, preparedStmt, repos, stmt, tracer
 
Fields inherited from class net.sf.farrago.test.ResultSetTestCase
resultSet
 
Fields inherited from class org.eigenbase.test.DiffTestCase
logFile, logOutputStream, refFile
 
Constructor Summary
LucidDbTestCleanup(Connection ldbConn)
           
 
Method Summary
static void cleanTest()
           
 void execute()
           
protected  FarragoRepos getRepos()
           
protected  Statement getStmt()
           
protected  boolean isBlessedSchema(CwmSchema schema)
          Decides whether schema should be preserved as a global fixture.
protected  boolean isBlessedWrapper(FemDataWrapper wrapper)
          Decides whether wrapper should be preserved as a global fixture.
private static LucidDbTestCleanup newCleanup()
           
static void saveTestParameters()
           
 
Methods inherited from class net.sf.farrago.test.FarragoTestCase.Cleanup
dropSchemas, isBlessedAuthId, isBlessedAuthId, isBlessedLabel, isBlessedLabel, isBlessedSchema, isBlessedServer, isBlessedServer, isBlessedWrapper, restoreCleanupParameters, saveCleanupParameters
 
Methods inherited from class net.sf.farrago.test.FarragoTestCase
forceShutdown, getJdbcUri, getSession, getTestlogRoot, getTestlogRootStatic, newConnection, newJdbcEngineDriver, restoreParameters, restoreParameters, runCleanup, runSqlLineTest, runSqlLineTest, saveParameters, saveParameters, setRefFileDiffMasks, setUp, shouldDiff, staticSetUp, staticTearDown, tearDown, tearDownImpl, wrappedSuite, wrappedSuite
 
Methods inherited from class net.sf.farrago.test.ResultSetTestCase
compareResultList, compareResultLists, compareResultSet, compareResultSetWithDelta, compareResultSetWithPattern, getResultSetCount
 
Methods inherited from class org.eigenbase.test.DiffTestCase
addDiffMask, addIgnorePattern, diffFile, diffLines, diffTestLog, fileContents, openTestLog, openTestLogOutputStream, setGC, setVerbose
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shutdownHook

private static Thread shutdownHook

ldbRepos

private final FarragoRepos ldbRepos

ldbStmt

private final Statement ldbStmt
Constructor Detail

LucidDbTestCleanup

public LucidDbTestCleanup(Connection ldbConn)
                   throws Exception
Throws:
Exception
Method Detail

getRepos

protected FarragoRepos getRepos()
Overrides:
getRepos in class FarragoTestCase.Cleanup

getStmt

protected Statement getStmt()
Overrides:
getStmt in class FarragoTestCase.Cleanup

isBlessedSchema

protected boolean isBlessedSchema(CwmSchema schema)
Description copied from class: FarragoTestCase.Cleanup
Decides whether schema should be preserved as a global fixture. Extension project test case can override this method to bless additional schemas or use attributes other than the name to make the determination.

Overrides:
isBlessedSchema in class FarragoTestCase.Cleanup
Parameters:
schema - schema to check
Returns:
true iff schema should be preserved as fixture

isBlessedWrapper

protected boolean isBlessedWrapper(FemDataWrapper wrapper)
Description copied from class: FarragoTestCase.Cleanup
Decides whether wrapper should be preserved as a global fixture. Extension project test case can override this method to bless additional schemas or use attributes other than the name to make the determination.

Overrides:
isBlessedWrapper in class FarragoTestCase.Cleanup
Parameters:
wrapper - wrapper to check
Returns:
true iff wrapper should be preserved as fixture

saveTestParameters

public static void saveTestParameters()
                               throws Exception
Throws:
Exception

cleanTest

public static void cleanTest()
                      throws Exception
Throws:
Exception

execute

public void execute()
             throws Exception
Overrides:
execute in class FarragoTestCase.Cleanup
Throws:
Exception

newCleanup

private static LucidDbTestCleanup newCleanup()
                                      throws Exception
Throws:
Exception