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

Classes

class  JsonGeneratorTest
 
class  JSONUtilTest
 Define test fixture for testing AVSMessage. More...
 

Functions

 TEST_F (JsonGeneratorTest, test_emptyJson)
 Test json generator when no member is given. More...
 
 TEST_F (JsonGeneratorTest, test_jsonObject)
 Test json generator object creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonInt)
 Test json generator int creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonLong)
 Test json generator long creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonUInt)
 Test json generator long creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonULong)
 Test json generator long creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonBool)
 Test json generator boolean creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonDouble)
 Test json generator double creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonCString)
 Test json generator char creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonNullCString)
 Test json generator char creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonStringArray)
 Test json generator for string array creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonArray)
 Test json generator for array creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonEmptyList)
 Test json generator for empty array creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonRawJsonMember)
 Test json raw creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonRawJsonMemberFailed)
 Test json raw validation. More...
 
 TEST_F (JsonGeneratorTest, test_closeTooMany)
 Test close when there is no open object. More...
 
 TEST_F (JsonGeneratorTest, test_openObjects)
 Test to string with open objects. More...
 
 TEST_F (JsonGeneratorTest, test_finalizeObjects)
 Test finalize open objects. More...
 
 TEST_F (JsonGeneratorTest, test_addMemberAfterFinalize)
 Test operations after finalize. More...
 
 TEST_F (JsonGeneratorTest, test_jsonCollectionOfStringArray)
 Test json generator for collection of string array creation. More...
 
 TEST_F (JsonGeneratorTest, test_jsonCollectionOfEmptyCollection)
 Test json generator for collection of empty collection. More...
 
 TEST_F (JsonGeneratorTest, test_jsonCollectionOfEmptyStringArray)
 Test json generator for collection of empty string array. More...
 
 TEST_F (JSONUtilTest, test_validJsonChildObjectAsString)
 
 TEST_F (JSONUtilTest, test_validJsonScalarString)
 
 TEST_F (JSONUtilTest, test_validJsonInteger)
 
 TEST_F (JSONUtilTest, test_retrieveValueStringBasedInt64FromInvalidJSON)
 
 TEST_F (JSONUtilTest, test_retrieveValueStringBasedStringFromInvalidJSON)
 
 TEST_F (JSONUtilTest, test_retrieveValueStringBasedWithIncorrectKey)
 
 TEST_F (JSONUtilTest, test_retrieveValueStringBasedWithNull)
 
 TEST_F (JSONUtilTest, test_retrieveValueDocumentBasedWithInvalidValueType)
 
 TEST_F (JSONUtilTest, test_retrieveValueDocumentBasedWithNull)
 
 TEST_F (JSONUtilTest, test_retrieveValueDocumentBasedWithValidInt64)
 
 TEST_F (JSONUtilTest, test_findNodeNull)
 
 TEST_F (JSONUtilTest, test_findNodeKeyExists)
 
 TEST_F (JSONUtilTest, test_findNodeKeyMissing)
 
 TEST_F (JSONUtilTest, test_parseJSONNullOutputParam)
 
 TEST_F (JSONUtilTest, test_parseJSONValidJSON)
 
 TEST_F (JSONUtilTest, test_parseJSONInvalidJSON)
 
 TEST_F (JSONUtilTest, test_convertToStringValueWithString)
 
 TEST_F (JSONUtilTest, test_convertToStringValueWithObject)
 
 TEST_F (JSONUtilTest, test_convertToStringValueWithInvalidValue)
 
 TEST_F (JSONUtilTest, test_convertToStringValueWithNullOutputParam)
 
 TEST_F (JSONUtilTest, test_convertToInt64ValueWithInt64)
 
 TEST_F (JSONUtilTest, test_convertToInt64ValueWithDouble)
 
 TEST_F (JSONUtilTest, test_convertToUint64ValueWithNullOutputParam)
 
 TEST_F (JSONUtilTest, test_convertToUint64ValueWithUint64)
 
 TEST_F (JSONUtilTest, test_convertToUint64ValueWithDouble)
 
 TEST_F (JSONUtilTest, test_convertToInt64ValueWithNullOutputParam)
 
 TEST_F (JSONUtilTest, test_convertToBoolValueWithNullOutputParam)
 
 TEST_F (JSONUtilTest, test_convertToBoolValueWithNonBool)
 
 TEST_F (JSONUtilTest, test_convertToBoolValueWithBool)
 
 TEST_F (JSONUtilTest, test_retrieveStringArraySucceed)
 
 TEST_F (JSONUtilTest, test_retrieveStringArrayEmpty)
 
 TEST_F (JSONUtilTest, test_retrieveStringArrayNonArray)
 
 TEST_F (JSONUtilTest, test_retrieveStringArrayNonJson)
 
 TEST_F (JSONUtilTest, test_retrieveStringArrayWithNonStringArrayFails)
 
 TEST_F (JSONUtilTest, test_convertToJsonStringFromEmptySet)
 
 TEST_F (JSONUtilTest, test_convertToJsonStringFromStringSet)
 
 TEST_F (JSONUtilTest, test_convertToJsonFromStringVector)
 
 TEST_F (JSONUtilTest, test_retrieveElementsWithKeySucceed)
 
 TEST_F (JSONUtilTest, test_retrieveMixStringNonStringElementsWithKeySucceed)
 
 TEST_F (JSONUtilTest, test_retrieveElementsWithKeyEmptyArray)
 
 TEST_F (JSONUtilTest, test_retrieveElementsWithKeyNonArray)
 
 TEST_F (JSONUtilTest, test_retrieveElementsWithKeyMissing)
 
 TEST_F (JSONUtilTest, test_retrieveArrayOfElementsWithKeySucceed)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayOnlyKeyEntry)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayInvalidEntry)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArray)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayMultiple)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayAll)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayNoneFew)
 
 TEST_F (JSONUtilTest, test_retrieveStringMapFromArrayNoneAll)
 
 TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArray)
 
 TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayInvalidEntry)
 
 TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayInvalidKey)
 
 TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayEmptyArray)
 
 TEST_F (JSONUtilTest, test_retrieveArrayStringMapFromArrayEmptyMap)
 

