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

Classes

class  SQLiteCapabilitiesDelegateStorageTest
 

Functions

static bool fileExists (const std::string &file)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_createInvalidConfigurationRoot)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_createValidConfigurationRoot)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_createExistingDatabaseFails)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_openExistingDatabaseSucceeds)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_databaseWithNoEndpointConfigTable)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_storeForEndpointWorks)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_storeForEndpointMapWorks)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_storeForExistingEntry)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_loadForEndpointWorks)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_loadForNonExistingEndpoint)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_eraseWorks)
 
 TEST_F (SQLiteCapabilitiesDelegateStorageTest, test_clearDatabaseWorks)
 

Variables

static const std::string TEST_DATABASE_FILE_NAME = "SQLiteCapabilitiesDelegateStorageTest.db"
 Test database file name. More...
 
static const std::string CAPABILITIES_DELEGATE_JSON
 
static const std::string ENDPOINT_CONFIG_TABLE_NAME = "endpointConfigTable"
 The name of the capabilitiesDelegate table. More...
 
static const std::string TEST_ENDPOINT_ID_1 = "EndpointID1"
 Test endpoint ID. More...
 
static const std::string TEST_ENDPOINT_ID_2 = "EndpointID2"
 Test endpoint ID. More...
 
static const std::string TEST_ENDPOINT_CONFIG_1 = "EndpointConfig1"
 Test endpoint configuration. More...
 
static const std::string TEST_ENDPOINT_CONFIG_2 = "EndpointConfig2"
 Test endpoint configuration. More...
 

Function Documentation

◆ fileExists()

static bool alexaClientSDK::capabilitiesDelegate::storage::test::fileExists ( const std::string &  file)
static

Checks whether a file exists in the file system.

Parameters
fileThe file name.
Returns
Whether the file exists.

◆ TEST_F() [1/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_createInvalidConfigurationRoot   
)

Tests create method with invalid ConfigurationNode.

◆ TEST_F() [2/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_createValidConfigurationRoot   
)

Tests create method with valid ConfigurationNode.

◆ TEST_F() [3/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_createExistingDatabaseFails   
)

Tests if create existing database fails.

◆ TEST_F() [4/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_openExistingDatabaseSucceeds   
)

Tests if the open existing database succeeds.

◆ TEST_F() [5/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_databaseWithNoEndpointConfigTable   
)

Tests if open succeeds when there is an empty database with no Endpoint Config Table.

Create empty database with no tables.

Open the same database as the SQLiteCapabilitiesDelegateStorage

◆ TEST_F() [6/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_storeForEndpointWorks   
)

Tests if the store method works with a single endpoint.

◆ TEST_F() [7/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_storeForEndpointMapWorks   
)

Tests if the store method works with an endpoint map.

◆ TEST_F() [8/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_storeForExistingEntry   
)

Test if storing an existing entry in to the database replaces the previous value.

◆ TEST_F() [9/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_loadForEndpointWorks   
)

Test if the load method with endpointId input works.

◆ TEST_F() [10/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_loadForNonExistingEndpoint   
)

Test if the load method with endpointId input works.

◆ TEST_F() [11/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_eraseWorks   
)

Test if the erase method works for a given endpointId.

◆ TEST_F() [12/12]

alexaClientSDK::capabilitiesDelegate::storage::test::TEST_F ( SQLiteCapabilitiesDelegateStorageTest  ,
test_clearDatabaseWorks   
)

Store one item in the database.

Validate after clearing the database.

Store two items in the database.

Validate after clearing the database.

Test clearing empty database.

Variable Documentation

◆ CAPABILITIES_DELEGATE_JSON

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::CAPABILITIES_DELEGATE_JSON
static
Initial value:
= R"(
{
"capabilitiesDelegate" : {
"databaseFilePath":")" + TEST_DATABASE_FILE_NAME + R"("
}
}
)"
static const std::string TEST_DATABASE_FILE_NAME
Test database file name.
Definition: SQLiteCapabilitiesDelegateStorageTest.cpp:37

◆ ENDPOINT_CONFIG_TABLE_NAME

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::ENDPOINT_CONFIG_TABLE_NAME = "endpointConfigTable"
static

The name of the capabilitiesDelegate table.

◆ TEST_DATABASE_FILE_NAME

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::TEST_DATABASE_FILE_NAME = "SQLiteCapabilitiesDelegateStorageTest.db"
static

Test database file name.

◆ TEST_ENDPOINT_CONFIG_1

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::TEST_ENDPOINT_CONFIG_1 = "EndpointConfig1"
static

Test endpoint configuration.

◆ TEST_ENDPOINT_CONFIG_2

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::TEST_ENDPOINT_CONFIG_2 = "EndpointConfig2"
static

Test endpoint configuration.

◆ TEST_ENDPOINT_ID_1

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::TEST_ENDPOINT_ID_1 = "EndpointID1"
static

Test endpoint ID.

◆ TEST_ENDPOINT_ID_2

const std::string alexaClientSDK::capabilitiesDelegate::storage::test::TEST_ENDPOINT_ID_2 = "EndpointID2"
static

Test endpoint ID.

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