net.sf.farrago.test
Class FarragoOptRulesTest

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.FarragoSqlToRelTestBase
                          extended by net.sf.farrago.test.FarragoOptRulesTest
All Implemented Interfaces:
Test

public class FarragoOptRulesTest
extends FarragoSqlToRelTestBase

FarragoOptRulesTest is like RelOptRulesTest, but for rules specific to Farrago.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/test/FarragoOptRulesTest.java#28 $
Author:
John V. Sichi

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.farrago.test.FarragoTestCase
FarragoTestCase.Cleanup, FarragoTestCase.CleanupFactory
 
Field Summary
private static boolean doneStaticSetup
           
protected static String NL
           
private  HepProgram program
           
 
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
FarragoOptRulesTest(String testName)
          Creates a new FarragoOptRulesTest object.
 
Method Summary
private  void check(HepProgram program, String sql)
           
private  void check(HepProgram program, String sql, List<RelOptRule> rules)
           
private  void check(RelOptRule rule, String sql)
           
protected  void checkAbstract(FarragoPreparingStmt stmt, RelNode relBefore)
           
protected  DiffRepository getDiffRepos()
           
protected  void initPlanner(FarragoPreparingStmt stmt)
           
protected  void setUp()
           
static Test suite()
           
 void testAlreadyFalseEliminatesFilter()
           
 void testConvertMultiJoinRule()
           
 void testConvertMultiJoinRuleOuterJoins()
           
 void testEmptyFilterProjectUnion()
           
 void testFennelAggRule()
           
 void testFennelBufferCommonRelSubExprRule()
           
 void testFennelCartesianJoinRule()
           
 void testFennelSortRule()
           
 void testFennelToIteratorConverterRule()
           
 void testFtrsScanToSearchRule()
           
 void testFtrsTableAccessRule()
           
 void testFtrsTableProjectionRule()
           
 void testHeterogeneousConversion()
           
 void testMergeFilterWithJoinCondition()
           
 void testPushAggThroughUnion()
           
 void testPushSemiJoinPastFilter()
           
 void testPushSemiJoinPastJoinRule_Left()
           
 void testPushSemiJoinPastJoinRule_Right()
           
 void testPushSemiJoinPastProject()
           
 void testReduceCastAndConsts()
           
 void testReduceCasts()
           
 void testReduceCastsNullable()
           
 void testReduceConstants()
           
 void testReduceConstantsCalc()
           
 void testReduceConstantsEliminatesFilter()
           
 void testReduceValuesNull()
           
 void testReduceValuesToEmpty()
           
 void testReduceValuesUnderFilter()
           
 void testReduceValuesUnderProject()
           
 void testReduceValuesUnderProjectFilter()
           
 void testRemoveSemiJoin()
           
 void testRemoveSemiJoinRight()
           
 void testRemoveSemiJoinRightWithFilter()
           
 void testRemoveSemiJoinWithFilter()
           
 
Methods inherited from class net.sf.farrago.test.FarragoSqlToRelTestBase
addRulesAndCheckQuery, checkQuery
 
Methods inherited from class net.sf.farrago.test.FarragoTestCase
forceShutdown, getJdbcUri, getSession, getTestlogRoot, getTestlogRootStatic, newConnection, newJdbcEngineDriver, restoreParameters, restoreParameters, runCleanup, runSqlLineTest, runSqlLineTest, saveParameters, saveParameters, setRefFileDiffMasks, 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

NL

protected static final String NL

doneStaticSetup

private static boolean doneStaticSetup

program

private HepProgram program
Constructor Detail

FarragoOptRulesTest

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

Parameters:
testName - JUnit test name
Throws:
Exception - .
Method Detail

suite

public static Test suite()

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class FarragoTestCase
Throws:
Exception

getDiffRepos

protected DiffRepository getDiffRepos()

checkAbstract

protected void checkAbstract(FarragoPreparingStmt stmt,
                             RelNode relBefore)
                      throws Exception
Specified by:
checkAbstract in class FarragoSqlToRelTestBase
Throws:
Exception

check

private void check(HepProgram program,
                   String sql)
            throws Exception
Throws:
Exception

check

private void check(HepProgram program,
                   String sql,
                   List<RelOptRule> rules)
            throws Exception
Throws:
Exception

check

private void check(RelOptRule rule,
                   String sql)
            throws Exception
