Class ExecuteSQLQueryAction

  • All Implemented Interfaces:
    com.consol.citrus.common.Described, com.consol.citrus.common.Named, com.consol.citrus.TestAction, com.consol.citrus.TestActorAware, org.springframework.beans.factory.InitializingBean

    public class ExecuteSQLQueryAction
    extends AbstractDatabaseConnectingTestAction
    Action executes SQL queries and offers result set validation. The class enables you to query data result sets from a database. Validation will happen on column basis inside the result set.
    Since:
    2008
    Author:
    Christoph Deppisch, Jan Zahalka
    • Field Detail

      • controlResultSet

        protected final Map<String,​List<String>> controlResultSet
        Map holding all column values to be validated, keys represent the column names
    • Method Detail

      • executeStatements

        protected void executeStatements​(List<String> statements,
                                         List<Map<String,​Object>> allResultRows,
                                         Map<String,​List<String>> columnValuesMap,
                                         com.consol.citrus.context.TestContext context)
        Run statements and validate result set.
        Parameters:
        statements -
        allResultRows -
        columnValuesMap -
        context -
      • validateSqlStatement

        protected void validateSqlStatement​(String stmt)
        Does some simple validation on the SQL statement.
        Parameters:
        stmt - The statement which is to be validated.
      • validateSingleValue

        protected void validateSingleValue​(String columnName,
                                           String controlValue,
                                           String resultValue,
                                           com.consol.citrus.context.TestContext context)
      • getValidator

        public com.consol.citrus.validation.script.sql.SqlResultSetScriptValidator getValidator()
        Gets the validator.
        Returns:
        the validator
      • getControlResultSet

        public Map<String,​List<String>> getControlResultSet()
        Gets the controlResultSet.
        Returns:
        the controlResultSet
      • getExtractVariables

        public Map<String,​String> getExtractVariables()
        Gets the extractVariables.
        Returns:
        the extractVariables
      • getScriptValidationContext

        public com.consol.citrus.validation.script.ScriptValidationContext getScriptValidationContext()
        Gets the scriptValidationContext.
        Returns:
        the scriptValidationContext