Class AbstractDatabaseConnectingTestAction

java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.jdbc.core.support.JdbcDaoSupport
org.citrusframework.actions.AbstractDatabaseConnectingTestAction
All Implemented Interfaces:
Described, Named, TestAction, TestActorAware, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ExecutePLSQLAction, ExecuteSQLAction, ExecuteSQLQueryAction

public abstract class AbstractDatabaseConnectingTestAction extends org.springframework.jdbc.core.support.JdbcDaoSupport implements TestAction, Named, Described, TestActorAware
Abstract base class for database connection test actions. Extends JdbcDaoSupport providing access to a DataSource.
Author:
Christoph Deppisch
  • Field Details

    • sqlResourcePath

      protected final String sqlResourcePath
      SQL file resource path
    • statements

      protected final List<String> statements
      List of SQL statements
  • Constructor Details

  • Method Details

    • execute

      public void execute(TestContext context)
      Do basic logging and delegate execution to subclass.
      Specified by:
      execute in interface TestAction
    • doExecute

      public abstract void doExecute(TestContext context)
      Subclasses may add custom execution logic here.
    • isDisabled

      public boolean isDisabled(TestContext context)
      Checks if this test action is disabled. Delegates to test actor defined for this test action by default. Subclasses may add additional disabled logic here.
      Specified by:
      isDisabled in interface TestAction
      Parameters:
      context - the current test context.
      Returns:
    • createStatementsFromFileResource

      protected List<String> createStatementsFromFileResource(TestContext context)
      Reads SQL statements from external file resource. File resource can hold several multi-line statements and comments.
      Parameters:
      context - the current test context.
      Returns:
      list of SQL statements.
    • createStatementsFromFileResource

      protected List<String> createStatementsFromFileResource(TestContext context, SqlUtils.LastScriptLineDecorator lineDecorator)
      Reads SQL statements from external file resource. File resource can hold several multi-line statements and comments.
      Parameters:
      context - the current test context.
      Returns:
      list of SQL statements.
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface Described
    • setDescription

      public AbstractDatabaseConnectingTestAction setDescription(String description)
      Specified by:
      setDescription in interface Described
    • getName

      public String getName()
      Specified by:
      getName in interface TestAction
    • setName

      public void setName(String name)
      Specified by:
      setName in interface Named
    • getSqlResourcePath

      public String getSqlResourcePath()
      Gets the sqlResource.
      Returns:
      the sqlResource
    • getStatements

      public List<String> getStatements()
      Gets the statements.
      Returns:
      the statements
    • getTransactionManager

      public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
      Gets the transactionManager.
      Returns:
    • getTransactionTimeout

      public String getTransactionTimeout()
      Gets the transactionTimeout.
      Returns:
    • getTransactionIsolationLevel

      public String getTransactionIsolationLevel()
      Gets the transactionIsolationLevel.
      Returns:
    • getActor

      public TestActor getActor()
      Specified by:
      getActor in interface TestAction
    • setActor

      Sets the actor.
      Specified by:
      setActor in interface TestActorAware
      Parameters:
      actor - the actor to set