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

Classes

class  HelloClass
 
class  LocaleWakeWordsSettingTest
 
class  MockCallbacks
 
class  MockSetting
 
class  MockSettingEventSender
 
class  MockSettingObserver
 
class  MockSettingProtocol
 
class  ObserverClass
 
class  SettingCallbackAdapterTest
 
class  SettingCallbacksTest
 
class  SettingEventSenderTest
 
class  SettingsManagerTest
 Test class. More...
 
class  SettingStub
 Settings stub that just set the value immediately. More...
 
class  SettingTest
 
class  SharedAVSSettingProtocolTest
 
class  TestObserver
 Just an empty observer. More...
 
class  TimezoneSettingStub
 

Typedefs

using TestEventCallback = SettingCallbackAdapter< DeviceSettingsManager, DeviceSettingsIndex::TIMEZONE >
 Just an alias to make the name shorter. More...
 
using SettingInt = SettingStub< int >
 
using SettingString = SettingStub< std::string >
 
using SettingBool = MockSetting< bool >
 

Enumerations

enum  TestSettingId { TEST_ID_INT = 0, TEST_ID_STRING, TEST_ID_CHAR }
 
enum  HelloEnum { HelloEnum::HI, HelloEnum::THERE }
 

Functions

std::vector< std::tuple< std::string, std::string, SettingStatus > > convertToDBData (std::string key, std::string value, SettingStatus status)
 
 TEST_F (LocaleWakeWordsSettingTest, test_nullEventSenders)
 Test create with null event senders. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_nullStorage)
 Test create with null storage. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_nullAssetsManager)
 Test create with null assets manager. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_restoreSynchronized)
 Test restore when all values are available and synchronized. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_AVSChangeWakeWordsRequest)
 Test success flow for avs wake word request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_AVSChangeWakeWordsRequestSetFailed)
 
 TEST_F (LocaleWakeWordsSettingTest, test_AVSChangeWakeWordsRequestSendEventFailed)
 Test send event failed for avs request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_AVSChangeLocaleRequest)
 Test success flow for avs locale request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_AVSChangeLocaleRequestSetFailed)
 Test set value failed for avs request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_AVSChangeLocaleRequestSendEventFailed)
 Test send event failed for avs request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_restoreValueNotAvailable)
 Test restore when no value is available in the database. This should run local change to both wake words and locale. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localChangeWakeWordsRequest)
 Test success flow for local request for wake word change. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localChangeWakeWordsRequestSetFailed)
 Test set value failed during local request for wake word change. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localChangeWakeWordsRequestSendEventFailed)
 TODO: Test send changed event failed while processing wake words local request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localChangeLocaleRequest)
 TODO: Test success flow for local request for wake word change. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localChangeLocaleRequestSetFailed)
 TODO: Test set value failed during local request for wake word change. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localChangeLocaleRequestSendEventFailed)
 TODO: Test send changed event failed while processing wake words local request. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localeChangeTriggerWakeWordsChange)
 TODO: Test locale change when current wake word is not available. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localeChangeCancelPendingWakeWordsChange)
 TODO: Test locale change when pending request has a wake word that's not available. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_localeChangeMergePendingWakeWordsChange)
 TODO: Test locale change when pending request has a valid wake word selected in the current locale. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_wakeWordChangeRequestFailedOnCurrentLocale)
 TODO: Test wake word change when current locale doesn't support requested wake word. More...
 
 TEST_F (LocaleWakeWordsSettingTest, test_reconnectAfterOfflineChange)
 Test synchronization once the SDK is re-connected and there was an offline change. More...
 
 TEST (NetworkInfoTest, test_restoreInfoFromEmptyString)
 
 TEST (NetworkInfoTest, test_restoreInfoFromEmptyJson)
 
 TEST (NetworkInfoTest, test_convertFullInfoToStringAndBack)
 
 TEST (NetworkInfoTest, test_outputEmptyNetworkInfo)
 
 TEST (NetworkInfoTest, test_setIpV4Address)
 
 TEST (NetworkInfoTest, test_setIpV6Address)
 
 TEST (NetworkInfoTest, test_setMacAddress)
 
 TEST (NetworkInfoTest, test_setSubnetMask)
 
 TEST (NetworkInfoTest, test_emptyGetters)
 
 TEST (NetworkInfoTest, test_gettersAfterSet)
 
 TEST (NetworkInfoTest, test_gettersAfterReset)
 
static void staticCallback (const std::string &newValue, SettingNotifications notification)
 Define a static function to be used as callback. More...
 
 TEST_F (SettingCallbackAdapterTest, test_lambdaCallback)
 Test callback for lambda functions. More...
 
 TEST_F (SettingCallbackAdapterTest, test_staticCallback)
 Test callback for static functions. More...
 
 TEST_F (SettingCallbackAdapterTest, test_memberCallback)
 Test callback for member functions. More...
 
