Class DbTestUtilities

java.lang.Object
org.tentackle.pdo.test.DbTestUtilities

@Service(DbTestUtilities.class) public class DbTestUtilities extends Object
Low-level session utility methods for tests.
  • Constructor Details

    • DbTestUtilities

      public DbTestUtilities()
  • Method Details

    • getInstance

      public static DbTestUtilities getInstance()
      The singleton.
      Returns:
      the singleton
    • createPopulateScript

      public String createPopulateScript(org.tentackle.dbms.Db db) throws ModelException
      Creates the SQL script to populate the database.
      Used for in-memory test connections.
      Loads the model from the classpath.
      Parameters:
      db - the low-level database session
      Returns:
      the SQL script
      Throws:
      ModelException - if model is inconsistent
      See Also:
    • runScript

      public void runScript(org.tentackle.dbms.Db db, String script)
      Runs an SQL script.
      Parameters:
      db - the low-level session
      script - the SQL script