org.eigenbase.sql.test
Class SqlPrettyWriterTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.sql.test.SqlPrettyWriterTest
All Implemented Interfaces:
Test

public class SqlPrettyWriterTest
extends TestCase

Unit test for SqlPrettyWriter.

You must provide the system property "source.dir".

Since:
2005/8/24
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/test/SqlPrettyWriterTest.java#14 $
Author:
Julian Hyde

Field Summary
static String NL
           
 
Constructor Summary
SqlPrettyWriterTest(String testCaseName)
           
 
Method Summary
 void _testExplain()
           
protected  void assertExprPrintsTo(boolean newlines, String sql, String expected)
           
protected  void assertPrintsTo(boolean newlines, String sql, String expected)
           
private  void checkPrettySeparateLines(String sql)
           
protected  void checkSimple(SqlPrettyWriter prettyWriter, String expectedDesc, String expected)
           
protected  DiffRepository getDiffRepos()
           
protected  SqlNode parseQuery(String sql)
          Parses a SQL query.
 void testBetween()
           
 void testCase()
           
 void testCase2()
           
 void testCast()
           
 void testClausesNotOnNewLine()
           
 void testDamiansSubqueryStyle()
           
 void testDefault()
           
 void testIndent8()
           
 void testInnerJoin()
           
 void testKeywordsLowerCase()
           
 void testLiteralChain()
           
 void testMultiset()
           
 void testOnlyQuoteIdentifiersWhichNeedIt()
           
 void testOverlaps()
           
 void testParenthesizeAllExprs()
           
 void testSelectListExtraIndentFlag()
           
 void testSelectListItemsOnSeparateLines()
           
 void testUnion()
           
 void testWhereListItemsOnSeparateLinesAnd()
           
 void testWhereListItemsOnSeparateLinesOr()
           
 
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

public static final String NL
Constructor Detail

SqlPrettyWriterTest

public SqlPrettyWriterTest(String testCaseName)
                    throws Exception
Throws:
Exception
Method Detail

getDiffRepos

protected DiffRepository getDiffRepos()

parseQuery

protected SqlNode parseQuery(String sql)
Parses a SQL query. To use a different parser, override this method.


assertPrintsTo

protected void assertPrintsTo(boolean newlines,
                              String sql,
                              String expected)

assertExprPrintsTo

protected void assertExprPrintsTo(boolean newlines,
                                  String sql,
                                  String expected)

checkSimple

protected void checkSimple(SqlPrettyWriter prettyWriter,
                           String expectedDesc,
                           String expected)
                    throws Exception
Throws:
Exception

testDefault

public void testDefault()
                 throws Exception
Throws:
Exception

testIndent8

public void testIndent8()
                 throws Exception
Throws:
Exception

testClausesNotOnNewLine

public void testClausesNotOnNewLine()
                             throws Exception
Throws:
Exception

testSelectListItemsOnSeparateLines

public void testSelectListItemsOnSeparateLines()
                                        throws Exception
Throws:
Exception

testSelectListExtraIndentFlag

public void testSelectListExtraIndentFlag()
                                   throws Exception
Throws:
Exception

testKeywordsLowerCase

public void testKeywordsLowerCase()
                           throws Exception
Throws:
Exception

testParenthesizeAllExprs

public void testParenthesizeAllExprs()
                              throws Exception
Throws:
Exception

testOnlyQuoteIdentifiersWhichNeedIt

public void testOnlyQuoteIdentifiersWhichNeedIt()
                                         throws Exception
Throws:
Exception

testDamiansSubqueryStyle

public void testDamiansSubqueryStyle()
                              throws Exception
Throws:
Exception

_testExplain

public void _testExplain()

testCase

public void testCase()

testCase2

public void testCase2()

testBetween

public void testBetween()

testCast

public void testCast()

testLiteralChain

public void testLiteralChain()

testOverlaps

public void testOverlaps()

testUnion

public void testUnion()

testMultiset

public void testMultiset()

testInnerJoin

public void testInnerJoin()

testWhereListItemsOnSeparateLinesOr

public void testWhereListItemsOnSeparateLinesOr()
                                         throws Exception
Throws:
Exception

testWhereListItemsOnSeparateLinesAnd

public void testWhereListItemsOnSeparateLinesAnd()
                                          throws Exception
Throws:
Exception

checkPrettySeparateLines

private void checkPrettySeparateLines(String sql)