static void staticCallback (const std::string &newValue, SettingNotifications notification)
 Define a static function to be used as callback. More...
 
 TEST_F (SettingCallbacksTest, test_lambdaAndStaticCallbacks)
 Test callback for a mix of lambda and static functions. More...
 
 TEST_F (SettingCallbacksTest, test_memberCallback)
 Test callback for member functions. More...
 
 TEST_F (SettingEventSenderTest, test_createValidation)
 
 TEST_F (SettingEventSenderTest, test_sendChangedEvent)
 
 TEST_F (SettingEventSenderTest, test_sendReportEvent)
 
 TEST_F (SettingEventSenderTest, test_invalidJSONValue)
 
 TEST_F (SettingEventSenderTest, testSlow_blockingSend)
 
 TEST_F (SettingEventSenderTest, testSlow_maxRetries)
 
 TEST_F (SettingEventSenderTest, testSlow_retryOnInternalError)
 
 TEST_F (SettingEventSenderTest, testSlow_retryStopAfterSuccess)
 
 TEST_F (SettingEventSenderTest, testSlow_noRetryOnNonConnected)
 
 TEST_F (SettingEventSenderTest, testSlow_cancelRetry)
 
static const std::chrono::seconds TEST_TIMEOUT (10)
 General timeout for tests to fail. More...
 
 TEST_F (SettingsManagerTest, test_setExistingSetting)
 Test add settings and setting the setting value. More...
 
 TEST_F (SettingsManagerTest, test_setSettingUnavailable)
 Test set value for setting that hasn't been registered. More...
 
 TEST_F (SettingsManagerTest, test_getExistingSetting)
 Test get value for setting that hasn't been registered. More...
 
 TEST_F (SettingsManagerTest, test_getSettingUnavailable)
 Test get value for setting that hasn't been registered. More...
 
 TEST_F (SettingsManagerTest, test_addExistingSetting)
 Test registering a setting that already exists. More...
 
 TEST_F (SettingsManagerTest, test_addObserver)
 Test addObserver for a setting that exists. More...
 
 TEST_F (SettingsManagerTest, test_addObserverFailed)
 Test addObserver for a setting that doesn't exist. More...
 
 TEST_F (SettingsManagerTest, test_removeObserver)
 Test addObserver for a setting that exists. More...
 
 TEST_F (SettingsManagerTest, test_removeObserverFailed)
 Test addObserver for a setting that doesn't exist. More...
 
 TEST_F (SettingsManagerTest, test_setExistingStringSetting)
 Test manager operations for string setting. More...
 
 TEST_F (SettingsManagerTest, test_clearDataInSettingManagerCallsClearDataInSetting)
 Test manager getting a clearData callback will call clearData on the setting. More...
 
std::ostream & operator<< (std::ostream &os, const HelloEnum &hello)
 
std::istream & operator>> (std::istream &is, HelloEnum &hello)
 
std::ostream & operator<< (std::ostream &os, const HelloClass &hello)
 
std::istream & operator>> (std::istream &is, HelloClass &hello)
 
std::pair< bool, std::string > expected (bool result, std::string value)
 
 TEST (SettingStringConversionTest, test_boolConversion)
 Test boolean conversions. More...
 
 TEST (SettingStringConversionTest, test_integralByteSize)
 
 TEST (SettingStringConversionTest, test_arithmeticTypes)
 
 TEST (SettingStringConversionTest, test_fromEnum)
 
 TEST (SettingStringConversionTest, test_fromClass)
 
 TEST (SettingStringConversionTest, test_toStringSet)
 
 TEST (SettingStringConversionTest, test_fromStringSet)
 
 TEST_F (SettingTest, test_create)
 Test successful create. More...
 
 TEST_F (SettingTest, test_createNoRestore)
 Test create initial value when restore value is not available. More...
 
 TEST_F (SettingTest, test_nullCreate)
 Test create with null protocol. More...
 
 TEST_F (SettingTest, test_avsChange)
 Test avs change. More...
 
 TEST_F (SettingTest, test_avsChangeRevert)
 Test avs change revert. More...
 
 TEST_F (SettingTest, test_localChange)
 Test local change. More...
 
 TEST_F (SettingTest, test_localChangeRevert)
 Test local change revert. More...
 
 TEST_F (SettingTest, test_clearData)
 Test clearData. More...
 
 TEST_F (SettingTest, test_observerNotificationLocal)
 Test observer notification. More...
 
 TEST_F (SettingTest, test_observerNotificationAvs)
 Test observer notification. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_nullEventSender)
 Test create with null event sender. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_nullStorage)
 Test create with null storage. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_restoreValueNotAvailable)
 Test restore when value is not available in the database. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_restoreValueNotAvailableCloudAuthoritative)
 Test restore when value is not available in the database for a setting that use cloud authoritative default value. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_restoreSynchronized)
 Test restore when the value is available and synchronized. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_AVSChangeRequest)
 Test success flow for AVS request. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_AVSChangeRequestSetFailed)
 Test set value failed for AVS request. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_AVSChangeRequestStoreFailed)
 Test store value failed. Revert should be called and AVS notified of previous value. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_AVSChangeRequestSendEventFailed)
 Test send event failed for avs request. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_localRequest)
 Test success flow for local request. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_localRequestSetFailed)
 Test set value failed during local request. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_localRequestStoreFailed)
 Test store value to database failed for local request. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_localRequestSendEventFailed)
 Test send changed event failed for local request. In this case, we should not update the database with SYNCHRONIZED. More...
 
 TEST_F (SharedAVSSettingProtocolTest, test_localChangeSettingOfflineSynchronization)
 
 TEST_F (SharedAVSSettingProtocolTest, test_avsChangeSettingOfflineSynchronization)
 
 TEST_F (SharedAVSSettingProtocolTest, test_multipleAVSChanges)
 
 TEST_F (SharedAVSSettingProtocolTest, test_multipleLocalChanges)
 

