public class ExpectedResultsImpl extends Object implements ExpectedResults
Modifier and Type | Field and Description |
---|---|
protected String |
generateDir |
protected Map<String,ResultsHolder> |
loadedResults |
protected Properties |
props |
protected String |
querySetIdentifier |
protected int |
resultMode |
protected String |
results_dir_loc |
PROP_EXPECTED_RESULTS_DIR_LOC, PROP_EXPECTED_RESULTS_ROOT_DIR
Constructor and Description |
---|
ExpectedResultsImpl(String querySetIdentifier,
Properties properties) |
Modifier and Type | Method and Description |
---|---|
Object |
compareResults(String queryIdentifier,
String sql,
ResultSet resultSet,
Throwable actualException,
int testStatus,
boolean isOrdered,
int updateCnt,
boolean resultFromQuery)
Compare the results of a query with those that were expected.
|
Object |
getMetaData(String queryidentifier) |
String |
getQuerySetID()
Return the unique identifier for this query set.
|
File |
getResultsFile(String queryidentifier)
Returns the
File location for the actual results for the specified
query identifier. |
boolean |
isExceptionExpected(String queryidentifier)
Indicates if a query expects to have an
Exception to be thrown when the
query is executed. |
boolean |
isExpectedResultsNeeded() |
protected Properties props
protected int resultMode
protected String generateDir
protected String querySetIdentifier
protected String results_dir_loc
protected Map<String,ResultsHolder> loadedResults
public ExpectedResultsImpl(String querySetIdentifier, Properties properties)
public boolean isExceptionExpected(String queryidentifier) throws QueryTestFailedException
ExpectedResults
Exception
to be thrown when the
query is executed.isExceptionExpected
in interface ExpectedResults
QueryTestFailedException
public boolean isExpectedResultsNeeded()
isExpectedResultsNeeded
in interface ExpectedResults
Return true if the expected results file is needed in the test. Either
for comparison or generation. It will return false when
the option TestProperties.RESULT_MODES.NONE
public String getQuerySetID()
ExpectedResults
getQuerySetID
in interface ExpectedResults
public File getResultsFile(String queryidentifier) throws QueryTestFailedException
ExpectedResults
File
location for the actual results for the specified
query identifier.getResultsFile
in interface ExpectedResults
QueryTestFailedException
public Object compareResults(String queryIdentifier, String sql, ResultSet resultSet, Throwable actualException, int testStatus, boolean isOrdered, int updateCnt, boolean resultFromQuery) throws QueryTestFailedException
compareResults
in interface ExpectedResults
expectedResults
- The expected results.results
- The actual results - may be null if
actualException
.actualException
- The actual exception recieved durring query execution - may be
null if results
.isOrdered
- Are the actual results ordered?batchSize
- Size of the batch(es) used in determining when the first batch
of results were read.QueryTestFailedException
- If comparison fails.public Object getMetaData(String queryidentifier)
getMetaData
in interface ExpectedResults
Copyright © 2019. All rights reserved.