org.teiid.test.client
Class QueryScenario

java.lang.Object
  extended by org.teiid.test.client.QueryScenario
Direct Known Subclasses:
CTCQueryScenario, QueryScenarioImpl

public abstract class QueryScenario
extends Object

The QueryScenario manages all the information required to run one scenario of tests. This includes the following:

  • The queryreader and its query sets to be executed as a scenario
  • Provides the expected results that correspond to a query set
  • The results generator that would be used when TestProperties.RESULT_MODES.GENERATE is specified
  • Author:
    vanhalbert

    Field Summary
    protected  QueryReader reader
               
    protected  ResultsGenerator resultsGen
               
     
    Constructor Summary
    QueryScenario(String scenarioName, Properties queryProperties)
               
     
    Method Summary
     ExpectedResults getExpectedResults(String querySetID)
              Return the ExpectedResults for the specified querySetID.
     Properties getProperties()
              Return the properties defined for this scenario
     List<QueryTest> getQueries(String querySetID)
              Return a Map containing the query identifier as the key, and the value is the query.
     QueryReader getQueryReader()
              Return the QueryReader that is to be used to obtain the queries to process.
     String getQueryScenarioIdentifier()
              Return the identifier for the current scenario
     Collection<String> getQuerySetIDs()
              Return a Collection of querySetIDs that the QueryReader will be providing.
     String getQuerySetName()
              Return the name that identifies this query set.
     ResultsGenerator getResultsGenerator()
              Return the ResultsGenerator that is to be used to create new sets of expected results.
     String getResultsMode()
              Return the result mode that was defined by the property TestProperties.PROP_RESULT_MODE
    abstract  void handleTestResult(TestResult tr, ResultSet resultSet, int updateCnt, boolean resultFromQuery, String sql)
               
    protected  void setUp()
               
    protected  void validateResultsMode(Properties props)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    reader

    protected QueryReader reader

    resultsGen

    protected ResultsGenerator resultsGen
    Constructor Detail

    QueryScenario

    public QueryScenario(String scenarioName,
                         Properties queryProperties)
    Method Detail

    setUp

    protected void setUp()

    validateResultsMode

    protected void validateResultsMode(Properties props)

    getQuerySetName

    public String getQuerySetName()
    Return the name that identifies this query set. It should use the TestProperties.QUERY_SET_NAME property to obtain the name.

    Returns:
    String query set name;

    getQueryScenarioIdentifier

    public String getQueryScenarioIdentifier()
    Return the identifier for the current scenario

    Returns:
    String name of scenario

    getProperties

    public Properties getProperties()
    Return the properties defined for this scenario

    Returns:
    Properties

    getQueries

    public List<QueryTest> getQueries(String querySetID)
    Return a Map containing the query identifier as the key, and the value is the query. In most simple cases, the query will be a String However, complex types (i.e., to execute prepared statements or other arguments), it maybe some other type.

    Parameters:
    querySetID - identifies a set of queries
    Returns:
    Map

    getQuerySetIDs

    public Collection<String> getQuerySetIDs()
    Return a Collection of querySetIDs that the QueryReader will be providing. The querySetID can be used to obtain it associated set of queries by call getQueries(String)

    Returns:
    Collection of querySetIDs

    getResultsMode

    public String getResultsMode()
    Return the result mode that was defined by the property TestProperties.PROP_RESULT_MODE

    Returns:
    String result mode

    getExpectedResults

    public ExpectedResults getExpectedResults(String querySetID)
    Return the ExpectedResults for the specified querySetID. These expected results will be used to compare with the actual results in order to determine success or failure.

    Parameters:
    querySetID -
    Returns:
    ExpectedResults

    getResultsGenerator

    public ResultsGenerator getResultsGenerator()
    Return the ResultsGenerator that is to be used to create new sets of expected results.

    Returns:

    getQueryReader

    public QueryReader getQueryReader()
    Return the QueryReader that is to be used to obtain the queries to process.

    Returns:

    handleTestResult

    public abstract void handleTestResult(TestResult tr,
                                          ResultSet resultSet,
                                          int updateCnt,
                                          boolean resultFromQuery,
                                          String sql)


    Copyright © 2012. All Rights Reserved.