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

Classes

class  ConfigurationNodeTest
 

Functions

bool initializeConfiguration (const std::string &jsonConfiguration)
 
 TEST_F (ConfigurationNodeTest, test_initializationAndAccess)
 
 TEST_F (ConfigurationNodeTest, test_arrayElement)
 
 TEST_F (ConfigurationNodeTest, test_emptyArrayElement)
 

Variables

static const std::string NON_OBJECT = "non-existent-object"
 Name of non-existent object for exercising failure to find a ConfigurationNode. More...
 
static const std::string OBJECT1 = "object1"
 Name of first root level object. More...
 
static const std::string BOOL1_1 = "bool1.1"
 Name of first bool value in first root level object. More...
 
static const bool BOOL_VALUE1_1 = true
 Value of first bool value in first root level object. More...
 
static const std::string OBJECT1_1 = "object1.1"
 Name of first object inside first root level object. More...
 
static const std::string STRING1_1_1 = "string1.1.1"
 Name of first string value in first object inside first root level object. More...
 
static const std::string STRING_VALUE1_1_1 = "stringValue1.1.1"
 Value of first string value in first object inside first root level object. More...
 
static const std::string OBJECT2 = "object2"
 Name of second root level object. More...
 
static const std::string STRING2_1 = "string2.1"
 Name of first string in second root level object. More...
 
static const std::string NEW_STRING_VALUE2_1 = "new-stringValue2.1"
 Replaced value of first string in second root level object. More...
 
static const std::string NON_EXISTENT_INT2_1 = "non-existent-int2.1"
 Name for non-existent int value in second root level object. More...
 
static const int NON_EXISTENT_INT_VALUE2_1 = 123
 Default value for non-existent int value in second root level object. More...
 
static const std::string INT2_1 = "int2.1"
 Name of first int value in second root level object. More...
 
static const std::string OBJECT2_1 = "object2.1"
 Name of first object inside second root level object. More...
 
static const std::string STRING2_1_1 = "string2.1.1"
 Name of first string inside first object inside second root level object. More...
 
static const std::string NEW_STRING_VALUE2_1_1 = "new-stringValue2.1.1"
 Replaced value of first string inside first object inside second root level object. More...
 
static const std::string BAD_JSON = "{ bad json }"
 Bad JSON string to verify handling the failure to parse JSON. More...
 
static const std::string ARRAY_OBJECT = "arrayObject"
 Name of array root level object. More...
 
static const std::string FIRST_JSON
 First JSON string to parse, serving as default for configuration values. More...
 
static const std::string SECOND_JSON
 Second JSON string to parse, overlaying configuration values from FIRST_JSON. More...
 
static const std::string THIRD_JSON
 Third JSON string to parse, overlaying configuration values from FIRST_JSON and SECOND_JSON. More...
 
static const std::string ARRAY_JSON
 A JSON string to test array. More...
 

Function Documentation

◆ initializeConfiguration()

bool alexaClientSDK::avsCommon::utils::configuration::test::initializeConfiguration ( const std::string &  jsonConfiguration)

Initializes the root configuration with the given JSON string.

Parameters
jsonConfigurationThe configuration string.
Returns
Whether it succeeded or not.

◆ TEST_F() [1/3]

alexaClientSDK::avsCommon::utils::configuration::test::TEST_F ( ConfigurationNodeTest  ,
test_initializationAndAccess   
)

Verify initialization a configuration. Verify both the implementation of accessor methods and the results of merging JSON streams.

◆ TEST_F() [2/3]

alexaClientSDK::avsCommon::utils::configuration::test::TEST_F ( ConfigurationNodeTest  ,
test_arrayElement   
)

◆ TEST_F() [3/3]

alexaClientSDK::avsCommon::utils::configuration::test::TEST_F ( ConfigurationNodeTest  ,
test_emptyArrayElement   
)

Variable Documentation

◆ ARRAY_JSON

const std::string alexaClientSDK::avsCommon::utils::configuration::test::ARRAY_JSON
static
Initial value:
= R"(
{
"arrayObject" : [
{
"object2.1" : "new-stringValue2.1"
},
{
"object2.1" : "new-stringValue2.1.1"
}
]
})"

A JSON string to test array.

◆ ARRAY_OBJECT

const std::string alexaClientSDK::avsCommon::utils::configuration::test::ARRAY_OBJECT = "arrayObject"
static

Name of array root level object.

◆ BAD_JSON

const std::string alexaClientSDK::avsCommon::utils::configuration::test::BAD_JSON = "{ bad json }"
static

Bad JSON string to verify handling the failure to parse JSON.

◆ BOOL1_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::BOOL1_1 = "bool1.1"
static

Name of first bool value in first root level object.

◆ BOOL_VALUE1_1

const bool alexaClientSDK::avsCommon::utils::configuration::test::BOOL_VALUE1_1 = true
static

Value of first bool value in first root level object.

◆ FIRST_JSON

const std::string alexaClientSDK::avsCommon::utils::configuration::test::FIRST_JSON
static
Initial value:
= R"(
{
"object1" : {
"bool1.1" : true
},
"object2" : {
"int2.1" : 21,
"string2.1" : "stringValue2.1",
"object2.1" : {
"string2.1.1" : "stringValue2.1.1"
}
}
})"

First JSON string to parse, serving as default for configuration values.

◆ INT2_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::INT2_1 = "int2.1"
static

Name of first int value in second root level object.

◆ NEW_STRING_VALUE2_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::NEW_STRING_VALUE2_1 = "new-stringValue2.1"
static

Replaced value of first string in second root level object.

◆ NEW_STRING_VALUE2_1_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::NEW_STRING_VALUE2_1_1 = "new-stringValue2.1.1"
static

Replaced value of first string inside first object inside second root level object.

◆ NON_EXISTENT_INT2_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::NON_EXISTENT_INT2_1 = "non-existent-int2.1"
static

Name for non-existent int value in second root level object.

◆ NON_EXISTENT_INT_VALUE2_1

const int alexaClientSDK::avsCommon::utils::configuration::test::NON_EXISTENT_INT_VALUE2_1 = 123
static

Default value for non-existent int value in second root level object.

◆ NON_OBJECT

const std::string alexaClientSDK::avsCommon::utils::configuration::test::NON_OBJECT = "non-existent-object"
static

Name of non-existent object for exercising failure to find a ConfigurationNode.

◆ OBJECT1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::OBJECT1 = "object1"
static

Name of first root level object.

◆ OBJECT1_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::OBJECT1_1 = "object1.1"
static

Name of first object inside first root level object.

◆ OBJECT2

const std::string alexaClientSDK::avsCommon::utils::configuration::test::OBJECT2 = "object2"
static

Name of second root level object.

◆ OBJECT2_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::OBJECT2_1 = "object2.1"
static

Name of first object inside second root level object.

◆ SECOND_JSON

const std::string alexaClientSDK::avsCommon::utils::configuration::test::SECOND_JSON
static
Initial value:
= R"(
{
"object1" : {
"object1.1" : {
"string1.1.1" : "stringValue1.1.1"
},
"int1.1" : 11
}
})"

Second JSON string to parse, overlaying configuration values from FIRST_JSON.

◆ STRING1_1_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::STRING1_1_1 = "string1.1.1"
static

Name of first string value in first object inside first root level object.

◆ STRING2_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::STRING2_1 = "string2.1"
static

Name of first string in second root level object.

◆ STRING2_1_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::STRING2_1_1 = "string2.1.1"
static

Name of first string inside first object inside second root level object.

◆ STRING_VALUE1_1_1

const std::string alexaClientSDK::avsCommon::utils::configuration::test::STRING_VALUE1_1_1 = "stringValue1.1.1"
static

Value of first string value in first object inside first root level object.

◆ THIRD_JSON

const std::string alexaClientSDK::avsCommon::utils::configuration::test::THIRD_JSON
static
Initial value:
= R"(
{
"object2" : {
"int2.1" : 21,
"string2.1" : "new-stringValue2.1",
"object2.1" : {
"string2.1.1" : "new-stringValue2.1.1"
}
}
})"

Third JSON string to parse, overlaying configuration values from FIRST_JSON and SECOND_JSON.

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