net.sf.farrago.test
Class FarragoTestCase.Cleanup

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
All Implemented Interfaces:
Test
Direct Known Subclasses:
LucidDbTestCleanup
Enclosing class:
FarragoTestCase

public static class FarragoTestCase.Cleanup
extends FarragoTestCase

Helper for staticSetUp.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.farrago.test.FarragoTestCase
FarragoTestCase.Cleanup, FarragoTestCase.CleanupFactory
 
Field Summary
 
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
FarragoTestCase.Cleanup(String name)
           
 
Method Summary
private  void dropAuthIds()
           
private  void dropDataServers()
           
private  void dropDataWrappers()
           
private  void dropLabels()
           
protected  void dropSchemas()
           
 void execute()
           
protected  FarragoRepos getRepos()
           
protected  Statement getStmt()
           
protected  boolean isBlessedAuthId(FemAuthId authId)
          Decides whether authId should be preserved as a global fixture.
protected  boolean isBlessedAuthId(String name)
           
protected  boolean isBlessedLabel(FemLabel label)
          Decides where a label should be preserved because it's a global fixture or because it's a label alias.
protected  boolean isBlessedLabel(String name)
           
protected  boolean isBlessedSchema(CwmSchema schema)
          Decides whether schema should be preserved as a global fixture.
protected  boolean isBlessedSchema(String name)
           
protected  boolean isBlessedServer(FemDataServer server)
          Decides whether server should be preserved as a global fixture.
protected  boolean isBlessedServer(String name)
           
protected  boolean isBlessedWrapper(FemDataWrapper wrapper)
          Decides whether wrapper should be preserved as a global fixture.
protected  boolean isBlessedWrapper(String name)
           
 void restoreCleanupParameters()
           
 void 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
 

Constructor Detail

FarragoTestCase.Cleanup

public FarragoTestCase.Cleanup(String name)
                        throws Exception
Throws:
Exception
Method Detail

getRepos

protected FarragoRepos getRepos()

getStmt

protected Statement getStmt()

execute

public void execute()
             throws Exception
Throws:
Exception

saveCleanupParameters

public void saveCleanupParameters()

restoreCleanupParameters

public void restoreCleanupParameters()

isBlessedSchema

protected boolean isBlessedSchema(CwmSchema schema)
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.

Parameters:
schema - schema to check
Returns:
true iff schema should be preserved as fixture

isBlessedSchema

protected boolean isBlessedSchema(String name)

isBlessedServer

protected boolean isBlessedServer(FemDataServer server)
Decides whether server should be preserved as a global fixture. Extension project test case can override this method to bless additional servers or use attributes other than the name to make the determination.

Parameters:
server - server to check
Returns:
true iff schema should be preserved as fixture

isBlessedServer

protected boolean isBlessedServer(String name)

isBlessedWrapper

protected boolean isBlessedWrapper(FemDataWrapper wrapper)
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.

Parameters:
wrapper - wrapper to check
Returns:
true iff wrapper should be preserved as fixture

isBlessedWrapper

protected boolean isBlessedWrapper(String name)

isBlessedLabel

protected boolean isBlessedLabel(FemLabel label)
Decides where a label should be preserved because it's a global fixture or because it's a label alias. Label aliases are preserved (temporarily) because they will be dropped, as needed, by the cascaded drop of the parent label. Extension project test case can override this method to bless additional labels or use attributes other than the name to make the determination.

Parameters:
label - label to check
Returns:
true iff label should be preseved as fixture

isBlessedLabel

protected boolean isBlessedLabel(String name)

isBlessedAuthId

protected boolean isBlessedAuthId(FemAuthId authId)
Decides whether authId should be preserved as a global fixture. Extension project test case can override this method to bless additional authIds or use attributes other than the name to make the determination.

Parameters:
authId - authorization ID to check
Returns:
true iff authId should be preserved as fixture

isBlessedAuthId

protected boolean isBlessedAuthId(String name)

dropSchemas

protected void dropSchemas()
                    throws Exception
Throws:
Exception

dropDataWrappers

private void dropDataWrappers()
                       throws Exception
Throws:
Exception

dropDataServers

private void dropDataServers()
                      throws Exception
Throws:
Exception

dropLabels

private void dropLabels()
                 throws Exception
Throws:
Exception

dropAuthIds

private void dropAuthIds()
                  throws Exception
Throws:
Exception