Variables

static const std::string JSON_MESSAGE_HEADER_STRING = "header"
 The header key in the JSON content of an AVS message. More...
 
static const std::string JSON_MESSAGE_NAMESPACE_STRING = "namespace"
 The namespace key in the JSON content of an AVS message. More...
 
static const std::string JSON_MESSAGE_NAME_STRING = "name"
 The name key in the JSON content of an AVS message. More...
 
static const std::string JSON_MESSAGE_ID_STRING = "messageId"
 The messageId key in the JSON content of an AVS message. More...
 
static const std::string JSON_MESSAGE_DIALOG_REQUEST_ID_STRING = "dialogRequestId"
 The dialogRequestId key in the JSON content of an AVS message. More...
 
static const std::string JSON_MESSAGE_PAYLOAD_STRING = "payload"
 The payload key in the JSON content of an AVS message. More...
 
static const std::string DIRECTIVE_KEY = "directive"
 The directive key in the JSON content of an AVS message. More...
 
static const std::string NAMESPACE_TEST = "SpeechSynthesizer"
 The namespace in AVS message. More...
 
static const std::string NAME_TEST = "Speak"
 The name field in AVS message. More...
 
static const std::string MESSAGE_ID_TEST = "testMessageId"
 The messageId in AVS message. More...
 
static const std::string DIALOG_REQUEST_ID_TEST = "dialogRequestIdTest"
 The dialogRequestId in AVS message. More...
 
static const std::string PAYLOAD_TEST = R"({"url":"cid:testCID","format":"testFormat","token":"testToken"})"
 The payload in AVS message. More...
 
static const std::string OUTPUT_DEFAULT_TEXT_STRING = "defaultString"
 A random text to test the output value modification. More...
 
static const int OUTPUT_DEFAULT_INT_VALUE = 42
 A random integer to test the output value modification. More...
 
static const std::string EXPECTED_STRING_VALUE = "expectedValue"
 Expected string value. More...
 
static const int EXPECTED_INT_VALUE = 123
 Expected int value. More...
 
static const uint64_t EXPECTED_UNSIGNED_INT64_VALUE = UINT64_MAX
 Expected uint64_t value. More...
 
static const std::string EXPECTED_INT_VALUE_STRINGIFIED = "123"
 Expected int value converted to a string. More...
 
static const std::string EMPTY_DIRECTIVE
 An invalid AVS directive JSON.``. More...
 
static const std::string SPEAK_DIRECTIVE
 A sample AVS speak directive with all valid JSON keys. More...
 
