public class XMLExpectedResults 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 String |
resultMode |
protected String |
results_dir_loc |
PROP_EXPECTED_RESULTS_DIR_LOC, PROP_EXPECTED_RESULTS_ROOT_DIR
Constructor and Description |
---|
XMLExpectedResults(String querySetIdentifier,
Properties properties) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertStringsMatch(String expectedStr,
String actualStr,
int row,
int col,
String eMsg) |
protected void |
compareIdentifiers(List actualIdentifiers,
List expectedIdentifiers,
List actualDataTypes,
List expectedDatatypes) |
protected void |
compareResults(ResultsHolder actualResults,
ResultsHolder expectedResults,
String eMsg,
boolean isOrdered)
Added primarily for public access to the compare code for testing.
|
Object |
compareResults(String queryIdentifier,
String sql,
ResultSet resultSet,
Throwable actualException,
int testStatus,
boolean isOrdered,
int batchSize,
boolean resultFromQuery)
Compare the results of a query with those that were expected.
|
protected void |
compareResultSets(List actualResults,
List actualDatatypes,
List actualIdentifiers,
List expectedResults,
List expectedDatatypes,
List expectedIdentifiers,
String eMsg)
Compare actual results, identifiers and types with 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. |
protected String |
getShortName(String ident) |
boolean |
isExceptionExpected(String queryidentifier)
Indicates if a query expects to have an
Exception to be thrown when the
query is executed. |
boolean |
isExpectedResultsNeeded() |
static void |
main(String[] args) |
protected void |
validateResultsMode(Properties props) |
protected Properties props
protected String resultMode
protected String generateDir
protected String querySetIdentifier
protected String results_dir_loc
protected Map<String,ResultsHolder> loadedResults
public XMLExpectedResults(String querySetIdentifier, Properties properties)
protected void validateResultsMode(Properties props)
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 boolean isExceptionExpected(String queryidentifier) throws QueryTestFailedException
ExpectedResults
Exception
to be thrown when the
query is executed.isExceptionExpected
in interface ExpectedResults
QueryTestFailedException
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 batchSize, 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.protected void compareResults(ResultsHolder actualResults, ResultsHolder expectedResults, String eMsg, boolean isOrdered) throws QueryTestFailedException
actualResults
- expectedResults
- eMsg
- isOrdered
- QueryTestFailedException
protected void compareResultSets(List actualResults, List actualDatatypes, List actualIdentifiers, List expectedResults, List expectedDatatypes, List expectedIdentifiers, String eMsg) throws QueryTestFailedException
actualResults
- actualDatatypes
- actualIdentifiers
- expectedResults
- expectedDatatypes
- expectedIdentifiers
- eMsg
- QueryTestFailedException
- If comparison fails.protected void compareIdentifiers(List actualIdentifiers, List expectedIdentifiers, List actualDataTypes, List expectedDatatypes) throws QueryTestFailedException
QueryTestFailedException
protected void assertStringsMatch(String expectedStr, String actualStr, int row, int col, String eMsg) throws QueryTestFailedException
QueryTestFailedException
public Object getMetaData(String queryidentifier)
getMetaData
in interface ExpectedResults
public static void main(String[] args)
Copyright © 2019. All rights reserved.