Class SqlPrettyWriterTest


  • public class SqlPrettyWriterTest
    extends java.lang.Object
    Unit test for SqlPrettyWriter.

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

    • Field Detail

      • NL

        public static final java.lang.String NL
    • Constructor Detail

      • SqlPrettyWriterTest

        public SqlPrettyWriterTest()
    • Method Detail

      • 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)