Throws:
Exception

initPlanner

protected void initPlanner(FarragoPreparingStmt stmt)
Specified by:
initPlanner in class FarragoSqlToRelTestBase

testMergeFilterWithJoinCondition

public void testMergeFilterWithJoinCondition()
                                      throws Exception
Throws:
Exception

testHeterogeneousConversion

public void testHeterogeneousConversion()
                                 throws Exception
Throws:
Exception

testFennelToIteratorConverterRule

public void testFennelToIteratorConverterRule()
                                       throws Exception
Throws:
Exception

testFtrsScanToSearchRule

public void testFtrsScanToSearchRule()
                              throws Exception
Throws:
Exception

testFennelSortRule

public void testFennelSortRule()
                        throws Exception
Throws:
Exception

testFennelCartesianJoinRule

public void testFennelCartesianJoinRule()
                                 throws Exception
Throws:
Exception

testFennelAggRule

public void testFennelAggRule()
                       throws Exception
Throws:
Exception

testFtrsTableAccessRule

public void testFtrsTableAccessRule()
                             throws Exception
Throws:
Exception

testFtrsTableProjectionRule

public void testFtrsTableProjectionRule()
                                 throws Exception
Throws:
Exception

testPushSemiJoinPastJoinRule_Left

public void testPushSemiJoinPastJoinRule_Left()
                                       throws Exception
Throws:
Exception

testPushSemiJoinPastJoinRule_Right

public void testPushSemiJoinPastJoinRule_Right()
                                        throws Exception
Throws:
Exception

testPushSemiJoinPastFilter

public void testPushSemiJoinPastFilter()
                                throws Exception
Throws:
Exception

testConvertMultiJoinRule

public void testConvertMultiJoinRule()
                              throws Exception
Throws:
Exception

testReduceConstants

public void testReduceConstants()
                         throws Exception
Throws:
Exception

testReduceConstantsEliminatesFilter

public void testReduceConstantsEliminatesFilter()
                                         throws Exception
Throws:
Exception

testAlreadyFalseEliminatesFilter

public void testAlreadyFalseEliminatesFilter()
                                      throws Exception
Throws:
Exception

testReduceConstantsCalc

public void testReduceConstantsCalc()
                             throws Exception
Throws:
Exception

testRemoveSemiJoin

public void testRemoveSemiJoin()
                        throws Exception
Throws:
Exception

testRemoveSemiJoinWithFilter

public void testRemoveSemiJoinWithFilter()
                                  throws Exception
Throws:
Exception

testRemoveSemiJoinRight

public void testRemoveSemiJoinRight()
                             throws Exception
Throws:
Exception

testRemoveSemiJoinRightWithFilter

public void testRemoveSemiJoinRightWithFilter()
                                       throws Exception
Throws:
Exception

testConvertMultiJoinRuleOuterJoins

public void testConvertMultiJoinRuleOuterJoins()
                                        throws Exception
Throws:
Exception

testPushSemiJoinPastProject

public void testPushSemiJoinPastProject()
                                 throws Exception
Throws:
Exception

testReduceValuesUnderFilter

public void testReduceValuesUnderFilter()
                                 throws Exception
Throws:
Exception

testReduceValuesUnderProject

public void testReduceValuesUnderProject()
                                  throws Exception
Throws:
Exception

testReduceValuesUnderProjectFilter

public void testReduceValuesUnderProjectFilter()
                                        throws Exception
Throws:
Exception

testReduceValuesNull

public void testReduceValuesNull()
                          throws Exception
Throws:
Exception

testReduceValuesToEmpty

public void testReduceValuesToEmpty()
                             throws Exception
Throws:
Exception

testEmptyFilterProjectUnion

public void testEmptyFilterProjectUnion()
                                 throws Exception
Throws:
Exception

testReduceCasts

public void testReduceCasts()
                     throws Exception
Throws:
Exception

testReduceCastAndConsts

public void testReduceCastAndConsts()
                             throws Exception
Throws:
Exception

testReduceCastsNullable

public void testReduceCastsNullable()
                             throws Exception
Throws:
Exception

testPushAggThroughUnion

public void testPushAggThroughUnion()
                             throws Exception
Throws:
Exception

testFennelBufferCommonRelSubExprRule

public void testFennelBufferCommonRelSubExprRule()
                                          throws Exception
Throws:
Exception