org.eigenbase.test
Class SqlValidatorTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.eigenbase.test.SqlValidatorTestCase
org.eigenbase.test.SqlValidatorTest
- All Implemented Interfaces:
- Test
- Direct Known Subclasses:
- SqlTestGen.SqlValidatorSpooler
public class SqlValidatorTest
- extends SqlValidatorTestCase
Concrete child class of SqlValidatorTestCase
, containing lots of unit
tests.
If you want to run these same tests in a different environment, create a
derived class whose SqlValidatorTestCase.getTester(org.eigenbase.sql.validate.SqlConformance)
returns a different implementation of
SqlValidatorTestCase.Tester
.
- Since:
- Jan 14, 2004
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/test/SqlValidatorTest.java#91 $
- Author:
- Wael Chatila
Methods inherited from class org.eigenbase.test.SqlValidatorTestCase |
assertExceptionIsThrown, check, checkCharset, checkCollation, checkColumnType, checkEx, checkExp, checkExpFails, checkExpType, checkFails, checkIntervalConv, checkResultType, checkWholeExpFails, getTester |
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 |
todo
protected static final boolean todo
- Deprecated. Deprecated so that usages of this constant will show up in
yellow in Intellij and maybe someone will fix them.
- See Also:
- Constant Field Values
todoTypeInference
public static final boolean todoTypeInference
- See Also:
- Constant Field Values
ANY
private static final String ANY
- See Also:
- Constant Field Values
logger
protected final Logger logger
ERR_IN_VALUES_INCOMPATIBLE
private final String ERR_IN_VALUES_INCOMPATIBLE
- See Also:
- Constant Field Values
ERR_IN_OPERANDS_INCOMPATIBLE
private final String ERR_IN_OPERANDS_INCOMPATIBLE
- See Also:
- Constant Field Values
SqlValidatorTest
public SqlValidatorTest(String name)
testMultipleSameAsPass
public void testMultipleSameAsPass()
testMultipleDifferentAs
public void testMultipleDifferentAs()
testTypeOfAs
public void testTypeOfAs()
testTypesLiterals
public void testTypesLiterals()
testBooleans
public void testBooleans()
testAndOrIllegalTypesFails
public void testAndOrIllegalTypesFails()
testNotIllegalTypeFails
public void testNotIllegalTypeFails()
testIs
public void testIs()
testIsFails
public void testIsFails()
testScalars
public void testScalars()
testScalarsFails
public void testScalarsFails()
testNumbers
public void testNumbers()
testPrefix
public void testPrefix()
testEqualNotEqual
public void testEqualNotEqual()
testEqualNotEqualFails
public void testEqualNotEqualFails()
testBinaryString
public void testBinaryString()
testBinaryStringFails
public void testBinaryStringFails()
testStringLiteral
public void testStringLiteral()
testStringLiteralBroken
public void testStringLiteralBroken()
testArithmeticOperators
public void testArithmeticOperators()
testArithmeticOperatorsFails
public void testArithmeticOperatorsFails()
testCaseExpression
public void testCaseExpression()
testCaseExpressionTypes
public void testCaseExpressionTypes()
testCaseExpressionFails
public void testCaseExpressionFails()
testNullIf
public void testNullIf()
testCoalesce
public void testCoalesce()
testCoalesceFails
public void testCoalesceFails()
testStringCompare
public void testStringCompare()
testStringCompareType
public void testStringCompareType()
testConcat
public void testConcat()
testConcatWithCharset
public void testConcatWithCharset()
testConcatFails
public void testConcatFails()
testBetween
public void testBetween()
testCharsetMismatch
public void testCharsetMismatch()
_testSimpleCollate
public void _testSimpleCollate()
_testCharsetAndCollateMismatch
public void _testCharsetAndCollateMismatch()
_testDyadicCollateCompare
public void _testDyadicCollateCompare()
_testDyadicCompareCollateFails
public void _testDyadicCompareCollateFails()
_testDyadicCollateOperator
public void _testDyadicCollateOperator()
testCharLength
public void testCharLength()
testUpperLower
public void testUpperLower()
testPosition
public void testPosition()
testTrim
public void testTrim()
testTrimFails
public void testTrimFails()
_testConvertAndTranslate
public void _testConvertAndTranslate()
testOverlay
public void testOverlay()
testSubstring
public void testSubstring()
testSubstringFails
public void testSubstringFails()
testLikeAndSimilar
public void testLikeAndSimilar()
_testLikeAndSimilarFails
public void _testLikeAndSimilarFails()
testNull
public void testNull()
testNullCast
public void testNullCast()
testCastTypeToType
public void testCastTypeToType()
testCastFails
public void testCastFails()
testCastBinaryLiteral
public void testCastBinaryLiteral()
testDateTime
public void testDateTime()
testDateTimeCast
public void testDateTimeCast()
- Tests casting to/from date/time types.
testInvalidFunction
public void testInvalidFunction()
testJdbcFunctionCall
public void testJdbcFunctionCall()
testQuotedFunction
public void testQuotedFunction()
testRowtype
public void testRowtype()
testRow
public void testRow()
testMultiset
public void testMultiset()
testMultisetSetOperators
public void testMultisetSetOperators()
testSubMultisetOf
public void testSubMultisetOf()
testElement
public void testElement()
testMemberOf
public void testMemberOf()
testIsASet
public void testIsASet()
testCardinality
public void testCardinality()
testIntervalTimeUnitEnumeration
public void testIntervalTimeUnitEnumeration()
testIntervalMonthsConversion
public void testIntervalMonthsConversion()
testIntervalMillisConversion
public void testIntervalMillisConversion()
subTestIntervalYearPositive
public void subTestIntervalYearPositive()
- Runs tests for INTERVAL... YEAR that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalYearToMonthPositive
public void subTestIntervalYearToMonthPositive()
- Runs tests for INTERVAL... YEAR TO MONTH that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalMonthPositive
public void subTestIntervalMonthPositive()
- Runs tests for INTERVAL... MONTH that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalDayPositive
public void subTestIntervalDayPositive()
- Runs tests for INTERVAL... DAY that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalDayToHourPositive
public void subTestIntervalDayToHourPositive()
subTestIntervalDayToMinutePositive
public void subTestIntervalDayToMinutePositive()
- Runs tests for INTERVAL... DAY TO MINUTE that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalDayToSecondPositive
public void subTestIntervalDayToSecondPositive()
- Runs tests for INTERVAL... DAY TO SECOND that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalHourPositive
public void subTestIntervalHourPositive()
- Runs tests for INTERVAL... HOUR that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalHourToMinutePositive
public void subTestIntervalHourToMinutePositive()
- Runs tests for INTERVAL... HOUR TO MINUTE that should pass both parser
and validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalHourToSecondPositive
public void subTestIntervalHourToSecondPositive()
- Runs tests for INTERVAL... HOUR TO SECOND that should pass both parser
and validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalMinutePositive
public void subTestIntervalMinutePositive()
- Runs tests for INTERVAL... MINUTE that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalMinuteToSecondPositive
public void subTestIntervalMinuteToSecondPositive()
- Runs tests for INTERVAL... MINUTE TO SECOND that should pass both parser
and validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalSecondPositive
public void subTestIntervalSecondPositive()
- Runs tests for INTERVAL... SECOND that should pass both parser and
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXPositive() tests.
subTestIntervalYearNegative
public void subTestIntervalYearNegative()
- Runs tests for INTERVAL... YEAR that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalYearToMonthNegative
public void subTestIntervalYearToMonthNegative()
- Runs tests for INTERVAL... YEAR TO MONTH that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalMonthNegative
public void subTestIntervalMonthNegative()
- Runs tests for INTERVAL... MONTH that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalDayNegative
public void subTestIntervalDayNegative()
- Runs tests for INTERVAL... DAY that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalDayToHourNegative
public void subTestIntervalDayToHourNegative()
- Runs tests for INTERVAL... DAY TO HOUR that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalDayToMinuteNegative
public void subTestIntervalDayToMinuteNegative()
- Runs tests for INTERVAL... DAY TO MINUTE that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalDayToSecondNegative
public void subTestIntervalDayToSecondNegative()
- Runs tests for INTERVAL... DAY TO SECOND that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalHourNegative
public void subTestIntervalHourNegative()
- Runs tests for INTERVAL... HOUR that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalHourToMinuteNegative
public void subTestIntervalHourToMinuteNegative()
- Runs tests for INTERVAL... HOUR TO MINUTE that should pass parser but
fail validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalHourToSecondNegative
public void subTestIntervalHourToSecondNegative()
- Runs tests for INTERVAL... HOUR TO SECOND that should pass parser but
fail validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalMinuteNegative
public void subTestIntervalMinuteNegative()
- Runs tests for INTERVAL... MINUTE that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalMinuteToSecondNegative
public void subTestIntervalMinuteToSecondNegative()
- Runs tests for INTERVAL... MINUTE TO SECOND that should pass parser but
fail validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
subTestIntervalSecondNegative
public void subTestIntervalSecondNegative()
- Runs tests for INTERVAL... SECOND that should pass parser but fail
validator. A substantially identical set of tests exists in
SqlParserTest, and any changes here should be synchronized there.
Similarly, any changes to tests here should be echoed appropriately to
each of the other 12 subTestIntervalXXXNegative() tests.
testIntervalLiterals
public void testIntervalLiterals()
testIntervalOperators
public void testIntervalOperators()
testNumericOperators
public void testNumericOperators()
testFloorCeil
public void testFloorCeil()
checkWin
protected void checkWin(String sql,
String expectedMsgPattern)
checkWinClauseExp
public void checkWinClauseExp(String sql,
String expectedMsgPattern)
checkWinFuncExpWithWinClause
public void checkWinFuncExpWithWinClause(String sql,
String expectedMsgPattern)
checkWinFuncExp
public void checkWinFuncExp(String sql,
String expectedMsgPattern)
_testWinPartClause
public void _testWinPartClause()
testWindowFunctions
public void testWindowFunctions()
testInlineWinDef
public void testInlineWinDef()
testPartitionByExpr
public void testPartitionByExpr()
testWindowClause
public void testWindowClause()
testWindowClause2
public void testWindowClause2()
testWindowClauseWithSubquery
public void testWindowClauseWithSubquery()
testWindowNegative
public void testWindowNegative()
checkNegWindow
private void checkNegWindow(String s,
String msg)
testWindowPartial
public void testWindowPartial()
testOneWinFunc
public void testOneWinFunc()
testNameResolutionInValuesClause
public void testNameResolutionInValuesClause()
testNestedFrom
public void testNestedFrom()
testAmbiguousColumn
public void testAmbiguousColumn()
testExpandStar
public void testExpandStar()
testAsColumnList
public void testAsColumnList()
_testAmbiguousColumnInIn
public void _testAmbiguousColumnInIn()
testInList
public void testInList()
testInSubquery
public void testInSubquery()
testDoubleNoAlias
public void testDoubleNoAlias()
testDuplicateColumnAliasIsOK
public void testDuplicateColumnAliasIsOK()
testDuplicateTableAliasFails
public void testDuplicateTableAliasFails()
testInvalidGroupBy
public void testInvalidGroupBy()
testSingleNoAlias
public void testSingleNoAlias()
testObscuredAliasFails
public void testObscuredAliasFails()
testFromReferenceFails
public void testFromReferenceFails()
testWhereReference
public void testWhereReference()
testUnionNameResolution
public void testUnionNameResolution()
testUnionCountMismatchFails
public void testUnionCountMismatchFails()
testUnionCountMismatcWithValuesFails
public void testUnionCountMismatcWithValuesFails()
testUnionTypeMismatchFails
public void testUnionTypeMismatchFails()
testUnionTypeMismatchWithStarFails
public void testUnionTypeMismatchWithStarFails()
testUnionTypeMismatchWithValuesFails
public void testUnionTypeMismatchWithValuesFails()
testValuesTypeMismatchFails
public void testValuesTypeMismatchFails()
testNaturalCrossJoinFails
public void testNaturalCrossJoinFails()
testCrossJoinUsingFails
public void testCrossJoinUsingFails()
testJoinUsing
public void testJoinUsing()
testCrossJoinOnFails
public void testCrossJoinOnFails()
testInnerJoinWithoutUsingOrOnFails
public void testInnerJoinWithoutUsingOrOnFails()
testNaturalJoinWithOnFails
public void testNaturalJoinWithOnFails()
testNaturalJoinWithUsing
public void testNaturalJoinWithUsing()
testNaturalJoinIncompatibleDatatype
public void testNaturalJoinIncompatibleDatatype()
testJoinUsingIncompatibleDatatype
public void testJoinUsingIncompatibleDatatype()
testJoinUsingInvalidColsFails
public void testJoinUsingInvalidColsFails()
testJoinUsingDupColsFails
public void testJoinUsingDupColsFails()
testJoinRowType
public void testJoinRowType()
_testJoinUsing
public void _testJoinUsing()
testWhere
public void testWhere()
testOn
public void testOn()
testHaving
public void testHaving()
testHavingBetween
public void testHavingBetween()
testLarge
public void testLarge()
- Tests a large scalar expression, which will expose any O(n^2) algorithms
lurking in the validation process.
list
private String list(String sep,
String before,
int count)
testOrder
public void testOrder()
testOrderUnion
public void testOrderUnion()
testOrderGroup
public void testOrderGroup()
- Tests validation of the ORDER BY clause when GROUP BY is present.
testGroup
public void testGroup()
testGroupByCorrelatedColumnFails
public void testGroupByCorrelatedColumnFails()
testGroupExpressionEquivalence
public void testGroupExpressionEquivalence()
testGroupExpressionEquivalenceId
public void testGroupExpressionEquivalenceId()
_testGroupExpressionEquivalenceCorrelated
public void _testGroupExpressionEquivalenceCorrelated()
_testGroupExpressionEquivalenceParams
public void _testGroupExpressionEquivalenceParams()
testGroupExpressionEquivalenceLiteral
public void testGroupExpressionEquivalenceLiteral()
testGroupExpressionEquivalenceStringLiteral
public void testGroupExpressionEquivalenceStringLiteral()
testGroupAgg
public void testGroupAgg()
testNestedAggFails
public void testNestedAggFails()
testAggregateInGroupByFails
public void testAggregateInGroupByFails()
testAggregateInOrderByFails
public void testAggregateInOrderByFails()
testCorrelatingVariables
public void testCorrelatingVariables()
testIntervalCompare
public void testIntervalCompare()
testOverlaps
public void testOverlaps()
testExtract
public void testExtract()
testCastToInterval
public void testCastToInterval()
testMinusDateOperator
public void testMinusDateOperator()
testBind
public void testBind()
testUnnest
public void testUnnest()
testCorrelationJoin
public void testCorrelationJoin()
testStructuredTypes
public void testStructuredTypes()
testLateral
public void testLateral()
testCollect
public void testCollect()
testFusion
public void testFusion()
testCountFunction
public void testCountFunction()
testLastFunction
public void testLastFunction()
testMinMaxFunctions
public void testMinMaxFunctions()
testFunctionalDistinct
public void testFunctionalDistinct()
testSelectDistinct
public void testSelectDistinct()
testExplicitTable
public void testExplicitTable()
testCollectionTable
public void testCollectionTable()
testCollectionTableWithCursorParam
public void testCollectionTableWithCursorParam()
testScalarSubQuery
public void testScalarSubQuery()
_testSubqueryInOnClause
public void _testSubqueryInOnClause()
testRecordType
public void testRecordType()
testSample
public void testSample()
testRewriteWithoutIdentifierExpansion
public void testRewriteWithoutIdentifierExpansion()
testRewriteWithIdentifierExpansion
public void testRewriteWithIdentifierExpansion()
testRewriteWithColumnReferenceExpansion
public void testRewriteWithColumnReferenceExpansion()
testRewriteWithColumnReferenceExpansionAndFromAlias
public void testRewriteWithColumnReferenceExpansionAndFromAlias()
testCoalesceWithoutRewrite
public void testCoalesceWithoutRewrite()
testCoalesceWithRewrite
public void testCoalesceWithRewrite()
testValuesRewrite
public void testValuesRewrite()
_testValuesWithAggFuncs
public void _testValuesWithAggFuncs()
testNew
public void testNew()