Variables

static const std::string ALEXA_VALUE = "ALEXA"
 Constant representing "ALEXA" enabled. More...
 
static const std::string ECHO_VALUE = "ECHO"
 Constant representing "ECHO" enabled value. More...
 
static const std::string ENGLISH_CANADA_VALUE = "en-CA"
 Constant representing "en-CA" enabled db value. More...
 
static const std::string FRENCH_CANADA_VALUE = "fr-CA"
 Constant representing "fr-CA" enabled db value. More...
 
static const std::string INVALID_VALUE = "INVALID"
 Constant representing an invalid wake word / locale value. More...
 
static const std::chrono::seconds MY_WAIT_TIMEOUT {5}
 
static const MockLocaleAssetsManager::LocaleAssetsManagerInterface::WakeWordsSets SUPPORTED_WAKE_WORDS_COMBINATION
 Set of combinations of supported wake words. More...
 
static const std::set< std::string > SUPPORTED_LOCALES {ENGLISH_CANADA_VALUE, FRENCH_CANADA_VALUE}
 Set of supported locales. More...
 
static const std::vector< std::string > ENGLISH_LOCALES {ENGLISH_CANADA_VALUE}
 A vector of locales that contains only en-CA. More...
 
static const std::vector< std::string > FRENCH_LOCALES {FRENCH_CANADA_VALUE}
 A vector of locales that contains only fr-CA. More...
 
static const std::string WAKE_WORDS_KEY = "SpeechRecognizer.wakeWords"
 The database key to be used to save wake words. More...
 
static const std::string LOCALES_KEY = "System.locales"
 The database key to be used to save wake words. More...
 
static const auto CONNECTION_TYPE = NetworkInfo::ConnectionType::WIFI
 A random valid connection type. More...
 
static const auto BSSID = "10:00:22:33:44:55"
 A random valid bssid. More...
 
static const auto IP_ADDRESS = "1.2.3.5"
 A random valid IP address. More...
 
static const auto SUBNET_MASK = "1.2.3.0/2"
 A random valid subnet mask. More...
 
static const auto MAC_ADDRESS = "00:FF:00:FF:00:FF"
 A random valid MAC address. More...
 
static const auto DHCP_SERVER_ADDRESS = "200.125.4.0"
 A random valid DHCP server address. More...
 
static const auto ESSID = "essid"
 A random valid connection type. More...
 
static const auto IS_STATIC_IP = false
 A random valid connection type. More...
 
const std::string INIT_TIMEZONE = "Canada/Eastern"
 Define initial values for timezone. More...
 
const std::string NEW_TIMEZONE = "Canada/Pacific"
 Define updated values for each timezone. More...
 
std::string globalTimezone = INIT_TIMEZONE
 Used to test static callback. More...
 
constexpr auto INIT_ALARM_VOLUME_RAMP = types::AlarmVolumeRampTypes::NONE
 
constexpr WakeWordConfirmationSettingType INIT_WAKEWORD_CONFIRMATION = WakeWordConfirmationSettingType::NONE
 
constexpr auto NEW_ALARM_VOLUME_RAMP = types::AlarmVolumeRampTypes::ASCENDING
 
static const SettingEventMetadata METADATA = {"NAMESPACE", "CHANGEDEVENT", "REPORTEVENT", "SETTING"}
 The metadata for the event messages used in this test. More...
 
static const std::string EXPECTED_CHANGED_EVENT = R"(\{"event":\{"header":\{"namespace":"NAMESPACE","name":"CHANGEDEVENT","messageId":".*-.*-.*-.*-.*"\},"payload":\{"SETTING":true\}\}\})"
 The expected changed event format. More...
 
static const std::string EXPECTED_REPORT_EVENT = R"(\{"event":\{"header":\{"namespace":"NAMESPACE","name":"REPORTEVENT","messageId":".*-.*-.*-.*-.*"\},"payload":\{"SETTING":true\}\}\})"
 The expected report event format. More...
 
static const std::vector< int > RETRY_TABLE
 Table with the retry times on subsequent retries. More...
 
static const auto MAX_RETRY_WAIT = std::chrono::seconds(4)
 
constexpr int INITIAL_INT_VALUE = 20
 
constexpr int NEW_INT_VALUE = -20
 
constexpr int DEFAULT_INT_VALUE = 0
 
constexpr char DEFAULT_CHAR_VALUE = 'a'
 
static const std::string KEY = "key"
 The key used for converting the hello object. More...
 
static const std::string INIT_VALUE = "value"
 The value used to initialize the hello object. More...
 
static const std::string EMPTY_JSON_LIST = "[]"
 Represents an empty json list. More...
 
static constexpr bool INIT_VALUE = false
 Initial value for the setting. More...
 
static const std::string INIT_VALUE_STR = "false"
 String representation of the initial value. More...
 
static constexpr bool NEW_VALUE = true
 New value for the setting. More...
 
static const std::string NEW_VALUE_STR = "true"
 String representation of the new value. More...
 
static const std::string DB_VALUE = R"("db-value")"
 Constant representing a valid database value. More...
 
static const std::string DEFAULT_VALUE = R"("default-value")"
 Constant representing a default value. More...
 
static const std::string NEW_VALUE = R"("new-value")"
 Constant representing a valid new value. More...
 
static const std::string INVALID_VALUE = ""
 Empty string used to represent invalid value by the protocol. More...
 
static const std::string key = METADATA.eventNamespace + "::" + METADATA.settingName
 The database key to be used by the protocol given the METADATA object. More...
 
static const auto TEST_TIMEOUT = std::chrono::seconds(5)
 The timeout used throughout the tests. More...
 

Typedef Documentation

◆ TestEventCallback

Just an alias to make the name shorter.

Enumeration Type Documentation

◆ HelloEnum

Define an enumeration for testing string conversion.

Enumerator
HI 
THERE 

◆ TestSettingId

Enumerator
TEST_ID_INT 
TEST_ID_STRING 
TEST_ID_CHAR 

Function Documentation

◆ convertToDBData()

std::vector<std::tuple<std::string, std::string, SettingStatus> > alexaClientSDK::settings::test::convertToDBData ( std::string  key,
std::string  value,
SettingStatus  status 
)

Creates a vector of tuples given of setting key, value, and status

Parameters
keyThe setting key.
valueThe setting value.
statusThe setting status.
Returns
The setting vector tuple.

◆ expected()

std::pair<bool, std::string> alexaClientSDK::settings::test::expected ( bool  result,
std::string  value 
)

◆ operator<<() [1/2]

std::ostream& alexaClientSDK::settings::test::operator<< ( std::ostream &  os,
const HelloEnum hello 
)

Define an operator<< for the test enum HelloEnum.

Parameters
osThe output stream.
helloThe enumeration to be converted.
Returns
The output stream. The failbit is set if the conversion fails.

◆ operator<<() [2/2]

std::ostream& alexaClientSDK::settings::test::operator<< ( std::ostream &  os,
const HelloClass hello 
)

Define an operator<< for the test class HelloClass.

Parameters
osThe output stream.
helloThe object to be converted.
Returns
The output stream. The failbit is set if the conversion fails.

◆ operator>>() [1/2]

std::istream& alexaClientSDK::settings::test::operator>> ( std::istream &  is,
HelloEnum hello 
)

Define an operator>> for the test enum HelloEnum.

Parameters
isThe input stream.
[out]helloThe enum that will receive the new value.
Returns
The input stream. The failbit is set if the conversion fails.

◆ operator>>() [2/2]

std::istream& alexaClientSDK::settings::test::operator>> ( std::istream &  is,
HelloClass hello 
)

Define an operator>> for the test class HelloClass.

Parameters
isThe input stream.
[out]helloThe object that will receive the new value.
Returns
The input stream. The failbit is set if the conversion fails.

◆ staticCallback() [1/2]

static void alexaClientSDK::settings::test::staticCallback ( const std::string &  newValue,
SettingNotifications  notification 
)
static

Define a static function to be used as callback.

◆ staticCallback() [2/2]

static void alexaClientSDK::settings::test::staticCallback ( const std::string &  newValue,
SettingNotifications  notification 
)
static

Define a static function to be used as callback.

◆ TEST() [1/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_restoreInfoFromEmptyString   
)

◆ TEST() [2/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_restoreInfoFromEmptyJson   
)

◆ TEST() [3/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_convertFullInfoToStringAndBack   
)

◆ TEST() [4/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_outputEmptyNetworkInfo   
)

◆ TEST() [5/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_setIpV4Address   
)

◆ TEST() [6/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_setIpV6Address   
)

◆ TEST() [7/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_setMacAddress   
)

◆ TEST() [8/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_setSubnetMask   
)

◆ TEST() [9/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_boolConversion   
)

Test boolean conversions.

◆ TEST() [10/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_integralByteSize   
)

◆ TEST() [11/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_emptyGetters   
)

◆ TEST() [12/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_arithmeticTypes   
)

◆ TEST() [13/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_gettersAfterSet   
)

◆ TEST() [14/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_fromEnum   
)

◆ TEST() [15/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_fromClass   
)

◆ TEST() [16/18]

alexaClientSDK::settings::test::TEST ( NetworkInfoTest  ,
test_gettersAfterReset   
)

◆ TEST() [17/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_toStringSet   
)

◆ TEST() [18/18]

alexaClientSDK::settings::test::TEST ( SettingStringConversionTest  ,
test_fromStringSet   
)

◆ TEST_F() [1/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_create   
)

Test successful create.

◆ TEST_F() [2/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_createNoRestore   
)

Test create initial value when restore value is not available.

◆ TEST_F() [3/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_nullCreate   
)

Test create with null protocol.

◆ TEST_F() [4/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_avsChange   
)

Test avs change.

◆ TEST_F() [5/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
test_createValidation   
)

Test create validation.

◆ TEST_F() [6/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_setExistingSetting   
)

Test add settings and setting the setting value.

◆ TEST_F() [7/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_avsChangeRevert   
)

Test avs change revert.

◆ TEST_F() [8/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
test_sendChangedEvent   
)

Test to verify if the changed event is sent as expected.

◆ TEST_F() [9/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_setSettingUnavailable   
)

Test set value for setting that hasn't been registered.

◆ TEST_F() [10/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_localChange   
)

Test local change.

◆ TEST_F() [11/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_getExistingSetting   
)

Test get value for setting that hasn't been registered.

◆ TEST_F() [12/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
test_sendReportEvent   
)

Test to verify if the report event is sent as expected.

◆ TEST_F() [13/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_localChangeRevert   
)

Test local change revert.

◆ TEST_F() [14/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_getSettingUnavailable   
)

Test get value for setting that hasn't been registered.

◆ TEST_F() [15/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_addExistingSetting   
)

Test registering a setting that already exists.

◆ TEST_F() [16/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_clearData   
)

Test clearData.

◆ TEST_F() [17/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
test_invalidJSONValue   
)

Test validation for incorrect JSON value passed.

◆ TEST_F() [18/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_addObserver   
)

Test addObserver for a setting that exists.

◆ TEST_F() [19/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_observerNotificationLocal   
)

Test observer notification.

◆ TEST_F() [20/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_addObserverFailed   
)

Test addObserver for a setting that doesn't exist.

◆ TEST_F() [21/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
testSlow_blockingSend   
)

Test sending of events will block until a response is received

◆ TEST_F() [22/75]

alexaClientSDK::settings::test::TEST_F ( SettingTest  ,
test_observerNotificationAvs   
)

Test observer notification.

◆ TEST_F() [23/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_removeObserver   
)

Test addObserver for a setting that exists.

◆ TEST_F() [24/75]

alexaClientSDK::settings::test::TEST_F ( SettingCallbackAdapterTest  ,
test_lambdaCallback   
)

Test callback for lambda functions.

◆ TEST_F() [25/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_removeObserverFailed   
)

Test addObserver for a setting that doesn't exist.

◆ TEST_F() [26/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_setExistingStringSetting   
)

Test manager operations for string setting.

◆ TEST_F() [27/75]

alexaClientSDK::settings::test::TEST_F ( SettingCallbackAdapterTest  ,
test_staticCallback   
)

Test callback for static functions.

◆ TEST_F() [28/75]

alexaClientSDK::settings::test::TEST_F ( SettingsManagerTest  ,
test_clearDataInSettingManagerCallsClearDataInSetting   
)

Test manager getting a clearData callback will call clearData on the setting.

◆ TEST_F() [29/75]

alexaClientSDK::settings::test::TEST_F ( SettingCallbackAdapterTest  ,
test_memberCallback   
)

Test callback for member functions.

◆ TEST_F() [30/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
testSlow_maxRetries   
)

Test retries will give up after N attempts

◆ TEST_F() [31/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_nullEventSenders   
)

Test create with null event senders.

◆ TEST_F() [32/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
testSlow_retryOnInternalError   
)

Test retry on server internal error HTTP response

◆ TEST_F() [33/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_nullStorage   
)

Test create with null storage.

◆ TEST_F() [34/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_nullAssetsManager   
)

Test create with null assets manager.

◆ TEST_F() [35/75]

alexaClientSDK::settings::test::TEST_F ( SettingCallbacksTest  ,
test_lambdaAndStaticCallbacks   
)

Test callback for a mix of lambda and static functions.

◆ TEST_F() [36/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_restoreSynchronized   
)

Test restore when all values are available and synchronized.

◆ TEST_F() [37/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_AVSChangeWakeWordsRequest   
)

Test success flow for avs wake word request.

◆ TEST_F() [38/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
testSlow_retryStopAfterSuccess   
)

Test retry on server internal error HTTP response and will stop after success

◆ TEST_F() [39/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_nullEventSender   
)

Test create with null event sender.

◆ TEST_F() [40/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_nullStorage   
)

Test create with null storage.

◆ TEST_F() [41/75]

alexaClientSDK::settings::test::TEST_F ( SettingCallbacksTest  ,
test_memberCallback   
)

Test callback for member functions.

◆ TEST_F() [42/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_restoreValueNotAvailable   
)

Test restore when value is not available in the database.

◆ TEST_F() [43/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_AVSChangeWakeWordsRequestSetFailed   
)

Test that if the set value fails for avs request, the value doesn't change and report event is sent with original value.

◆ TEST_F() [44/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
testSlow_noRetryOnNonConnected   
)

Test no retry on non-connected HTTP response

◆ TEST_F() [45/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_restoreValueNotAvailableCloudAuthoritative   
)

Test restore when value is not available in the database for a setting that use cloud authoritative default value.

◆ TEST_F() [46/75]

alexaClientSDK::settings::test::TEST_F ( SettingEventSenderTest  ,
testSlow_cancelRetry   
)

Test cancellation of retries

◆ TEST_F() [47/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_AVSChangeWakeWordsRequestSendEventFailed   
)

Test send event failed for avs request.

◆ TEST_F() [48/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_restoreSynchronized   
)

Test restore when the value is available and synchronized.

◆ TEST_F() [49/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_AVSChangeRequest   
)

Test success flow for AVS request.

◆ TEST_F() [50/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_AVSChangeLocaleRequest   
)

Test success flow for avs locale request.

◆ TEST_F() [51/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_AVSChangeRequestSetFailed   
)

Test set value failed for AVS request.

◆ TEST_F() [52/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_AVSChangeLocaleRequestSetFailed   
)

Test set value failed for avs request.

◆ TEST_F() [53/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_AVSChangeRequestStoreFailed   
)

Test store value failed. Revert should be called and AVS notified of previous value.

◆ TEST_F() [54/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_AVSChangeRequestSendEventFailed   
)

Test send event failed for avs request.

◆ TEST_F() [55/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_AVSChangeLocaleRequestSendEventFailed   
)

Test send event failed for avs request.

◆ TEST_F() [56/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_localRequest   
)

Test success flow for local request.

◆ TEST_F() [57/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_restoreValueNotAvailable   
)

Test restore when no value is available in the database. This should run local change to both wake words and locale.

◆ TEST_F() [58/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_localRequestSetFailed   
)

Test set value failed during local request.

◆ TEST_F() [59/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_localRequestStoreFailed   
)

Test store value to database failed for local request.

◆ TEST_F() [60/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localChangeWakeWordsRequest   
)

Test success flow for local request for wake word change.

◆ TEST_F() [61/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_localRequestSendEventFailed   
)

Test send changed event failed for local request. In this case, we should not update the database with SYNCHRONIZED.

◆ TEST_F() [62/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localChangeWakeWordsRequestSetFailed   
)

Test set value failed during local request for wake word change.

◆ TEST_F() [63/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_localChangeSettingOfflineSynchronization   
)

Verify that after network disconnect / reconnect will send out setting events that was changed locally while disconnected.

◆ TEST_F() [64/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localChangeWakeWordsRequestSendEventFailed   
)

TODO: Test send changed event failed while processing wake words local request.

◆ TEST_F() [65/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localChangeLocaleRequest   
)

TODO: Test success flow for local request for wake word change.

◆ TEST_F() [66/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localChangeLocaleRequestSetFailed   
)

TODO: Test set value failed during local request for wake word change.

◆ TEST_F() [67/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localChangeLocaleRequestSendEventFailed   
)

TODO: Test send changed event failed while processing wake words local request.

◆ TEST_F() [68/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localeChangeTriggerWakeWordsChange   
)

TODO: Test locale change when current wake word is not available.

