AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Functions | Variables
alexaClientSDK::storage::sqliteStorage::test Namespace Reference

Classes

class  SQLiteMiscStorageTest
 

Functions

static std::string generateDbFilePath ()
 
 TEST (SQLiteDatabaseTest, test_closeThenOpen)
 Test to close DB then open it. More...
 
 TEST (SQLiteDatabaseTest, test_initializeAlreadyExisting)
 Test to initialize already existing DB. More...
 
 TEST (SQLiteDatabaseTest, test_initializeBadPath)
 Test to initialize a bad path. More...
 
 TEST (SQLiteDatabaseTest, test_initializeOnDirectory)
 Test to initialize a directory. More...
 
 TEST (SQLiteDatabaseTest, test_initializeTwice)
 Test to initialize DB twice. More...
 
 TEST (SQLiteDatabaseTest, test_openAlreadyExisting)
 Test to open already existing DB. More...
 
 TEST (SQLiteDatabaseTest, test_openBadPath)
 Test to open a bad path. More...
 
 TEST (SQLiteDatabaseTest, test_openDirectory)
 Test to open directory. More...
 
 TEST (SQLiteDatabaseTest, test_openTwice)
 Test to open DB twice. More...
 
 TEST (SQLiteDatabaseTest, test_transactionsCommit)
 Test transactions commit. More...
 
 TEST (SQLiteDatabaseTest, test_transactionsRollback)
 
 TEST (SQLiteDatabaseTest, test_nestedTransactions)
 Test nested transactions. More...
 
 TEST (SQLiteDatabaseTest, test_doubleCommit)
 Test transactions double commit. More...
 
 TEST (SQLiteDatabaseTest, test_autoRollback)
 Test automatic rollback. More...
 
 TEST (SQLiteDatabaseTest, test_createDeleteTable)
 Test to initialize already existing DB. More...
 
 TEST_F (SQLiteMiscStorageTest, test_createStringKeyValueTable)
 Tests with creating a string key - string value table. More...
 
 TEST_F (SQLiteMiscStorageTest, test_removeWithNonEscapedStringKey)
 
 TEST_F (SQLiteMiscStorageTest, test_updateWithNonEscapedStringKey)
 
 TEST_F (SQLiteMiscStorageTest, test_putWithNonEscapedStringKey)
 
 TEST_F (SQLiteMiscStorageTest, test_addWithNonEscapedStringKey)
 
 TEST_F (SQLiteMiscStorageTest, test_tableEntryTests)
 Tests with table entry add, remove, update, put. More...
 
 TEST_F (SQLiteMiscStorageTest, test_loadAndClear)
 Tests with loading and clearing table entries. More...
 
 TEST_F (SQLiteMiscStorageTest, test_createDeleteTable)
 Tests with creating and deleting tables. More...
 
 TEST_F (SQLiteMiscStorageTest, test_escapeSingleQuoteCharacters)
 Test adding a string value with a single quote. More...
 
 TEST_F (SQLiteMiscStorageTest, test_tableEntryTestsMultiThread)
 Tests with table entry add, remove, update, put in multiple threads. More...
 
 TEST_F (SQLiteMiscStorageTest, test_getDatabaseReference)
 Test misc storage provide non-null reference to database object. More...
 

Variables

static std::string g_workingDirectory
 Variable for storing the working directory. This is where all of the test databases will be created. More...
 
static const std::string BAD_PATH
 An example of a path that doesn't exist in a system. More...
 
static const std::string TEST_TABLE_NAME {"testTable"}
 Test table name. More...
 
static const std::string COMPONENT_NAME = "SQLiteMiscStorageTest"
 Component name for the misc DB tables. More...
 
static const std::string MISC_DB_CONFIG_JSON
 JSON text for miscDB config. More...
 

Function Documentation

◆ generateDbFilePath()

static std::string alexaClientSDK::storage::sqliteStorage::test::generateDbFilePath ( )
static

Helper function that generates a unique filepath using the passed in g_workingDirectory.

Returns
A unique filepath.

◆ TEST() [1/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_closeThenOpen   
)

Test to close DB then open it.

◆ TEST() [2/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_initializeAlreadyExisting   
)

Test to initialize already existing DB.

◆ TEST() [3/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_initializeBadPath   
)

Test to initialize a bad path.

◆ TEST() [4/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_initializeOnDirectory   
)

