sptk2 logo
SPTK Home Page
Public Member Functions | Static Public Member Functions | List of all members
sptk::DatabaseTests Class Reference

#include <DatabaseTests.h>

Public Member Functions

 DatabaseTests ()
 
void addDatabaseConnection (const DatabaseConnectionString &connectionString)
 
std::vector< DatabaseConnectionStringconnectionStrings () const
 
DatabaseConnectionString connectionString (const String &driverName) const
 

Static Public Member Functions

static void testConnect (const DatabaseConnectionString &connectionString)
 
static void testSelect (const DatabaseConnectionString &connectionString)
 
static void testSelect (DatabaseConnectionPool &connectionPool)
 
static void testDDL (const DatabaseConnectionString &connectionString)
 
static void testQueryInsertDate (const DatabaseConnectionString &connectionString)
 
static void testQueryInsertDateTime (const DatabaseConnectionString &connectionString)
 
static void testQueryParameters (const DatabaseConnectionString &connectionString)
 
static void testInsertQuery (const DatabaseConnectionString &connectionString)
 
static void testInsertQueryDirect (const DatabaseConnectionString &connectionString)
 
static void testTransaction (const DatabaseConnectionString &connectionString)
 
static void testBulkInsert (const DatabaseConnectionString &connectionString)
 
static void testBulkInsertPerformance (const DatabaseConnectionString &connectionString, size_t recordCount)
 
static void testBatchSQL (const DatabaseConnectionString &connectionString)
 
static void testBLOB (const DatabaseConnectionString &connectionString)
 
static DatabaseTeststests ()
 

Detailed Description

Common operations used by database-related unit tests

Constructor & Destructor Documentation

◆ DatabaseTests()

sptk::DatabaseTests::DatabaseTests ( )

Constructor

Member Function Documentation

◆ addDatabaseConnection()

void sptk::DatabaseTests::addDatabaseConnection ( const DatabaseConnectionString connectionString)

Add database connection to future tests. Only one connection string is allowed per database type (driver name).

Parameters
connectionStringDatabase connection string

◆ connectionString()

DatabaseConnectionString sptk::DatabaseTests::connectionString ( const String driverName) const

Get connection string for database type (driver name).

Parameters
driverNameDriver name
Returns
connection string

◆ connectionStrings()

std::vector< DatabaseConnectionString > sptk::DatabaseTests::connectionStrings ( ) const

Get list of added database connections

Returns
list of added database connections

◆ testBatchSQL()

static void sptk::DatabaseTests::testBatchSQL ( const DatabaseConnectionString connectionString)
static

Test batch SQL

Parameters
connectionStringDatabase connection string

◆ testBLOB()

static void sptk::DatabaseTests::testBLOB ( const DatabaseConnectionString connectionString)
static

Test BLOB insert and select

Parameters
connectionStringDatabase connection string

◆ testBulkInsert()

static void sptk::DatabaseTests::testBulkInsert ( const DatabaseConnectionString connectionString)
static

Test bulk insert operation

Parameters
connectionStringDatabase connection string

◆ testBulkInsertPerformance()

static void sptk::DatabaseTests::testBulkInsertPerformance ( const DatabaseConnectionString connectionString,
size_t  recordCount 
)
static

Test bulk insert operation performance

Parameters
connectionStringDatabase connection string
recordCountRecords to insert during test

◆ testConnect()

static void sptk::DatabaseTests::testConnect ( const DatabaseConnectionString connectionString)
static

Test database connection

Parameters
connectionStringDatabase connection string

◆ testDDL()

static void sptk::DatabaseTests::testDDL ( const DatabaseConnectionString connectionString)
static

Test basic DDL statements

Parameters
connectionStringDatabase connection string

◆ testInsertQuery()

static void sptk::DatabaseTests::testInsertQuery ( const DatabaseConnectionString connectionString)
static

Test InsertQuery returning created value

Parameters
connectionString

◆ testInsertQueryDirect()

static void sptk::DatabaseTests::testInsertQueryDirect ( const DatabaseConnectionString connectionString)
static

Test InsertQuery returning created value

Parameters
connectionString

◆ testQueryInsertDate()

static void sptk::DatabaseTests::testQueryInsertDate ( const DatabaseConnectionString connectionString)
static

Test query inserting date

Parameters
connectionString

◆ testQueryInsertDateTime()

static void sptk::DatabaseTests::testQueryInsertDateTime ( const DatabaseConnectionString connectionString)
static

Test query inserting date

Parameters
connectionString

◆ testQueryParameters()

static void sptk::DatabaseTests::testQueryParameters ( const DatabaseConnectionString connectionString)
static

Test parametrized queries

Parameters
connectionStringDatabase connection string

◆ tests()

static DatabaseTests & sptk::DatabaseTests::tests ( )
static

Global database tests collection

◆ testSelect() [1/2]

static void sptk::DatabaseTests::testSelect ( const DatabaseConnectionString connectionString)
static

Test SELECT statements

Parameters
connectionStringDatabase connection string

◆ testSelect() [2/2]

static void sptk::DatabaseTests::testSelect ( DatabaseConnectionPool connectionPool)
static

Test SELECT statements

Parameters
connectionStringDatabase connection string

◆ testTransaction()

static void sptk::DatabaseTests::testTransaction ( const DatabaseConnectionString connectionString)
static

Test transaction

Parameters
connectionStringDatabase connection string

The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:41: SPTK 5.4.1