◆ TEST_F() [69/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localeChangeCancelPendingWakeWordsChange   
)

TODO: Test locale change when pending request has a wake word that's not available.

◆ TEST_F() [70/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_localeChangeMergePendingWakeWordsChange   
)

TODO: Test locale change when pending request has a valid wake word selected in the current locale.

◆ TEST_F() [71/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_wakeWordChangeRequestFailedOnCurrentLocale   
)

TODO: Test wake word change when current locale doesn't support requested wake word.

◆ TEST_F() [72/75]

alexaClientSDK::settings::test::TEST_F ( LocaleWakeWordsSettingTest  ,
test_reconnectAfterOfflineChange   
)

Test synchronization once the SDK is re-connected and there was an offline change.

◆ TEST_F() [73/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_avsChangeSettingOfflineSynchronization   
)

Verify that after network disconnect / reconnect will send out setting events that was changed through AVS directive.

◆ TEST_F() [74/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_multipleAVSChanges   
)

Verify that multiple AVS setting changes will be merged. The setting will be changed multiple times immediately one after the other. It's expected that only at most 2 settings are sent, that is, at least 1 has been canceled and the last value sent is the latest one.

◆ TEST_F() [75/75]

alexaClientSDK::settings::test::TEST_F ( SharedAVSSettingProtocolTest  ,
test_multipleLocalChanges   
)

Verify that multiple local setting changes will be merged. The setting will be changed multiple times immediately one after the other. It's expected that only at most 2 settings are sent, that is, at least 1 has been canceled and the last value sent is the latest one.

◆ TEST_TIMEOUT()

static const std::chrono::seconds alexaClientSDK::settings::test::TEST_TIMEOUT ( 10  )
static

General timeout for tests to fail.

Variable Documentation

◆ ALEXA_VALUE

const std::string alexaClientSDK::settings::test::ALEXA_VALUE = "ALEXA"
static

Constant representing "ALEXA" enabled.

◆ BSSID

const auto alexaClientSDK::settings::test::BSSID = "10:00:22:33:44:55"
static

A random valid bssid.

◆ CONNECTION_TYPE

const auto alexaClientSDK::settings::test::CONNECTION_TYPE = NetworkInfo::ConnectionType::WIFI
static

A random valid connection type.

◆ DB_VALUE

const std::string alexaClientSDK::settings::test::DB_VALUE = R"("db-value")"
static

Constant representing a valid database value.

◆ DEFAULT_VALUE

const std::string alexaClientSDK::settings::test::DEFAULT_VALUE = R"("default-value")"
static

Constant representing a default value.

◆ DHCP_SERVER_ADDRESS

const auto alexaClientSDK::settings::test::DHCP_SERVER_ADDRESS = "200.125.4.0"
static

A random valid DHCP server address.

◆ ECHO_VALUE

const std::string alexaClientSDK::settings::test::ECHO_VALUE = "ECHO"
static

Constant representing "ECHO" enabled value.

◆ EMPTY_JSON_LIST

const std::string alexaClientSDK::settings::test::EMPTY_JSON_LIST = "[]"
static

Represents an empty json list.

◆ ENGLISH_CANADA_VALUE

const std::string alexaClientSDK::settings::test::ENGLISH_CANADA_VALUE = "en-CA"
static

Constant representing "en-CA" enabled db value.

◆ ENGLISH_LOCALES

const std::vector<std::string> alexaClientSDK::settings::test::ENGLISH_LOCALES {ENGLISH_CANADA_VALUE}
static

A vector of locales that contains only en-CA.

◆ ESSID

const auto alexaClientSDK::settings::test::ESSID = "essid"
static

A random valid connection type.

◆ EXPECTED_CHANGED_EVENT

const std::string alexaClientSDK::settings::test::EXPECTED_CHANGED_EVENT = R"(\{"event":\{"header":\{"namespace":"NAMESPACE","name":"CHANGEDEVENT","messageId":".*-.*-.*-.*-.*"\},"payload":\{"SETTING":true\}\}\})"
static

The expected changed event format.

◆ EXPECTED_REPORT_EVENT

const std::string alexaClientSDK::settings::test::EXPECTED_REPORT_EVENT = R"(\{"event":\{"header":\{"namespace":"NAMESPACE","name":"REPORTEVENT","messageId":".*-.*-.*-.*-.*"\},"payload":\{"SETTING":true\}\}\})"
static

The expected report event format.

◆ FRENCH_CANADA_VALUE

const std::string alexaClientSDK::settings::test::FRENCH_CANADA_VALUE = "fr-CA"
static

Constant representing "fr-CA" enabled db value.

◆ FRENCH_LOCALES

const std::vector<std::string> alexaClientSDK::settings::test::FRENCH_LOCALES {FRENCH_CANADA_VALUE}
static

