org.eigenbase.relopt.volcano
Class VolcanoPlannerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.relopt.volcano.VolcanoPlannerTest
All Implemented Interfaces:
Test

public class VolcanoPlannerTest
extends TestCase

A VolcanoPlannerTest is a unit-test for the optimizer.

Since:
Mar 19, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/relopt/volcano/VolcanoPlannerTest.java#2 $
Author:
John V. Sichi

Nested Class Summary
private static class VolcanoPlannerTest.GoodRemoveSingleRule
           
private static class VolcanoPlannerTest.GoodSingleRule
           
private static class VolcanoPlannerTest.NoneLeafRel
           
private static class VolcanoPlannerTest.NoneSingleRel
           
private static class VolcanoPlannerTest.PhysLeafRel
           
private static class VolcanoPlannerTest.PhysLeafRule
           
private static class VolcanoPlannerTest.PhysProjectRule
           
private static class VolcanoPlannerTest.PhysSingleRel
           
(package private)  class VolcanoPlannerTest.PhysToIteratorConverter
           
private static class VolcanoPlannerTest.ReformedRemoveSingleRule
           
private static class VolcanoPlannerTest.ReformedSingleRule
           
private static class VolcanoPlannerTest.TestEnvironment
           
private static class VolcanoPlannerTest.TestLeafRel
           
private static class VolcanoPlannerTest.TestListener
           
private static class VolcanoPlannerTest.TestSingleRel
           
 
Field Summary
private static CallingConvention PHYS_CALLING_CONVENTION
          Private calling convention representing a physical implementation.
 
Constructor Summary
VolcanoPlannerTest(String name)
           
 
Method Summary
private  void checkEvent(List<RelOptListener.RelEvent> eventList, int iEvent, Class expectedEventClass, RelNode expectedRel, Class<? extends RelOptRule> expectedRuleClass)
           
(package private) static RelOptCluster newCluster(VolcanoPlanner planner)
           
private  void removeTrivialProject(boolean useRule)
           
 void testListener()
          Tests whether planner correctly notifies listeners of events.
 void testRemoveSingleGood()
          This always worked (in contrast to testRemoveSingleReformed) because it uses a completely-physical pattern (requiring GoodSingleRule to fire first).
 void testRemoveSingleReformed()
          Previously, this didn't work because ReformedRemoveSingleRule uses a pattern which spans calling conventions.
 void testTransformLeaf()
          Tests transformation of a leaf from NONE to PHYS.
 void testTransformSingleGood()
          Tests transformation of a single+leaf from NONE to PHYS.
 void testTransformSingleReformed()
          Tests transformation of a single+leaf from NONE to PHYS.
 void testWithoutRemoveTrivialProject()
           
 void testWithRemoveTrivialProject()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

PHYS_CALLING_CONVENTION

private static final CallingConvention PHYS_CALLING_CONVENTION
Private calling convention representing a physical implementation.

Constructor Detail

VolcanoPlannerTest

public VolcanoPlannerTest(String name)
Method Detail

newCluster

static RelOptCluster newCluster(VolcanoPlanner planner)

testTransformLeaf

public void testTransformLeaf()
Tests transformation of a leaf from NONE to PHYS.


testTransformSingleGood

public void testTransformSingleGood()
Tests transformation of a single+leaf from NONE to PHYS.


testTransformSingleReformed

public void testTransformSingleReformed()
Tests transformation of a single+leaf from NONE to PHYS. In the past, this one didn't work due to the definition of ReformedSingleRule.


removeTrivialProject

private void removeTrivialProject(boolean useRule)

testWithRemoveTrivialProject

public void testWithRemoveTrivialProject()

testWithoutRemoveTrivialProject

public void testWithoutRemoveTrivialProject()

testRemoveSingleReformed

public void testRemoveSingleReformed()
Previously, this didn't work because ReformedRemoveSingleRule uses a pattern which spans calling conventions.


testRemoveSingleGood

public void testRemoveSingleGood()
This always worked (in contrast to testRemoveSingleReformed) because it uses a completely-physical pattern (requiring GoodSingleRule to fire first).


testListener

public void testListener()
Tests whether planner correctly notifies listeners of events.


checkEvent

private void checkEvent(List<RelOptListener.RelEvent> eventList,
                        int iEvent,
                        Class expectedEventClass,
                        RelNode expectedRel,
                        Class<? extends RelOptRule> expectedRuleClass)