org.eigenbase.test
Class SqlToRelTestBase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.test.SqlToRelTestBase
All Implemented Interfaces:
Test
Direct Known Subclasses:
RelMetadataTest, RelOptTestBase, SqlToRelConverterTest

public abstract class SqlToRelTestBase
extends TestCase

SqlToRelTestBase is an abstract base for tests which involve conversion from SQL to relational algebra.

SQL statements to be translated can use the schema defined in MockCatalogReader; note that this is slightly different from Farrago's SALES schema. If you get a parser or validator error from your test SQL, look down in the stack until you see "Caused by", which will usually tell you the real error.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/test/SqlToRelTestBase.java#18 $
Author:
jhyde

Nested Class Summary
private static class SqlToRelTestBase.DelegatingRelOptTable
           
private static class SqlToRelTestBase.FarragoTestValidator
           
private static class SqlToRelTestBase.MockRelOptConnection
          Mock implementation of RelOptConnection, contains a SqlToRelTestBase.MockRelOptSchema.
protected static class SqlToRelTestBase.MockRelOptSchema
          Mock implementation of RelOptSchema.
static interface SqlToRelTestBase.Tester
          Helper class which contains default implementations of methods used for running sql-to-rel conversion tests.
static class SqlToRelTestBase.TesterImpl
          Default implementation of SqlToRelTestBase.Tester, using mock classes SqlToRelTestBase.MockRelOptSchema, SqlToRelTestBase.MockRelOptConnection and MockRelOptPlanner.
 
Field Summary
protected static String NL
           
protected  SqlToRelTestBase.Tester tester
           
 
Constructor Summary
SqlToRelTestBase()
           
SqlToRelTestBase(String name)
           
 
Method Summary
protected  SqlToRelTestBase.Tester createTester()
           
protected  DiffRepository getDiffRepos()
          Returns the default diff repository for this test, or null if there is no repository.
 
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

NL

protected static final String NL

tester

protected final SqlToRelTestBase.Tester tester
Constructor Detail

SqlToRelTestBase

public SqlToRelTestBase()

SqlToRelTestBase

public SqlToRelTestBase(String name)
Method Detail

createTester

protected SqlToRelTestBase.Tester createTester()

getDiffRepos

protected DiffRepository getDiffRepos()
Returns the default diff repository for this test, or null if there is no repository.

The default implementation returns null.

Sub-classes that want to use a diff repository can override. Sub-sub-classes can override again, inheriting test cases and overriding selected test results.

And individual test cases can override by providing a different tester object.

Returns:
Diff repository