Package org.apache.calcite.sql.test
Class SqlPrettyWriterTest
- java.lang.Object
-
- org.apache.calcite.sql.test.SqlPrettyWriterTest
-
public class SqlPrettyWriterTest extends java.lang.Object
Unit test forSqlPrettyWriter
.You must provide the system property "source.dir".
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NL
-
Constructor Summary
Constructors Constructor Description SqlPrettyWriterTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertExprPrintsTo(boolean newlines, java.lang.String sql, java.lang.String expected)
protected void
assertPrintsTo(boolean newlines, java.lang.String sql, java.lang.String expected)
private void
checkPrettySeparateLines(java.lang.String sql)
protected void
checkSimple(org.apache.calcite.sql.pretty.SqlPrettyWriter prettyWriter, java.lang.String expectedDesc, java.lang.String expected)
protected DiffRepository
getDiffRepos()
protected org.apache.calcite.sql.SqlNode
parseQuery(java.lang.String sql)
Parses a SQL query.void
testBetween()
void
testCase()
void
testCase2()
void
testCast()
void
testClausesNotOnNewLine()
void
testDamiansSubQueryStyle()
void
testDefault()
void
testExplain()
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()
-
-
-
Method Detail
-
getDiffRepos
protected DiffRepository getDiffRepos()
-
parseQuery
protected org.apache.calcite.sql.SqlNode parseQuery(java.lang.String sql)
Parses a SQL query. To use a different parser, override this method.
-
assertPrintsTo
protected void assertPrintsTo(boolean newlines, java.lang.String sql, java.lang.String expected)
-
assertExprPrintsTo
protected void assertExprPrintsTo(boolean newlines, java.lang.String sql, java.lang.String expected)
-
checkSimple
protected void checkSimple(org.apache.calcite.sql.pretty.SqlPrettyWriter prettyWriter, java.lang.String expectedDesc, java.lang.String expected) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testDefault
public void testDefault() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testIndent8
public void testIndent8() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testClausesNotOnNewLine
public void testClausesNotOnNewLine() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testSelectListItemsOnSeparateLines
public void testSelectListItemsOnSeparateLines() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testSelectListExtraIndentFlag
public void testSelectListExtraIndentFlag() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testKeywordsLowerCase
public void testKeywordsLowerCase() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testParenthesizeAllExprs
public void testParenthesizeAllExprs() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testOnlyQuoteIdentifiersWhichNeedIt
public void testOnlyQuoteIdentifiersWhichNeedIt() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testDamiansSubQueryStyle
public void testDamiansSubQueryStyle() throws java.lang.Exception
- Throws:
java.lang.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 java.lang.Exception
- Throws:
java.lang.Exception
-
testWhereListItemsOnSeparateLinesAnd
public void testWhereListItemsOnSeparateLinesAnd() throws java.lang.Exception
- Throws:
java.lang.Exception
-
checkPrettySeparateLines
private void checkPrettySeparateLines(java.lang.String sql)
-
-