Test to initialize a directory.

◆ TEST() [5/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_initializeTwice   
)

Test to initialize DB twice.

◆ TEST() [6/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_openAlreadyExisting   
)

Test to open already existing DB.

◆ TEST() [7/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_openBadPath   
)

Test to open a bad path.

◆ TEST() [8/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_openDirectory   
)

Test to open directory.

◆ TEST() [9/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_openTwice   
)

Test to open DB twice.

◆ TEST() [10/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_transactionsCommit   
)

Test transactions commit.

◆ TEST() [11/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_transactionsRollback   
)

◆ TEST() [12/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_nestedTransactions   
)

Test nested transactions.

◆ TEST() [13/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_doubleCommit   
)

Test transactions double commit.

◆ TEST() [14/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_autoRollback   
)

Test automatic rollback.

◆ TEST() [15/15]

alexaClientSDK::storage::sqliteStorage::test::TEST ( SQLiteDatabaseTest  ,
test_createDeleteTable   
)

Test to initialize already existing DB.

◆ TEST_F() [1/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_createStringKeyValueTable   
)

Tests with creating a string key - string value table.

◆ TEST_F() [2/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_removeWithNonEscapedStringKey   
)

Setup.

Test remove.

Teardown.

◆ TEST_F() [3/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_updateWithNonEscapedStringKey   
)

Setup.

Test update.

Teardown.

◆ TEST_F() [4/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_putWithNonEscapedStringKey   
)

Setup.

Ensure that put entry works Try with a new entry for key

Try with an existing entry for key

Teardown.

◆ TEST_F() [5/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_addWithNonEscapedStringKey   
)

Setup.

Test add.

Teardown.

◆ TEST_F() [6/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_tableEntryTests   
)

Tests with table entry add, remove, update, put.

Entry doesn't exist at first

Ensure that add entry works

Ensure that update entry works

Ensure that remove entry works

Ensure that put entry works Try with a new entry for key

Try with an existing entry for key

◆ TEST_F() [7/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_loadAndClear   
)

Tests with loading and clearing table entries.

Add entries

Ensure that load works

Ensure that clear works

◆ TEST_F() [8/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_createDeleteTable   
)

Tests with creating and deleting tables.

Ensure that create works

Ensure that delete doesnt work on a non-empty table

Ensure that delete works on an empty table

◆ TEST_F() [9/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_escapeSingleQuoteCharacters   
)

Test adding a string value with a single quote.

Entry doesn't exist at first

Ensure that add entry works

◆ TEST_F() [10/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_tableEntryTestsMultiThread   
)

Tests with table entry add, remove, update, put in multiple threads.

Entry doesn't exist at first

Ensure that add entry works

Ensure that update entry works

Ensure that remove entry works

Ensure that put entry works Try with a new entry for key

Try with an existing entry for key

◆ TEST_F() [11/11]

alexaClientSDK::storage::sqliteStorage::test::TEST_F ( SQLiteMiscStorageTest  ,
test_getDatabaseReference   
)

Test misc storage provide non-null reference to database object.

Variable Documentation

◆ BAD_PATH

const std::string alexaClientSDK::storage::sqliteStorage::test::BAD_PATH
static
Initial value:
=
"_/_/_/there/is/no/way/this/path/should/exist/,/so/it/should/cause/an/error/when/creating/the/db"

An example of a path that doesn't exist in a system.

◆ COMPONENT_NAME

const std::string alexaClientSDK::storage::sqliteStorage::test::COMPONENT_NAME = "SQLiteMiscStorageTest"
static

Component name for the misc DB tables.

◆ g_workingDirectory

std::string alexaClientSDK::storage::sqliteStorage::test::g_workingDirectory
static

Variable for storing the working directory. This is where all of the test databases will be created.

◆ MISC_DB_CONFIG_JSON

const std::string alexaClientSDK::storage::sqliteStorage::test::MISC_DB_CONFIG_JSON
static
Initial value:
=
"{"
"\"miscDatabase\":{"
"\"databaseFilePath\":\"miscDBSQLiteMiscStorageTest.db\""
"}"
"}"

JSON text for miscDB config.

◆ TEST_TABLE_NAME

const std::string alexaClientSDK::storage::sqliteStorage::test::TEST_TABLE_NAME {"testTable"}
static

Test table name.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0