org.teiid.test.client
Interface ResultsGenerator

All Known Implementing Classes:
ResultsGeneratorImpl, XMLGenerateResults

public interface ResultsGenerator

The ResultsGenerator represents how a new set of results will be written for a given querySetID and queryIdentifier. The implementor should write out one result file for each call that is made to generateQueryResultFile(String, String, String, ResultSet, Throwable, int), however, it will control the format of the content. The testing process will only generate a new result file when the result mode is TestClientTransaction.RESULT_MODES#GENERATE

Author:
vanhalbert

Field Summary
static java.lang.String PROP_GENERATE_DIR
          The PROP_GENERATE_DIR property indicates where newly generated results files should be written to.
 
Method Summary
 java.lang.String generateErrorFile(java.lang.String querySetID, java.lang.String queryIdentifier, java.lang.String sql, java.sql.ResultSet resultSet, java.lang.Throwable queryError, java.lang.Object results)
          Call to generate an error file as the result of incompatibilities in the comparison of the expected results to the actual results.
 void generateQueryResultFile(java.lang.String querySetID, java.lang.String queryIdentfier, java.lang.String query, java.sql.ResultSet result, java.lang.Throwable queryError, int testStatus)
          Call to generate the results file from an executed query.
 java.lang.String getGenerateDir()
          Return the location that results will be generated to.
 java.lang.String getOutputDir()
          Return the location that output files are written to.
 

Field Detail

PROP_GENERATE_DIR

static final java.lang.String PROP_GENERATE_DIR
The PROP_GENERATE_DIR property indicates where newly generated results files should be written to. The newly generated files should be written to a different location than the existing expected results.

See Also:
Constant Field Values
Method Detail

getOutputDir

java.lang.String getOutputDir()
Return the location that output files are written to.

Returns:
Since:

getGenerateDir

java.lang.String getGenerateDir()
Return the location that results will be generated to.

Returns:
Since:

generateQueryResultFile

void generateQueryResultFile(java.lang.String querySetID,
                             java.lang.String queryIdentfier,
                             java.lang.String query,
                             java.sql.ResultSet result,
                             java.lang.Throwable queryError,
                             int testStatus)
                             throws QueryTestFailedException
Call to generate the results file from an executed query. If an exception occurred, it is considered the result from the query. The file created based on the result should be able to be used as the expected result when query tests are run with in the resultmode of "compare".

Parameters:
querySetID -
queryIdentfier -
query -
result -
queryError -
testStatus -
Throws:
QueryTestFailedException

generateErrorFile

java.lang.String generateErrorFile(java.lang.String querySetID,
                                   java.lang.String queryIdentifier,
                                   java.lang.String sql,
                                   java.sql.ResultSet resultSet,
                                   java.lang.Throwable queryError,
                                   java.lang.Object results)
                                   throws QueryTestFailedException
Call to generate an error file as the result of incompatibilities in the comparison of the expected results to the actual results.

Parameters:
querySetID -
queryIdentifier -
sql -
resultSet -
queryError -
results -
Returns:
Throws:
QueryTestFailedException


Copyright © 2010. All Rights Reserved.