A vector of locales that contains only fr-CA.

◆ globalTimezone

std::string alexaClientSDK::settings::test::globalTimezone = INIT_TIMEZONE

Used to test static callback.

◆ INIT_VALUE [1/2]

constexpr bool alexaClientSDK::settings::test::INIT_VALUE = false
static

Initial value for the setting.

◆ INIT_VALUE [2/2]

const std::string alexaClientSDK::settings::test::INIT_VALUE = "value"
static

The value used to initialize the hello object.

◆ INIT_VALUE_STR

const std::string alexaClientSDK::settings::test::INIT_VALUE_STR = "false"
static

String representation of the initial value.

◆ INVALID_VALUE [1/2]

const std::string alexaClientSDK::settings::test::INVALID_VALUE = ""
static

Empty string used to represent invalid value by the protocol.

◆ INVALID_VALUE [2/2]

const std::string alexaClientSDK::settings::test::INVALID_VALUE = "INVALID"
static

Constant representing an invalid wake word / locale value.

◆ IP_ADDRESS

const auto alexaClientSDK::settings::test::IP_ADDRESS = "1.2.3.5"
static

A random valid IP address.

◆ IS_STATIC_IP

const auto alexaClientSDK::settings::test::IS_STATIC_IP = false
static

A random valid connection type.

◆ KEY

const std::string alexaClientSDK::settings::test::KEY = "key"
static

The key used for converting the hello object.

◆ key

const std::string alexaClientSDK::settings::test::key = METADATA.eventNamespace + "::" + METADATA.settingName
static

The database key to be used by the protocol given the METADATA object.

◆ LOCALES_KEY

const std::string alexaClientSDK::settings::test::LOCALES_KEY = "System.locales"
static

The database key to be used to save wake words.

◆ MAC_ADDRESS

const auto alexaClientSDK::settings::test::MAC_ADDRESS = "00:FF:00:FF:00:FF"
static

A random valid MAC address.

◆ MAX_RETRY_WAIT

const auto alexaClientSDK::settings::test::MAX_RETRY_WAIT = std::chrono::seconds(4)
static

◆ METADATA

const SettingEventMetadata alexaClientSDK::settings::test::METADATA = {"NAMESPACE", "CHANGEDEVENT", "REPORTEVENT", "SETTING"}
static

The metadata for the event messages used in this test.

A dummy setting metadata.

◆ MY_WAIT_TIMEOUT

const std::chrono::seconds alexaClientSDK::settings::test::MY_WAIT_TIMEOUT {5}
static

Constant representing the timeout for test events.

Note
Use a large enough value that should not fail even in slower systems.

◆ NEW_VALUE [1/2]

constexpr bool alexaClientSDK::settings::test::NEW_VALUE = true
static

New value for the setting.

◆ NEW_VALUE [2/2]

const std::string alexaClientSDK::settings::test::NEW_VALUE = R"("new-value")"
static

Constant representing a valid new value.

◆ NEW_VALUE_STR

const std::string alexaClientSDK::settings::test::NEW_VALUE_STR = "true"
static

String representation of the new value.

◆ RETRY_TABLE

const std::vector<int> alexaClientSDK::settings::test::RETRY_TABLE
static
Initial value:
= {
500,
1000,
1500
}

Table with the retry times on subsequent retries.

◆ SUBNET_MASK

const auto alexaClientSDK::settings::test::SUBNET_MASK = "1.2.3.0/2"
static

A random valid subnet mask.

◆ SUPPORTED_LOCALES

const std::set<std::string> alexaClientSDK::settings::test::SUPPORTED_LOCALES {ENGLISH_CANADA_VALUE, FRENCH_CANADA_VALUE}
static

Set of supported locales.

◆ SUPPORTED_WAKE_WORDS_COMBINATION

const MockLocaleAssetsManager::LocaleAssetsManagerInterface::WakeWordsSets alexaClientSDK::settings::test::SUPPORTED_WAKE_WORDS_COMBINATION
static
Initial value:
{
static const std::string ECHO_VALUE
Constant representing "ECHO" enabled value.
Definition: LocaleWakeWordsSettingTest.cpp:55
static const std::string ALEXA_VALUE
Constant representing "ALEXA" enabled.
Definition: LocaleWakeWordsSettingTest.cpp:52

Set of combinations of supported wake words.

◆ TEST_TIMEOUT

const auto alexaClientSDK::settings::test::TEST_TIMEOUT = std::chrono::seconds(5)
static

The timeout used throughout the tests.

◆ WAKE_WORDS_KEY

const std::string alexaClientSDK::settings::test::WAKE_WORDS_KEY = "SpeechRecognizer.wakeWords"
static

The database key to be used to save wake words.

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