|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.test.AbstractSqlTester net.sf.farrago.test.FarragoSqlOperatorsSuite.FarragoSqlTester
protected static class FarragoSqlOperatorsSuite.FarragoSqlTester
Implementation of AbstractSqlTester
, leveraging connection setup
and result set comparison from the class FarragoTestCase
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eigenbase.sql.test.AbstractSqlTester |
---|
AbstractSqlTester.StringTypeChecker |
Nested classes/interfaces inherited from interface org.eigenbase.sql.test.SqlTester |
---|
SqlTester.TypeChecker, SqlTester.VmName |
Field Summary | |
---|---|
private FarragoTestCase |
farragoTest
Helper. |
private FarragoCalcSystemTest.VirtualMachine |
vm
The virtual machine this test is targeted at. |
private boolean |
vmCanImplement
Whether this virtual machine can implement this operator. |
Fields inherited from class org.eigenbase.sql.test.AbstractSqlTester |
---|
AnyTypeChecker, BooleanTypeChecker, IntegerTypeChecker |
Constructor Summary | |
---|---|
private |
FarragoSqlOperatorsSuite.FarragoSqlTester(FarragoCalcSystemTest.VirtualMachine vm)
|
protected |
FarragoSqlOperatorsSuite.FarragoSqlTester(FarragoCalcSystemTest.VirtualMachine vm,
FarragoTestCase farragoTest)
|
Method Summary | |
---|---|
(package private) void |
check(FarragoCalcSystemTest.VirtualMachine vm,
SqlOperator operator,
String query,
SqlTester.TypeChecker typeChecker,
Object result,
double delta)
|
void |
check(String query,
SqlTester.TypeChecker typeChecker,
Object result,
double delta)
Tests that a SQL query returns a single column with the given type. |
(package private) void |
checkColumnType(FarragoCalcSystemTest.VirtualMachine vm,
SqlOperator operator,
String query,
String type)
|
void |
checkColumnType(String query,
String type)
Checks that a query returns one column of an expected type. |
(package private) void |
checkFails(FarragoCalcSystemTest.VirtualMachine vm,
String expression,
String expectedError,
boolean runtime)
Checks that a scalar expression fails at validate time or runtime on a given virtual machine. |
void |
checkFails(String expression,
String expectedError,
boolean runtime)
Tests that a scalar SQL expression fails at run time. |
private static boolean |
contains(SqlTester.VmName[] vmNames,
String vm)
|
private BasicSqlType |
getColumnType(ResultSetMetaData md,
int column)
|
void |
setFor(SqlOperator operator,
SqlTester.VmName... unimplementedVmNames)
Declares that this test is for a given operator. |
private static RuntimeException |
wrap(Exception e)
|
Methods inherited from class org.eigenbase.sql.test.AbstractSqlTester |
---|
buildQuery, checkAgg, checkBoolean, checkNull, checkScalar, checkScalarApprox, checkScalarExact, checkScalarExact, checkString, checkType, checkWinAgg, generateAggQuery, generateWinAggQuery, getFor, getTypeString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final FarragoTestCase farragoTest
private final FarragoCalcSystemTest.VirtualMachine vm
private boolean vmCanImplement
Constructor Detail |
---|
private FarragoSqlOperatorsSuite.FarragoSqlTester(FarragoCalcSystemTest.VirtualMachine vm) throws Exception
Exception
protected FarragoSqlOperatorsSuite.FarragoSqlTester(FarragoCalcSystemTest.VirtualMachine vm, FarragoTestCase farragoTest) throws Exception
Exception
Method Detail |
---|
public void setFor(SqlOperator operator, SqlTester.VmName... unimplementedVmNames)
SqlTester
setFor
in interface SqlTester
setFor
in class AbstractSqlTester
operator
- OperatorunimplementedVmNames
- Names of virtual machines for which thisprivate static boolean contains(SqlTester.VmName[] vmNames, String vm)
public void checkFails(String expression, String expectedError, boolean runtime)
SqlTester
expression
- SQL scalar expressionexpectedError
- Pattern for expected error. If !runtime, must
include an error location.runtime
- If true, must fail at runtime; if false, must fail at
validate timepublic void checkColumnType(String query, String type)
SqlTester
checkType("VALUES (1 + 2)", "INTEGER NOT NULL")
.
query
- Query expressiontype
- Type stringpublic void check(String query, SqlTester.TypeChecker typeChecker, Object result, double delta)
SqlTester
check("VALUES (1 + 2)", "3", SqlTypeName.Integer);
If result
is null, the expression must yield the SQL NULL
value. If result
is a Pattern
, the
result must match that pattern.
query
- SQL querytypeChecker
- Checks whether the result is the expected type; must
not be nullresult
- Expected resultdelta
- The acceptable tolerance between the expected and actualvoid checkFails(FarragoCalcSystemTest.VirtualMachine vm, String expression, String expectedError, boolean runtime) throws SQLException
SQLException
void check(FarragoCalcSystemTest.VirtualMachine vm, SqlOperator operator, String query, SqlTester.TypeChecker typeChecker, Object result, double delta) throws Exception
Exception
private BasicSqlType getColumnType(ResultSetMetaData md, int column) throws SQLException
SQLException
void checkColumnType(FarragoCalcSystemTest.VirtualMachine vm, SqlOperator operator, String query, String type) throws SQLException
SQLException
private static RuntimeException wrap(Exception e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |