org.teiid.test.client.impl
Class ExpectedResultsImpl
java.lang.Object
org.teiid.test.client.impl.ExpectedResultsImpl
- All Implemented Interfaces:
- ExpectedResults
public class ExpectedResultsImpl
- extends java.lang.Object
- implements ExpectedResults
Constructor Summary |
ExpectedResultsImpl(java.lang.String querySetIdentifier,
java.util.Properties properties)
|
Method Summary |
java.lang.Object |
compareResults(java.lang.String queryIdentifier,
java.lang.String sql,
java.sql.ResultSet resultSet,
java.lang.Throwable actualException,
int testStatus,
boolean isOrdered,
int updateCnt,
boolean resultFromQuery)
Compare the results of a query with those that were expected. |
java.lang.Object |
getMetaData(java.lang.String queryidentifier)
|
java.lang.String |
getQuerySetID()
Return the unique identifier for this query set. |
java.io.File |
getResultsFile(java.lang.String queryidentifier)
Returns the File location for the actual results for the specified
query identifier. |
boolean |
isExceptionExpected(java.lang.String queryidentifier)
Indicates if a query expects to have an Exception to be thrown when the
query is executed. |
boolean |
isExpectedResultsNeeded()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
props
protected java.util.Properties props
resultMode
protected int resultMode
generateDir
protected java.lang.String generateDir
querySetIdentifier
protected java.lang.String querySetIdentifier
results_dir_loc
protected java.lang.String results_dir_loc
loadedResults
protected java.util.Map<java.lang.String,ResultsHolder> loadedResults
ExpectedResultsImpl
public ExpectedResultsImpl(java.lang.String querySetIdentifier,
java.util.Properties properties)
isExceptionExpected
public boolean isExceptionExpected(java.lang.String queryidentifier)
throws QueryTestFailedException
- Description copied from interface:
ExpectedResults
- Indicates if a query expects to have an
Exception
to be thrown when the
query is executed.
- Specified by:
isExceptionExpected
in interface ExpectedResults
- Returns:
- boolean true if the query expects an exception to be thrown
- Throws:
QueryTestFailedException
isExpectedResultsNeeded
public boolean isExpectedResultsNeeded()
- Specified by:
isExpectedResultsNeeded
in interface ExpectedResults
- Returns:
- See Also:
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
getQuerySetID
public java.lang.String getQuerySetID()
- Description copied from interface:
ExpectedResults
- Return the unique identifier for this query set.
- Specified by:
getQuerySetID
in interface ExpectedResults
- Returns:
getResultsFile
public java.io.File getResultsFile(java.lang.String queryidentifier)
throws QueryTestFailedException
- Description copied from interface:
ExpectedResults
- Returns the
File
location for the actual results for the specified
query identifier.
- Specified by:
getResultsFile
in interface ExpectedResults
- Returns:
- File location for actual results for the specified query
- Throws:
QueryTestFailedException
compareResults
public java.lang.Object compareResults(java.lang.String queryIdentifier,
java.lang.String sql,
java.sql.ResultSet resultSet,
java.lang.Throwable actualException,
int testStatus,
boolean isOrdered,
int updateCnt,
boolean resultFromQuery)
throws QueryTestFailedException
- Compare the results of a query with those that were expected.
- Specified by:
compareResults
in interface ExpectedResults
- Parameters:
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.
- Returns:
- The response time for comparing the first batch (sizes) of
resutls.
- Throws:
QueryTestFailedException
- If comparison fails.
getMetaData
public java.lang.Object getMetaData(java.lang.String queryidentifier)
- Specified by:
getMetaData
in interface ExpectedResults
Copyright © 2011. All Rights Reserved.