Class DbSpecification

java.lang.Object
org.evomaster.client.java.sql.DbSpecification

public class DbSpecification extends Object
  • Field Details

    • dbType

      public final DatabaseType dbType
      specify a type of the database
    • connection

      public final Connection connection
      sql connection
    • schemaNames

      public final List<String> schemaNames
      schema name TODO might remove this later if we could get such info with the connection
    • initSqlScript

      public final String initSqlScript
      a script to initialize the data in database
    • initSqlOnResourcePath

      public final String initSqlOnResourcePath
      a resource path where the init sql script is Note that this parameter is specific to resource path, not a path to the file.
    • employSmartDbClean

      public final boolean employSmartDbClean
      specify whether to employ the smart db clean by cleaning all data in table which have been accessed after every test Default is True
  • Constructor Details

  • Method Details

    • withSchemas

      public DbSpecification withSchemas(String... schemas)
    • withDisabledSmartClean

      public DbSpecification withDisabledSmartClean()
      Returns:
      this with disabled smart cleaning. The cleaning of added/modified/deleted data in the database will have to be handled manually in the driver in the resetStateOfSUT() method.
    • withInitSqlScript

      public DbSpecification withInitSqlScript(String script)
      Parameters:
      script - a series of INSERT SQL commands, as a string.
      Returns:
      this, with the given INSERT operations used to initialize the database, used as starting point for each test execution
    • withInitSqlOnResourcePath

      public DbSpecification withInitSqlOnResourcePath(String path)
      Parameters:
      path - to a classpath resource having a text file with a series of INSERT SQL commands, read as strings.
      Returns:
      this, with the given INSERT operations used to initialize the database, used as starting point for each test execution