net.sf.farrago.test
Class FarragoAutoCalcRulesTest

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.FarragoAutoCalcRulesTest
All Implemented Interfaces:
Test

public class FarragoAutoCalcRulesTest
extends FarragoTestCase

FarragoAutoCalcRuleTest tests FarragoAutoCalcRule. This class duplicates some of FarragoTestCase's set up mechanism. It does so in order to register JPLUS(a Java-only duplicate of the SQL plus operator) and CPLUS (a Fennel Calc-only analog) as SqlOperators. Tests within the class use JPLUS and CPLUS in SQL statements to guarantee expressions that can only be implemented by dividing execution between the Java and Fennel calculators.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/test/FarragoAutoCalcRulesTest.java#2 $
Author:
Stephan Zuercher

Nested Class Summary
private static class FarragoAutoCalcRulesTest.TestDbSessionFactory
          TestDbSessionFactory extends FarragoDefaultSessionFactory and returns a custom TestDbSession instance.
private static class FarragoAutoCalcRulesTest.TestDbSessionPersonality
          TestDbSession extends FarragoDefaultSessionPersonality to provide our custom OJRexImplementor table in place of Farrago's normal implementation.
static class FarragoAutoCalcRulesTest.TestJdbcEngineDriver
          TestJdbcEngineDriver extends FarragoJdbcEngineDriver and provides our custom TestDbSessionFactory in place of Farrago's normal implementation.
 
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
FarragoAutoCalcRulesTest(String testName)
          Creates a new FarragoAutoCalcRulesTest object.
 
Method Summary
static void registerTestCppOps(CalcRexImplementorTableImpl implementor, SqlStdOperatorTable opTab)
           
static void registerTestJavaOps(FarragoOJRexImplementorTable implementorTable, SqlStdOperatorTable opTab)
           
static String staticAutoCalcSetUp()
           
static void staticAutoCalcTearDown(String originalDriverClass)
           
static Test suite()
           
 void testDynamicParameterInCall()
           
 void testDynamicParameterInConditional()
           
 void testFarragoAutoCalcRuleByDiff()
           
 void testSimple()
           
static Test wrappedSuite(TestSuite suite)
           
 
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
 
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

FarragoAutoCalcRulesTest

public FarragoAutoCalcRulesTest(String testName)
                         throws Exception
Creates a new FarragoAutoCalcRulesTest object.

Parameters:
testName - .
Throws:
Exception
Method Detail

suite

public static Test suite()

wrappedSuite

public static Test wrappedSuite(TestSuite suite)

staticAutoCalcSetUp

public static String staticAutoCalcSetUp()
                                  throws Exception
Throws:
Exception

staticAutoCalcTearDown

public static void staticAutoCalcTearDown(String originalDriverClass)
                                   throws Exception
Throws:
Exception

testFarragoAutoCalcRuleByDiff

public void testFarragoAutoCalcRuleByDiff()
                                   throws Exception
Throws:
Exception

testSimple

public void testSimple()
                throws SQLException
Throws:
SQLException

testDynamicParameterInConditional

public void testDynamicParameterInConditional()
                                       throws SQLException
Throws:
SQLException

testDynamicParameterInCall

public void testDynamicParameterInCall()
                                throws SQLException
Throws:
SQLException

registerTestJavaOps

public static void registerTestJavaOps(FarragoOJRexImplementorTable implementorTable,
                                       SqlStdOperatorTable opTab)

registerTestCppOps

public static void registerTestCppOps(CalcRexImplementorTableImpl implementor,
                                      SqlStdOperatorTable opTab)