org.eigenbase.test.concurrent
Class ConcurrentTestCommandGenerator.FetchAndCompareCommand
java.lang.Object
org.eigenbase.test.concurrent.ConcurrentTestCommandGenerator.AbstractCommand
org.eigenbase.test.concurrent.ConcurrentTestCommandGenerator.CommandWithTimeout
org.eigenbase.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.
Method Summary |
protected void |
doExecute(ConcurrentTestCommandExecutor executor)
|
private void |
dumpData(String message)
Outputs expected and result data in tabular format. |
private void |
parseExpected(String expected)
Parses expected values. |
private void |
reportError(String expected,
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(Object expected,
Object got,
int rowNum,
int colNum)
|
private void |
testValues()
Validates expected data against retrieved data. |
private void |
testValues(List<Object> expectedRow,
List<Object> resultRow,
int rowNum)
Validates ResultSet against expected data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
expected
private List<List<Object>> expected
result
private List<List<Object>> result
ConcurrentTestCommandGenerator.FetchAndCompareCommand
private ConcurrentTestCommandGenerator.FetchAndCompareCommand(int timeout,
String expected)
doExecute
protected void doExecute(ConcurrentTestCommandExecutor executor)
throws SQLException
- Specified by:
doExecute
in class ConcurrentTestCommandGenerator.AbstractCommand
- Throws:
SQLException
parseExpected
private void parseExpected(String expected)
- Parses expected values. See
ConcurrentTestCommandGenerator.addFetchAndCompareCommand(int,
int, int, String)
for details on format of expected
.
- Throws:
IllegalStateException
- if there are formatting errors in
expected
testValues
private void testValues()
- Validates expected data against retrieved data.
testValues
private void testValues(List<Object> expectedRow,
List<Object> resultRow,
int rowNum)
- Validates
ResultSet
against expected data.
test
private void test(Object expected,
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(String expected,
String got,
int rowNum,
int colNum)
dumpData
private void dumpData(String message)
- Outputs expected and result data in tabular format.