Class ConcurrentTestCommandGenerator.FetchAndCompareCommand
- java.lang.Object
-
- org.apache.calcite.test.concurrent.ConcurrentTestCommandGenerator.AbstractCommand
-
- org.apache.calcite.test.concurrent.ConcurrentTestCommandGenerator.CommandWithTimeout
-
- org.apache.calcite.test.concurrent.ConcurrentTestCommandGenerator.FetchAndCompareCommand
-
- All Implemented Interfaces:
ConcurrentTestCommand
- Enclosing class:
- ConcurrentTestCommandGenerator
private static class ConcurrentTestCommandGenerator.FetchAndCompareCommand extends ConcurrentTestCommandGenerator.CommandWithTimeout
FetchAndCompareCommand executes a previously prepared statement stored in the ConcurrentTestCommandExecutor and then validates the returned rows against expected data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.test.concurrent.ConcurrentTestCommand
ConcurrentTestCommand.ShouldHaveFailedException
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.util.List<java.lang.Object>>
expected
private java.util.List<java.util.List<java.lang.Object>>
result
private static int
STATE_OTHER_VALUE
private static int
STATE_ROW_START
private static int
STATE_STRING_VALUE
private static int
STATE_VALUE_END
private static int
STATE_VALUE_START
-
Constructor Summary
Constructors Modifier Constructor Description private
FetchAndCompareCommand(int timeout, java.lang.String expected)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute(ConcurrentTestCommandExecutor executor)
private void
dumpData(java.lang.String message)
Outputs expected and result data in tabular format.private void
parseExpected(java.lang.String expected)
Parses expected values.private void
reportError(java.lang.String expected, java.lang.String got, int rowNum, int colNum)
private void
test(double expected, double got, int rowNum, int colNum)
private void
test(float expected, float got, int rowNum, int colNum)
private void
test(int expected, int got, int rowNum, int colNum)
private void
test(long expected, long got, int rowNum, int colNum)
private void
test(java.lang.Object expected, java.lang.Object got, int rowNum, int colNum)
private void
testValues()
Validates expected data against retrieved data.private void
testValues(java.util.List<java.lang.Object> expectedRow, java.util.List<java.lang.Object> resultRow, int rowNum)
ValidatesResultSet
against expected data.-
Methods inherited from class org.apache.calcite.test.concurrent.ConcurrentTestCommandGenerator.CommandWithTimeout
setTimeout
-
Methods inherited from class org.apache.calcite.test.concurrent.ConcurrentTestCommandGenerator.AbstractCommand
execute, isFailureExpected, markToFail, markToFail
-
-
-
-
Field Detail
-
expected
private java.util.List<java.util.List<java.lang.Object>> expected
-
result
private java.util.List<java.util.List<java.lang.Object>> result
-
STATE_ROW_START
private static final int STATE_ROW_START
- See Also:
- Constant Field Values
-
STATE_VALUE_START
private static final int STATE_VALUE_START
- See Also:
- Constant Field Values
-
STATE_STRING_VALUE
private static final int STATE_STRING_VALUE
- See Also:
- Constant Field Values
-
STATE_OTHER_VALUE
private static final int STATE_OTHER_VALUE
- See Also:
- Constant Field Values
-
STATE_VALUE_END
private static final int STATE_VALUE_END
- See Also:
- Constant Field Values
-
-
Method Detail
-
doExecute
protected void doExecute(ConcurrentTestCommandExecutor executor) throws java.sql.SQLException
- Specified by:
doExecute
in classConcurrentTestCommandGenerator.AbstractCommand
- Throws:
java.sql.SQLException
-
parseExpected
private void parseExpected(java.lang.String expected)
Parses expected values. SeeConcurrentTestCommandGenerator.addFetchAndCompareCommand(int, int, int, String)
for details on format ofexpected
.- Throws:
java.lang.IllegalStateException
- if there are formatting errors inexpected
-
testValues
private void testValues()
Validates expected data against retrieved data.
-
testValues
private void testValues(java.util.List<java.lang.Object> expectedRow, java.util.List<java.lang.Object> resultRow, int rowNum)
ValidatesResultSet
against expected data.
-
test
private void test(java.lang.Object expected, java.lang.Object got, int rowNum, int colNum)
-
test
private void test(int expected, int got, int rowNum, int colNum)
-
test
private void test(long expected, long got, int rowNum, int colNum)
-
test
private void test(float expected, float got, int rowNum, int colNum)
-
test
private void test(double expected, double got, int rowNum, int colNum)
-
reportError
private void reportError(java.lang.String expected, java.lang.String got, int rowNum, int colNum)
-
dumpData
private void dumpData(java.lang.String message)
Outputs expected and result data in tabular format.
-
-