static const std::string VALUE_KEY = "anInt64"
 The JSON key used in value reading tests. More...
 
static const std::string MISSING_KEY = "missingKey"
 A JSON key not used in value reading tests. More...
 
static const std::string INVALID_JSON = "invalidTestJSON"
 An invalid JSON string for testing. More...
 
static const std::string VALID_JSON_STRING_VALUE = R"({")" + VALUE_KEY + R"(":")" + EXPECTED_STRING_VALUE + R"("})"
 A valid JSON string with scalar string value. More...
 
static const std::string VALID_JSON_INTEGER_VALUE
 A valid JSON string with integer value. More...
 
static const double A_DOUBLE = 1.0
 A double. More...
 
static const bool A_BOOL = false
 A bool used for construction of rapidjson::Value objects. More...
 
static const std::string STRING_VALUE = "stringValue"
 A valid string JSON Value. More...
 
static const std::string STRING_VALUE_EMPTY_JSON_OBJECT = "{}"
 A valid empty string JSON Value. More...
 

Function Documentation

◆ TEST_F() [1/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_emptyJson   
)

Test json generator when no member is given.

◆ TEST_F() [2/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonObject   
)

Test json generator object creation.

◆ TEST_F() [3/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonInt   
)

Test json generator int creation.

◆ TEST_F() [4/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonLong   
)

Test json generator long creation.

◆ TEST_F() [5/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonUInt   
)

Test json generator long creation.

◆ TEST_F() [6/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonULong   
)

Test json generator long creation.

◆ TEST_F() [7/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonBool   
)

Test json generator boolean creation.

◆ TEST_F() [8/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonDouble   
)

Test json generator double creation.

◆ TEST_F() [9/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonCString   
)

Test json generator char creation.

◆ TEST_F() [10/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonNullCString   
)

Test json generator char creation.

◆ TEST_F() [11/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonStringArray   
)

Test json generator for string array creation.

◆ TEST_F() [12/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_validJsonChildObjectAsString   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = std::string for getting child object as a string.

◆ TEST_F() [13/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonArray   
)

Test json generator for array creation.

◆ TEST_F() [14/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_validJsonScalarString   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = std::string for getting value of a scalar string.

◆ TEST_F() [15/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonEmptyList   
)

Test json generator for empty array creation.

◆ TEST_F() [16/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonRawJsonMember   
)

Test json raw creation.

◆ TEST_F() [17/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_validJsonInteger   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = int64 for getting an integer value.

◆ TEST_F() [18/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonRawJsonMemberFailed   
)

Test json raw validation.

◆ TEST_F() [19/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueStringBasedInt64FromInvalidJSON   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = int64 and an invalid JSON. Returns false.

◆ TEST_F() [20/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_closeTooMany   
)

Test close when there is no open object.

◆ TEST_F() [21/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueStringBasedStringFromInvalidJSON   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = std::string and an invalid JSON. Returns false.

◆ TEST_F() [22/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_openObjects   
)

Test to string with open objects.

◆ TEST_F() [23/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueStringBasedWithIncorrectKey   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = int64 and an incorrect key. Returns false.

◆ TEST_F() [24/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_finalizeObjects   
)

Test finalize open objects.

◆ TEST_F() [25/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_addMemberAfterFinalize   
)

Test operations after finalize.

◆ TEST_F() [26/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueStringBasedWithNull   
)

Tests retrieveValue(const std::string jsonString, const std::string& key, T* value) with T = int64 and a null output param. Returns false.

◆ TEST_F() [27/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueDocumentBasedWithInvalidValueType   
)

Tests retrieveValue(const rapidjson::Value& jsonNode, const std::string& key, T* value) with T = int64 and a value of invalid type. Returns false.

◆ TEST_F() [28/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonCollectionOfStringArray   
)

Test json generator for collection of string array creation.

◆ TEST_F() [29/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueDocumentBasedWithNull   
)

Tests retrieveValue(const rapidjson::Value& jsonNode, const std::string& key, T* value) with T = int64 and a null output param. Returns false.

◆ TEST_F() [30/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonCollectionOfEmptyCollection   
)

Test json generator for collection of empty collection.

◆ TEST_F() [31/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveValueDocumentBasedWithValidInt64   
)

Tests retrieveValue(const rapidjson::Value& jsonNode, const std::string& key, T* value) with T = int64 and a valid value. Returns true and obtains the correct value.

◆ TEST_F() [32/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JsonGeneratorTest  ,
test_jsonCollectionOfEmptyStringArray   
)

Test json generator for collection of empty string array.

◆ TEST_F() [33/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_findNodeNull   
)

Tests findNode with a Null output param. Returns false.

◆ TEST_F() [34/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_findNodeKeyExists   
)

Tests findNode with a valid key. Returns true with iterator != MemberEnd().

◆ TEST_F() [35/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_findNodeKeyMissing   
)

Tests findNode with a non-existent key. Returns false.

◆ TEST_F() [36/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_parseJSONNullOutputParam   
)

Tests parseJSON with a null output param. Returns false.

◆ TEST_F() [37/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_parseJSONValidJSON   
)

Tests parseJSON with a valid json. Returns true.

◆ TEST_F() [38/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_parseJSONInvalidJSON   
)

Tests parseJSON with an invalid json. Returns false.

◆ TEST_F() [39/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToStringValueWithString   
)

Tests convertToValue<std::string> with Value of rapidjson::Type::kStringType. Returns true and contains the correct value.

◆ TEST_F() [40/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToStringValueWithObject   
)

Tests convertToValue<std::string> with Value of rapidjson::Type::kObjectType. Returns true and contains the correct value.

◆ TEST_F() [41/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToStringValueWithInvalidValue   
)

Tests convertToValue<std::string> with and invalid Value of rapidjson::Type::kNullType. Returns false.

◆ TEST_F() [42/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToStringValueWithNullOutputParam   
)

Tests convertToValue<std::string> with null output param. Returns false.

◆ TEST_F() [43/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToInt64ValueWithInt64   
)

Tests convertToValue<int64_t> with valid int64_6. Returns true and contains the correct value.

◆ TEST_F() [44/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToInt64ValueWithDouble   
)

Tests convertToValue<int64_t> with double. Returns false.

◆ TEST_F() [45/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToUint64ValueWithNullOutputParam   
)

Tests convertToValue<uint64_t> with null output param. Returns false.

◆ TEST_F() [46/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToUint64ValueWithUint64   
)

Tests convertToValue<uint64_t> with valid uint64_t. Returns true and contains the correct value.

◆ TEST_F() [47/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToUint64ValueWithDouble   
)

Tests convertToValue<uint64_t> with double. Returns false.

◆ TEST_F() [48/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToInt64ValueWithNullOutputParam   
)

Tests convertToValue<int64_t> with null output param. Returns false.

◆ TEST_F() [49/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToBoolValueWithNullOutputParam   
)

Tests convertToValue<bool> with null output param. Returns false.

◆ TEST_F() [50/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToBoolValueWithNonBool   
)

Tests convertToValue<bool> with a nonbool. Returns false.

◆ TEST_F() [51/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToBoolValueWithBool   
)

Tests convertToValue<bool> with valid bool. Returns true and contains the correct value.

◆ TEST_F() [52/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringArraySucceed   
)

Test convert to string set with valid entry.

◆ TEST_F() [53/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringArrayEmpty   
)

Test convert to string set with empty entry.

◆ TEST_F() [54/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringArrayNonArray   
)

Test convert to string set with non-array.

◆ TEST_F() [55/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringArrayNonJson   
)

Test convert to string set with invalid json.

◆ TEST_F() [56/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringArrayWithNonStringArrayFails   
)

Test convert to string set with an array with elements that are not string.

◆ TEST_F() [57/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToJsonStringFromEmptySet   
)

Test convert to string set with empty set.

◆ TEST_F() [58/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToJsonStringFromStringSet   
)

Test convert to string set with non-empty set.

◆ TEST_F() [59/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_convertToJsonFromStringVector   
)

Test convert to json list with non-empty string vector.

◆ TEST_F() [60/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveElementsWithKeySucceed   
)

Test convert to string set with valid entry.

◆ TEST_F() [61/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveMixStringNonStringElementsWithKeySucceed   
)

Test convert to string set with mix of string and non-strings entries.

◆ TEST_F() [62/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveElementsWithKeyEmptyArray   
)

Test convert to string set with empty entry.

◆ TEST_F() [63/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveElementsWithKeyNonArray   
)

Test convert to string set with non-array.

◆ TEST_F() [64/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveElementsWithKeyMissing   
)

Test convert to string set with non-array.

◆ TEST_F() [65/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveArrayOfElementsWithKeySucceed   
)

Test convert to string array with valid entry.

◆ TEST_F() [66/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArrayOnlyKeyEntry   
)

Test convert to map from string array with only key entry.

◆ TEST_F() [67/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArrayInvalidEntry   
)

Test convert to map from string array with invalid entry.

◆ TEST_F() [68/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArray   
)

Test convert to map from string array with valid entry.

◆ TEST_F() [69/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArrayMultiple   
)

Test convert to map from string array with multiple valid entries.

◆ TEST_F() [70/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArrayAll   
)

Test convert to map from string array with multiple valid entries.

◆ TEST_F() [71/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArrayNoneFew   
)

Test convert to map from string array with valid and empty entries.

◆ TEST_F() [72/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveStringMapFromArrayNoneAll   
)

Test check map is empty for empty or missing header entries in JSON

◆ TEST_F() [73/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveArrayStringMapFromArray   
)

Test convert to vector of map from string array with valid entry.

◆ TEST_F() [74/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveArrayStringMapFromArrayInvalidEntry   
)

Test convert to vector of map from string array with invalid entry.

◆ TEST_F() [75/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveArrayStringMapFromArrayInvalidKey   
)

Test convert to vector of map from string array with missing key.

◆ TEST_F() [76/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveArrayStringMapFromArrayEmptyArray   
)

Test convert to vector of map from string array with empty Array.

◆ TEST_F() [77/77]

alexaClientSDK::avsCommon::utils::json::test::TEST_F ( JSONUtilTest  ,
test_retrieveArrayStringMapFromArrayEmptyMap   
)

Test convert to vector of map from string array with empty Array.

Variable Documentation

◆ A_BOOL

const bool alexaClientSDK::avsCommon::utils::json::test::A_BOOL = false
static

A bool used for construction of rapidjson::Value objects.

◆ A_DOUBLE

const double alexaClientSDK::avsCommon::utils::json::test::A_DOUBLE = 1.0
static

A double.

◆ DIALOG_REQUEST_ID_TEST

const std::string alexaClientSDK::avsCommon::utils::json::test::DIALOG_REQUEST_ID_TEST = "dialogRequestIdTest"
static

The dialogRequestId in AVS message.

◆ DIRECTIVE_KEY

const std::string alexaClientSDK::avsCommon::utils::json::test::DIRECTIVE_KEY = "directive"
static

The directive key in the JSON content of an AVS message.

◆ EMPTY_DIRECTIVE

const std::string alexaClientSDK::avsCommon::utils::json::test::EMPTY_DIRECTIVE
static
Initial value:
= R"({
"directive": {
}
})"

An invalid AVS directive JSON.``.

◆ EXPECTED_INT_VALUE

const int alexaClientSDK::avsCommon::utils::json::test::EXPECTED_INT_VALUE = 123
static

Expected int value.

◆ EXPECTED_INT_VALUE_STRINGIFIED

const std::string alexaClientSDK::avsCommon::utils::json::test::EXPECTED_INT_VALUE_STRINGIFIED = "123"
static

Expected int value converted to a string.

◆ EXPECTED_STRING_VALUE

const std::string alexaClientSDK::avsCommon::utils::json::test::EXPECTED_STRING_VALUE = "expectedValue"
static

Expected string value.

◆ EXPECTED_UNSIGNED_INT64_VALUE

const uint64_t alexaClientSDK::avsCommon::utils::json::test::EXPECTED_UNSIGNED_INT64_VALUE = UINT64_MAX
static

Expected uint64_t value.

◆ INVALID_JSON

const std::string alexaClientSDK::avsCommon::utils::json::test::INVALID_JSON = "invalidTestJSON"
static

An invalid JSON string for testing.

◆ JSON_MESSAGE_DIALOG_REQUEST_ID_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_DIALOG_REQUEST_ID_STRING = "dialogRequestId"
static

The dialogRequestId key in the JSON content of an AVS message.

◆ JSON_MESSAGE_HEADER_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_HEADER_STRING = "header"
static

The header key in the JSON content of an AVS message.

◆ JSON_MESSAGE_ID_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_ID_STRING = "messageId"
static

The messageId key in the JSON content of an AVS message.

◆ JSON_MESSAGE_NAME_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_NAME_STRING = "name"
static

The name key in the JSON content of an AVS message.

◆ JSON_MESSAGE_NAMESPACE_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_NAMESPACE_STRING = "namespace"
static

The namespace key in the JSON content of an AVS message.

◆ JSON_MESSAGE_PAYLOAD_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::JSON_MESSAGE_PAYLOAD_STRING = "payload"
static

The payload key in the JSON content of an AVS message.

◆ MESSAGE_ID_TEST

const std::string alexaClientSDK::avsCommon::utils::json::test::MESSAGE_ID_TEST = "testMessageId"
static

The messageId in AVS message.

◆ MISSING_KEY

const std::string alexaClientSDK::avsCommon::utils::json::test::MISSING_KEY = "missingKey"
static

A JSON key not used in value reading tests.

◆ NAME_TEST

const std::string alexaClientSDK::avsCommon::utils::json::test::NAME_TEST = "Speak"
static

The name field in AVS message.

◆ NAMESPACE_TEST

const std::string alexaClientSDK::avsCommon::utils::json::test::NAMESPACE_TEST = "SpeechSynthesizer"
static

The namespace in AVS message.

◆ OUTPUT_DEFAULT_INT_VALUE

const int alexaClientSDK::avsCommon::utils::json::test::OUTPUT_DEFAULT_INT_VALUE = 42
static

A random integer to test the output value modification.

◆ OUTPUT_DEFAULT_TEXT_STRING

const std::string alexaClientSDK::avsCommon::utils::json::test::OUTPUT_DEFAULT_TEXT_STRING = "defaultString"
static

A random text to test the output value modification.

◆ PAYLOAD_TEST

const std::string alexaClientSDK::avsCommon::utils::json::test::PAYLOAD_TEST = R"({"url":"cid:testCID","format":"testFormat","token":"testToken"})"
static

The payload in AVS message.

◆ SPEAK_DIRECTIVE

const std::string alexaClientSDK::avsCommon::utils::json::test::SPEAK_DIRECTIVE
static
Initial value:
= R"({
"directive": {
"header": {
"namespace":")" + NAMESPACE_TEST + R"(",
"name": ")" + NAME_TEST + R"(",
"messageId": ")" + MESSAGE_ID_TEST + R"(",
"dialogRequestId": ")" + DIALOG_REQUEST_ID_TEST + R"("
},
"payload": )" + PAYLOAD_TEST + R"(
}
})"
static const std::string DIALOG_REQUEST_ID_TEST
The dialogRequestId in AVS message.
Definition: JSONUtilTest.cpp:60
static const std::string NAME_TEST
The name field in AVS message.
Definition: JSONUtilTest.cpp:56
static const std::string PAYLOAD_TEST
The payload in AVS message.
Definition: JSONUtilTest.cpp:62
static const std::string MESSAGE_ID_TEST
The messageId in AVS message.
Definition: JSONUtilTest.cpp:58
static const std::string NAMESPACE_TEST
The namespace in AVS message.
Definition: JSONUtilTest.cpp:54

A sample AVS speak directive with all valid JSON keys.

◆ STRING_VALUE

const std::string alexaClientSDK::avsCommon::utils::json::test::STRING_VALUE = "stringValue"
static

A valid string JSON Value.

◆ STRING_VALUE_EMPTY_JSON_OBJECT

const std::string alexaClientSDK::avsCommon::utils::json::test::STRING_VALUE_EMPTY_JSON_OBJECT = "{}"
static

A valid empty string JSON Value.

◆ VALID_JSON_INTEGER_VALUE

const std::string alexaClientSDK::avsCommon::utils::json::test::VALID_JSON_INTEGER_VALUE
static
Initial value:
= R"({")"
static const std::string EXPECTED_INT_VALUE_STRINGIFIED
Expected int value converted to a string.
Definition: JSONUtilTest.cpp:75
static const std::string VALUE_KEY
The JSON key used in value reading tests.
Definition: JSONUtilTest.cpp:99

A valid JSON string with integer value.

◆ VALID_JSON_STRING_VALUE

const std::string alexaClientSDK::avsCommon::utils::json::test::VALID_JSON_STRING_VALUE = R"({")" + VALUE_KEY + R"(":")" + EXPECTED_STRING_VALUE + R"("})"
static

A valid JSON string with scalar string value.

◆ VALUE_KEY

const std::string alexaClientSDK::avsCommon::utils::json::test::VALUE_KEY = "anInt64"
static

The JSON key used in value reading tests.

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