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

Classes

class  BlockingPolicyTest
 
class  CapabilityAgentTest
 
class  DialogUXAggregatorTest
 Test fixture for testing DialogUXStateAggregator. More...
 
class  ExceptionEncounteredEvent
 
class  ExceptionEncounteredSenderTest
 Test harness for ExceptionEncounteredSender class. More...
 
class  MIMEParserTest
 
class  MockCapabilityAgent
 
class  MockResult
 Mock DirectiveHandlerResultInterface implementation. More...
 
class  StateChangeManager
 Manages testing state changes. More...
 
class  TestObserver
 A test observer that mocks out the DialogUXStateObserverInterface#onDialogUXStateChanged() call. More...
 
class  UUIDGenerationTest
 

Functions

 TEST_F (BlockingPolicyTest, test_defaultConstructor)
 
 TEST_F (BlockingPolicyTest, test_isBlocking)
 Test isBlocking. More...
 
 TEST_F (BlockingPolicyTest, test_getMediums)
 Test getMediums. More...
 
static const std::string NAMESPACE_SPEECH_RECOGNIZER ("SpeechRecognizer")
 Namespace for SpeechRecognizer. More...
 
static const std::string NAME_STOP_CAPTURE ("StopCapture")
 Name for directive to SpeechRecognizer. More...
 
static const std::string NAME_RECOGNIZE ("Recognize")
 Name for SpeechRecognizer state. More...
 
static const std::string EVENT ("event")
 Event key. More...
 
static const std::string HEADER ("header")
 Header key. More...
 
static const std::string MESSAGE_ID ("messageId")
 Message Id key. More...
 
static const std::string MESSAGE_ID_TEST ("MessageId_Test")
 Message Id for testing. More...
 
static const std::string DIALOG_REQUEST_ID ("dialogRequestId")
 Dialog request Id Key. More...
 
static const std::string DIALOG_REQUEST_ID_TEST ("DialogRequestId_Test")
 DialogRequestId for testing. More...
 
static const std::string PAYLOAD ("payload")
 Payload key. More...
 
static const std::string PAYLOAD_TEST ("payload_Test")
 A speech recognizer payload for testing. More...
 
static const std::string EXCEPTION_ENCOUNTERED_STRING ("encountered_exception")
 A string to send with the sendExceptionEncounteredAndReportFailed method. More...
 
bool removeMessageId (Document *document, std::string *messageId)
 
 TEST_F (CapabilityAgentTest, test_callToHandleImmediately)
 
 TEST_F (CapabilityAgentTest, test_callToPrehandleDirective)
 
 TEST_F (CapabilityAgentTest, test_callToHandleDirective)
 
 TEST_F (CapabilityAgentTest, test_callToHandleDirectiveWithNoPrehandle)
 
 TEST_F (CapabilityAgentTest, test_callToCancelDirective)
 
 TEST_F (CapabilityAgentTest, test_callToCancelDirectiveWithNoPrehandle)
 
 TEST_F (CapabilityAgentTest, test_withDialogIdAndContext)
 
 TEST_F (CapabilityAgentTest, test_withDialogIdAndNoContext)
 
 TEST_F (CapabilityAgentTest, test_withoutDialogIdOrContext)
 
 TEST_F (CapabilityAgentTest, test_withContextAndNoDialogId)
 
 TEST_F (CapabilityAgentTest, test_sendExceptionEncounteredWithNullInfo)
 
 TEST (ComponentConfigurationTest, test_createComponentConfiguration)
 
 TEST (ComponentConfigurationTest, test_addBadVersion)
 
 TEST (ComponentConfigurationTest, test_addEmptyConfig)
 
 TEST_F (DialogUXAggregatorTest, test_idleAtBeginning)
 Tests that an observer starts off in the IDLE state. More...
 
 TEST_F (DialogUXAggregatorTest, test_invalidAtBeginningForMultipleObservers)
 Tests that a new observer added receives the current state. More...
 
 TEST_F (DialogUXAggregatorTest, test_removeObserver)
 Tests that the removing observer functionality works properly by asserting no state change on a removed observer. More...
 
 TEST_F (DialogUXAggregatorTest, test_aipIdleLeadsToIdleState)
 Tests that multiple callbacks aren't issued if the state shouldn't change. More...
 
 TEST_F (DialogUXAggregatorTest, test_aipRecognizeLeadsToListeningState)
 Tests that the AIP recognizing state leads to the LISTENING state. More...
 
 TEST_F (DialogUXAggregatorTest, test_aipIdleLeadsToIdle)
 Tests that the AIP recognizing state leads to the LISTENING state. More...
 
 TEST_F (DialogUXAggregatorTest, test_aipExpectingSpeechLeadsToListeningState)
 Tests that the AIP expecting speech state leads to the EXPECTING state. More...
 
 TEST_F (DialogUXAggregatorTest, test_requestProcessingStartedLeadsToThinkingState)
 Tests that the RequestProcessingStarted leads to the THINKING state. More...
 
 TEST_F (DialogUXAggregatorTest, test_listeningGoesToIdleAfterTimeout)
 Tests that LISTENING state goes to IDLE after the specified timeout. More...
 
 TEST_F (DialogUXAggregatorTest, test_thinkingGoesToIdleAfterTimeout)
 Tests that THINKING state goes to IDLE after the specified timeout. More...
 
 TEST_F (DialogUXAggregatorTest, test_thinkingThenReceiveGoesToIdleAfterLongTimeout)
 Tests that the THINKING state transitions to IDLE after receiving a message and a long timeout. More...
 
 TEST_F (DialogUXAggregatorTest, test_listeningThenRequestProcessingCompletedThenSpeakGoesToSpeakButNotIdle)
 
 TEST_F (DialogUXAggregatorTest, test_speakingAndRecognizingFinishedGoesToIdle)
 Tests that both SpeechSynthesizer and AudioInputProcessor finished/idle state leads to the IDLE state. More...
 
 TEST_F (DialogUXAggregatorTest, test_nonIdleObservantsPreventsIdle)
 Tests that SpeechSynthesizer or AudioInputProcessor non-idle state prevents the IDLE state. More...
 
 TEST_F (DialogUXAggregatorTest, test_speakingFinishedDoesNotGoesToIdleImmediately)
 Tests that a SpeechSynthesizer finished state does not go to the IDLE state after a very short timeout. More...
 
 TEST_F (DialogUXAggregatorTest, test_simpleReceiveDoesNothing)
 Test that requestProcessingCompleted while SPEAKING does nothing. More...
 
 TEST_F (DialogUXAggregatorTest, test_thinkingThenReceiveRemainsInThinkingIfSpeechSynthesizerReportsGainingFocus)
 
 TEST_F (DialogUXAggregatorTest, test_validStatesForRPSToThinking)
 Tests that only certain states are allowed to transition into THINKING from an RPS. More...
 
 TEST_F (DialogUXAggregatorTest, test_receiveThenRPCTransitionsOutOfThinking)
 Test that if RequestProcessingCompleted directive is handled, we exit THINKING mode. More...
 
 TEST_F (DialogUXAggregatorTest, test_receiveAIPBusyAfterRPS)
 
 TEST_F (DialogUXAggregatorTest, test_receiveRPCwithoutRPS)
 
 TEST_F (DialogUXAggregatorTest, test_setToIdleIfNoConnectionAvailable)
 Test that the state is set to idle when there is NOT an active connection. More...
 
 TEST_F (DialogUXAggregatorTest, test_doNotSetToIdleIfConnectionIsAvailable)
 Test that don't change the state is if THERE IS an active connection. More...
 
 TEST_F (DialogUXAggregatorTest, test_doNotSetToIdleIfConnectionIsAvailableForDifferentEngine)
 Test that don't change the state is if THERE IS an active connection for a different engine typ. More...
 
 TEST_F (ExceptionEncounteredSenderTest, test_errorTypeUnexpectedInformationReceived)
 
 TEST_F (ExceptionEncounteredSenderTest, test_errorTypeUnexpectedOperation)
 
 TEST_F (ExceptionEncounteredSenderTest, test_errorTypeInternalError)
 
 TEST_F (MIMEParserTest, test_encodingSanity)
 
void runDecodingBoundariesTest (const std::vector< std::pair< std::string, size_t >> &partsToIndex, const std::vector< std::multimap< std::string, std::string >> &testCaseExpectedHeaders, const std::vector< std::string > &testCaseExpectedData, const std::vector< std::string > &headers, HTTP2ReceiveDataStatus expectedStatus=HTTP2ReceiveDataStatus::SUCCESS)
 
void generatePayloadAndTest (const std::vector< std::string > &headers, const std::string &payloadBoundary)
 
void generatePayloadAndTest (const std::string &headerBoundary, const std::string &payloadBoundary)
 
void runTestForCombination (std::vector< int > &partition, const std::string &payload, const std::string &boundary)
 
void generateCombinationsAndRunTest (std::vector< int > &partitions, size_t pos, int remaining, const std::string &words, const std::string &boundary)
 
 TEST_F (MIMEParserTest, test_multipleCombinations)
 
 TEST_F (MIMEParserTest, test_fixedSizeGroups)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendBoundaryWithoutCRLF)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendBoundaryWithTerminatorShouldIgnoreEpilogue)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendDuplicatedBoundaryAsHeader)
 
 TEST_F (MIMEParserTest, test_decodingRandomBoundaries)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesWithQuotesAndMoreHeaders)
 
 TEST_F (MIMEParserTest, test_decodingInvalidBoundaries)
 
 TEST_F (MIMEParserTest, test_decodingBoundaryAfteraNonBoundaryHeader)
 
 TEST_F (MIMEParserTest, test_decodingValidBoundariesWithMoreHeaders)
 
 TEST_F (MIMEParserTest, test_decodingBoundaryTerminatedWithCRLF)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesAvs)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendFakeBoundaryAsData)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendFakeBoundaryAsOnlyData)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendBoundaryWithCRLF)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendEndBoundaryWithoutCRLF)
 
 TEST_F (MIMEParserTest, test_decodingBoundariesSendBoundaryWithData)
 
 TEST_F (MIMEParserTest, test_decodingSanity)
 
void runCodecTest (std::shared_ptr< MockHTTP2MimeRequestEncodeSource > source, std::shared_ptr< MockHTTP2MimeResponseDecodeSink > sink, const int bufferSize)
 
 TEST_F (MIMEParserTest, test_singlePayloadSinglePass)
 
 TEST_F (MIMEParserTest, test_singlePayloadMultiplePasses)
 
 TEST_F (MIMEParserTest, test_multiplePayloadsSinglePass)
 
 TEST_F (MIMEParserTest, test_multiplePayloadsMultiplePasses)
 
 TEST_F (MIMEParserTest, test_duplicateBoundaries)
 
 TEST_F (MIMEParserTest, test_aBORT)
 
 TEST_F (MIMEParserTest, test_pAUSE)
 
 TEST_F (MIMEParserTest, test_variableChunkSizes)
 
static void testPrefixCase (const std::string &readablePrefix, const std::string &prefix, size_t firstChunkSize, int numberChunks, bool expectSuccess)
 
 TEST_F (MIMEParserTest, test_prefixCases)
 
static const std::string UUID_VERSION ("4")
 The version of the UUID generated. More...
 
static const unsigned int UUID_VARIANT (8)
 The variant of the UUID generated. More...
 
static const unsigned int UUID_VERSION_OFFSET (14)
 The offset of the UUID version in the string. More...
 
static const unsigned int UUID_VARIANT_OFFSET (19)
 The offset of the UUID variant in the string. More...
 
static const std::string HYPHEN ("-")
 Hyphen. More...
 
static const unsigned int HYPHEN1_POSITION (8)
 Position of first hyphen. More...
 
static const unsigned int HYPHEN2_POSITION (13)
 Position of second hyphen. More...
 
static const unsigned int HYPHEN3_POSITION (18)
 Position of third hyphen. More...
 
static const unsigned int HYPHEN4_POSITION (23)
 Position of fourth hyphen. More...
 
static const unsigned int UUID_LENGTH (36)
 The length of the UUID string - 32 hexadecimal digits and 4 hyphens. More...
 
static const unsigned int MAX_UUIDS_TO_GENERATE (100)
 The maximum UUIDs to generate to test for uniqueness. More...
 
static const unsigned int MAX_TEST_THREADS (10)
 The maximum threads to test with. More...
 
static const unsigned int MAX_RETRIES (20)
 The maximum number of retries. More...
 
 TEST_F (UUIDGenerationTest, test_uUIDStringLength)
 
 TEST_F (UUIDGenerationTest, test_uUIDContainsOnlyHexCharacters)
 
 TEST_F (UUIDGenerationTest, test_uUIDVersion)
 
 TEST_F (UUIDGenerationTest, test_uUIDVariant)
 
 TEST_F (UUIDGenerationTest, addSeedTest)
 
 TEST_F (UUIDGenerationTest, test_multipleConcurrentSaltSettings)
 
 TEST_F (UUIDGenerationTest, test_uUIDHyphens)
 
 TEST_F (UUIDGenerationTest, test_multipleRequests)
 
 TEST_F (UUIDGenerationTest, test_multipleConcurrentRequests)
 
 TEST_F (UUIDGenerationTest, test_allHexValuesGenerated)
 

Variables

static const std::string PAYLOAD_SPEECH_RECOGNIZER
 A payload for testing. More...
 
static const std::string CONTEXT_TEST
 A context for testing. More...
 
static const std::tuple< std::string, std::string, std::string > testEventWithDialogReqIdAndContext
 
static const std::tuple< std::string, std::string, std::string > testEventWithDialogReqIdNoContext
 
static const std::tuple< std::string, std::string, std::string > testEventWithoutDialogReqIdOrContext
 
static const std::tuple< std::string, std::string, std::string > testEventWithContextAndNoDialogReqId
 
static const auto DEFAULT_TIMEOUT = std::chrono::seconds(5)
 Long time out for observers to wait for the state change callback (we should not reach this). More...
 
static const auto OTHER_ENGINE_TYPE = 2
 
static const auto SHORT_TIMEOUT = std::chrono::milliseconds(50)
 Short time out for when callbacks are expected not to occur. More...
 
static const auto TRANSITION_TIMEOUT = std::chrono::milliseconds(300)
 Time out for testing if transitionFromThinking or transitionFromListneing timeouts have occurred. More...
 
static const MediaPlayerInterface::SourceId TEST_SOURCE_ID = static_cast<MediaPlayerInterface::SourceId>(-1)
 Dummy value for a media player source id. More...
 
static const std::string NAMESPACE = "System"
 The namespace for this event. More...
 
static const std::string MESSAGE_CONTEXT_KEY = "context"
 JSON key for the context section of a message. More...
 
static const std::string MESSAGE_EVENT_KEY = "event"
 JSON key for the event section of a message. More...
 
static const std::string MESSAGE_HEADER_KEY = "header"
 JSON key for the header section of a message. More...
 
static const std::string MESSAGE_NAMESPACE_KEY = "namespace"
 JSON key for the namespace field of a message header. More...
 
static const std::string MESSAGE_NAME_KEY = "name"
 JSON key for the name field of a message header. More...
 
static const std::string MESSAGE_MESSAGE_ID_KEY = "messageId"
 JSON key for the message ID field of a message header. More...
 
static const std::string MESSAGE_PAYLOAD_KEY = "payload"
 JSON key for the payload section of an message. More...
 
static const std::string EXCEPTION_ENCOUNTERED_EVENT_NAME = "ExceptionEncountered"
 JSON value for a ExceptionEncountered event's name. More...
 
static const std::string UNPARSED_DIRECTIVE_KEY = "unparsedDirective"
 JSON key for the Unparsed Directive field of an ExceptionEncountered event. More...
 
static const std::string EXCEPTION_ENCOUNTERED_ERROR_KEY = "error"
 JSON key for the error field of an ExceptionEncountered event. More...
 
static const std::string ERROR_TYPE_KEY = "type"
 JSON key for the type field of a ExceptionEncountered event's error. More...
 
static const std::string ERROR_MESSAGE_KEY = "message"
 JSON key for the message field of a ExceptionEncountered event's error description. More...
 
static const std::string UNPARSED_DIRECTIVE_JSON_STRING = "unparsedDirective Json String"
 String to send unparsed Directive in testExceptionEncounteredSucceeds. More...
 
static const std::string SEPARATOR = ": "
 Separator for keys and values in mime part headers. More...
 
static const int SMALL {100}
 Guideline sizes for test payloads and headers. More...
 
static const int MEDIUM {200}
 
static const int LARGE {500}
 
static const int XLARGE {5000}
 
static const int HEADER_PART_SIZE {10}
 
static const std::string BOUNDARY_HEADER_PREFIX = "content-type:mixed/multipart;boundary="
 
static const std::string MIME_TEST_BOUNDARY_STRING = "84109348-943b-4446-85e6-e73eda9fac43"
 A test boundary string, copied from a real interaction with AVS. More...
 
static const std::string MIME_NEWLINE = "\r\n"
 The newline characters that MIME parsers expect. More...
 
static const std::string MIME_BOUNDARY_DASHES = "--"
 The double dashes which may occur before and after a boundary string. More...
 
static const std::string BOUNDARY = MIME_BOUNDARY_DASHES + MIME_TEST_BOUNDARY_STRING
 The test boundary string with the preceding dashes. More...
 
static const std::string BOUNDARY_LINE = MIME_NEWLINE + BOUNDARY
 A complete boundary, including the CRLF prefix. More...
 
static const std::string HEADER_LINE = "Content-Type: application/json"
 Header line without prefix or suffix CRLF. More...
 
static const std::string TEST_MESSAGE
 JSON payload. More...
 
static const std::string QUOTE_CHAR = "\""
 The " char. More...
 
static const std::string NORMAL_LINES = HEADER_LINE + MIME_NEWLINE + MIME_NEWLINE + TEST_MESSAGE + BOUNDARY_LINE
 
static const std::string DUPLICATE_BOUNDARY_LINES = BOUNDARY + MIME_NEWLINE + NORMAL_LINES
 
static const std::string CRLF_DUPLICATE_BOUNDARY_LINES = BOUNDARY_LINE + MIME_NEWLINE + NORMAL_LINES
 
static const std::string TRIPLICATE_BOUNDARY_LINES = BOUNDARY + MIME_NEWLINE + BOUNDARY + MIME_NEWLINE + NORMAL_LINES
 
static const std::string CRLF_TRIPLICATE_BOUNDARY_LINES
 

Function Documentation

◆ DIALOG_REQUEST_ID()

static const std::string alexaClientSDK::avsCommon::test::DIALOG_REQUEST_ID ( "dialogRequestId"  )
static

Dialog request Id Key.

◆ DIALOG_REQUEST_ID_TEST()

static const std::string alexaClientSDK::avsCommon::test::DIALOG_REQUEST_ID_TEST ( "DialogRequestId_Test"  )
static

DialogRequestId for testing.

◆ EVENT()

static const std::string alexaClientSDK::avsCommon::test::EVENT ( "event"  )
static

Event key.

◆ EXCEPTION_ENCOUNTERED_STRING()

static const std::string alexaClientSDK::avsCommon::test::EXCEPTION_ENCOUNTERED_STRING ( "encountered_exception"  )
static

A string to send with the sendExceptionEncounteredAndReportFailed method.

◆ generateCombinationsAndRunTest()

void alexaClientSDK::avsCommon::test::generateCombinationsAndRunTest ( std::vector< int > &  partitions,
size_t  pos,
int  remaining,
const std::string &  words,
const std::string &  boundary 
)

◆ generatePayloadAndTest() [1/2]

void alexaClientSDK::avsCommon::test::generatePayloadAndTest ( const std::vector< std::string > &  headers,
const std::string &  payloadBoundary 
)

◆ generatePayloadAndTest() [2/2]

void alexaClientSDK::avsCommon::test::generatePayloadAndTest ( const std::string &  headerBoundary,
const std::string &  payloadBoundary 
)

◆ HEADER()

static const std::string alexaClientSDK::avsCommon::test::HEADER ( "header"  )
static

Header key.

◆ HYPHEN()

static const std::string alexaClientSDK::avsCommon::test::HYPHEN ( "-"  )
static

Hyphen.

◆ HYPHEN1_POSITION()

static const unsigned int alexaClientSDK::avsCommon::test::HYPHEN1_POSITION ( )
static

Position of first hyphen.

◆ HYPHEN2_POSITION()

static const unsigned int alexaClientSDK::avsCommon::test::HYPHEN2_POSITION ( 13  )
static

Position of second hyphen.

◆ HYPHEN3_POSITION()

static const unsigned int alexaClientSDK::avsCommon::test::HYPHEN3_POSITION ( 18  )
static

Position of third hyphen.

◆ HYPHEN4_POSITION()

static const unsigned int alexaClientSDK::avsCommon::test::HYPHEN4_POSITION ( 23  )
static

Position of fourth hyphen.

◆ MAX_RETRIES()

static const unsigned int alexaClientSDK::avsCommon::test::MAX_RETRIES ( 20  )
static

The maximum number of retries.

◆ MAX_TEST_THREADS()

static const unsigned int alexaClientSDK::avsCommon::test::MAX_TEST_THREADS ( 10  )
static

The maximum threads to test with.

◆ MAX_UUIDS_TO_GENERATE()

static const unsigned int alexaClientSDK::avsCommon::test::MAX_UUIDS_TO_GENERATE ( 100  )
static

The maximum UUIDs to generate to test for uniqueness.

◆ MESSAGE_ID()

static const std::string alexaClientSDK::avsCommon::test::MESSAGE_ID ( "messageId"  )
static

Message Id key.

◆ MESSAGE_ID_TEST()

static const std::string alexaClientSDK::avsCommon::test::MESSAGE_ID_TEST ( "MessageId_Test"  )
static

Message Id for testing.

◆ NAME_RECOGNIZE()

static const std::string alexaClientSDK::avsCommon::test::NAME_RECOGNIZE ( "Recognize"  )
static

Name for SpeechRecognizer state.

◆ NAME_STOP_CAPTURE()

static const std::string alexaClientSDK::avsCommon::test::NAME_STOP_CAPTURE ( "StopCapture"  )
static

Name for directive to SpeechRecognizer.

◆ NAMESPACE_SPEECH_RECOGNIZER()

static const std::string alexaClientSDK::avsCommon::test::NAMESPACE_SPEECH_RECOGNIZER ( "SpeechRecognizer"  )
static

Namespace for SpeechRecognizer.

◆ PAYLOAD()

static const std::string alexaClientSDK::avsCommon::test::PAYLOAD ( "payload"  )
static

Payload key.

◆ PAYLOAD_TEST()

static const std::string alexaClientSDK::avsCommon::test::PAYLOAD_TEST ( "payload_Test"  )
static

A speech recognizer payload for testing.

◆ removeMessageId()

bool alexaClientSDK::avsCommon::test::removeMessageId ( Document *  document,
std::string *  messageId 
)

Helper function to remove the messageId.

Parameters
documentThe document from which to remove the messageId.
messageIdThe messageId that was removed (if successful).
Returns
bool Indicates whether removing the messageId was successful.

◆ runCodecTest()

void alexaClientSDK::avsCommon::test::runCodecTest ( std::shared_ptr< MockHTTP2MimeRequestEncodeSource source,
std::shared_ptr< MockHTTP2MimeResponseDecodeSink sink,
const int  bufferSize 
)

Since encoding output gives partial chunks in case of PAUSE if some bytes have already been encoded, the PAUSE count encountered may not match. However, since we add a PAUSE in the very beginning, that one is guaranteed to be received

◆ runDecodingBoundariesTest()

void alexaClientSDK::avsCommon::test::runDecodingBoundariesTest ( const std::vector< std::pair< std::string, size_t >> &  partsToIndex,
const std::vector< std::multimap< std::string, std::string >> &  testCaseExpectedHeaders,
const std::vector< std::string > &  testCaseExpectedData,
const std::vector< std::string > &  headers,
HTTP2ReceiveDataStatus  expectedStatus = HTTP2ReceiveDataStatus::SUCCESS 
)

◆ runTestForCombination()

void alexaClientSDK::avsCommon::test::runTestForCombination ( std::vector< int > &  partition,
const std::string &  payload,
const std::string &  boundary 
)

◆ TEST() [1/3]

alexaClientSDK::avsCommon::test::TEST ( ComponentConfigurationTest  ,
test_createComponentConfiguration   
)

Test creating a ComponentConfiguration

◆ TEST() [2/3]

alexaClientSDK::avsCommon::test::TEST ( ComponentConfigurationTest  ,
test_addBadVersion   
)

Test creating a configuration with invalid version is not created.

◆ TEST() [3/3]

alexaClientSDK::avsCommon::test::TEST ( ComponentConfigurationTest  ,
test_addEmptyConfig   
)

Test creating an empty configuration is not created.

◆ TEST_F() [1/79]

alexaClientSDK::avsCommon::test::TEST_F ( BlockingPolicyTest  ,
test_defaultConstructor   
)

◆ TEST_F() [2/79]

alexaClientSDK::avsCommon::test::TEST_F ( BlockingPolicyTest  ,
test_isBlocking   
)

Test isBlocking.

◆ TEST_F() [3/79]

alexaClientSDK::avsCommon::test::TEST_F ( BlockingPolicyTest  ,
test_getMediums   
)

Test getMediums.

◆ TEST_F() [4/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_uUIDStringLength   
)

Call generateUUID and expect a string of length UUID_LENGTH.

◆ TEST_F() [5/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_uUIDContainsOnlyHexCharacters   
)

Call generateUUID and expect a string of length UUID_LENGTH. Check that each character in the string is a hexedecimal number except for the hyphens.

◆ TEST_F() [6/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_uUIDVersion   
)

Call generateUUID and check that the version is set correctly.

◆ TEST_F() [7/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_uUIDVariant   
)

Call generateUUID and check the variant is set correctly.

◆ TEST_F() [8/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
addSeedTest   
)

Call addSeed without error, with various inputs

◆ TEST_F() [9/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_multipleConcurrentSaltSettings   
)

Call generateUUID and addSeed from multiple threads and check that all are able to complete successfully Check for uniqueness of the UUIDs generated.

◆ TEST_F() [10/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_uUIDHyphens   
)

Call generateUUID and check that the hyphens are in the right positions.

◆ TEST_F() [11/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_idleAtBeginning   
)

Tests that an observer starts off in the IDLE state.

◆ TEST_F() [12/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_invalidAtBeginningForMultipleObservers   
)

Tests that a new observer added receives the current state.

◆ TEST_F() [13/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_multipleRequests   
)

Call generateUUID multiple times and check the version and variant are set correctly. Check for uniqueness of the UUIDs generated.

◆ TEST_F() [14/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_removeObserver   
)

Tests that the removing observer functionality works properly by asserting no state change on a removed observer.

◆ TEST_F() [15/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_encodingSanity   
)

Test the basic encoding use case with a 3 part MIME request Test for correct encoded size, header presence and validity of Return status for every call as well as bytes written.

We choose an arbitrary buffer size

characters array to store the output, size chosen to be more than the size calculated above

◆ TEST_F() [16/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_aipIdleLeadsToIdleState   
)

Tests that multiple callbacks aren't issued if the state shouldn't change.

◆ TEST_F() [17/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_multipleConcurrentRequests   
)

Call generateUUID from multiple threads and check the version and variant are set correctly. Check for uniqueness of the UUIDs generated.

◆ TEST_F() [18/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_aipRecognizeLeadsToListeningState   
)

Tests that the AIP recognizing state leads to the LISTENING state.

◆ TEST_F() [19/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_aipIdleLeadsToIdle   
)

Tests that the AIP recognizing state leads to the LISTENING state.

◆ TEST_F() [20/79]

alexaClientSDK::avsCommon::test::TEST_F ( ExceptionEncounteredSenderTest  ,
test_errorTypeUnexpectedInformationReceived   
)

◆ TEST_F() [21/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_aipExpectingSpeechLeadsToListeningState   
)

Tests that the AIP expecting speech state leads to the EXPECTING state.

◆ TEST_F() [22/79]

alexaClientSDK::avsCommon::test::TEST_F ( UUIDGenerationTest  ,
test_allHexValuesGenerated   
)

Call generateUUID and ensure all hex values are generated. Will retry MAX_RETRIES times.

◆ TEST_F() [23/79]

alexaClientSDK::avsCommon::test::TEST_F ( ExceptionEncounteredSenderTest  ,
test_errorTypeUnexpectedOperation   
)

◆ TEST_F() [24/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_requestProcessingStartedLeadsToThinkingState   
)

Tests that the RequestProcessingStarted leads to the THINKING state.

◆ TEST_F() [25/79]

alexaClientSDK::avsCommon::test::TEST_F ( ExceptionEncounteredSenderTest  ,
test_errorTypeInternalError   
)

◆ TEST_F() [26/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_listeningGoesToIdleAfterTimeout   
)

Tests that LISTENING state goes to IDLE after the specified timeout.

◆ TEST_F() [27/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_thinkingGoesToIdleAfterTimeout   
)

Tests that THINKING state goes to IDLE after the specified timeout.

◆ TEST_F() [28/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_thinkingThenReceiveGoesToIdleAfterLongTimeout   
)

Tests that the THINKING state transitions to IDLE after receiving a message and a long timeout.

◆ TEST_F() [29/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_listeningThenRequestProcessingCompletedThenSpeakGoesToSpeakButNotIdle   
)

Tests that the LISTENING state goes to SPEAKING but not IDLE after both RequestProcessingStarted and RequestProcessingCompleted are received followed by SpeechSynthesizer PLAYING.

◆ TEST_F() [30/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_speakingAndRecognizingFinishedGoesToIdle   
)

Tests that both SpeechSynthesizer and AudioInputProcessor finished/idle state leads to the IDLE state.

◆ TEST_F() [31/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_multipleCombinations   
)

◆ TEST_F() [32/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_nonIdleObservantsPreventsIdle   
)

Tests that SpeechSynthesizer or AudioInputProcessor non-idle state prevents the IDLE state.

◆ TEST_F() [33/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_fixedSizeGroups   
)

◆ TEST_F() [34/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_speakingFinishedDoesNotGoesToIdleImmediately   
)

Tests that a SpeechSynthesizer finished state does not go to the IDLE state after a very short timeout.

◆ TEST_F() [35/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendBoundaryWithoutCRLF   
)

◆ TEST_F() [36/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_simpleReceiveDoesNothing   
)

Test that requestProcessingCompleted while SPEAKING does nothing.

◆ TEST_F() [37/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendBoundaryWithTerminatorShouldIgnoreEpilogue   
)

◆ TEST_F() [38/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_thinkingThenReceiveRemainsInThinkingIfSpeechSynthesizerReportsGainingFocus   
)

Tests that the THINKING state remains in THINKING if SpeechSynthesizer reports GAINING_FOCUS and a new message is received.

◆ TEST_F() [39/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_validStatesForRPSToThinking   
)

Tests that only certain states are allowed to transition into THINKING from an RPS.

◆ TEST_F() [40/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendDuplicatedBoundaryAsHeader   
)

◆ TEST_F() [41/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_callToHandleImmediately   
)

Call the handleDirectiveImmediately from the CapabilityAgent base class with a directive as the argument. Expect the handleDirectiveImmediately with the argument of DirectiveAndResultInterface will be called.

◆ TEST_F() [42/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingRandomBoundaries   
)

◆ TEST_F() [43/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_callToPrehandleDirective   
)

Call the preHandleDirective from the CapabilityAgent base class with a directive as the argument. Expect the preHandleDirective with the argument of DirectiveAndResultInterface will be called.

◆ TEST_F() [44/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_receiveThenRPCTransitionsOutOfThinking   
)

Test that if RequestProcessingCompleted directive is handled, we exit THINKING mode.

◆ TEST_F() [45/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_callToHandleDirective   
)

Call the preHandleDirective from the CapabilityAgent base class with a directive. * Call the handleDirective from the CapabilityAgent base class with a directive as the argument. Expect the handleDirective with the argument of DirectiveAndResultInterface will be called.

◆ TEST_F() [46/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesWithQuotesAndMoreHeaders   
)

◆ TEST_F() [47/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_receiveAIPBusyAfterRPS   
)

Test that if AIP experiences latency and sends a callback after RPS, we don't transition LISTENING->THINKING->LISTENING.

◆ TEST_F() [48/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_callToHandleDirectiveWithNoPrehandle   
)

Call the handleDirective from the CapabilityAgent base class with a directive as the argument. No preHandleDirective is called before handleDirective. Expect handleDirective to return false.

◆ TEST_F() [49/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingInvalidBoundaries   
)

◆ TEST_F() [50/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_receiveRPCwithoutRPS   
)

Test that we transition from LISTENING to IDLE when RequestProcessingCompleted is received without RequestProcessingStarted.

◆ TEST_F() [51/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_callToCancelDirective   
)

Call the cancelDirective from the CapabilityAgent base class with a directive as the argument. Expect the cancelDirective with the argument of DirectiveAndResultInterface will be called.

◆ TEST_F() [52/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_setToIdleIfNoConnectionAvailable   
)

Test that the state is set to idle when there is NOT an active connection.

◆ TEST_F() [53/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundaryAfteraNonBoundaryHeader   
)

◆ TEST_F() [54/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_callToCancelDirectiveWithNoPrehandle   
)

Call the cancelDirective from the CapabilityAgent base class with a directive as the argument. No preHandleDirective is called before handleDirective. Expect the cancelDirective with the argument of DirectiveAndResultInterface will not be called.

◆ TEST_F() [55/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingValidBoundariesWithMoreHeaders   
)

◆ TEST_F() [56/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_doNotSetToIdleIfConnectionIsAvailable   
)

Test that don't change the state is if THERE IS an active connection.

◆ TEST_F() [57/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_withDialogIdAndContext   
)

Call the callBuildJsonEventString with dialogRequestID and context. Expect a json event string that matches the corresponding testEvent. The messageId will not match since it is a random number. Verify the string before and after the messageId.

◆ TEST_F() [58/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundaryTerminatedWithCRLF   
)

◆ TEST_F() [59/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_withDialogIdAndNoContext   
)

Call the callBuildJsonEventString with dialogRequestId and without context. Expect a json event string that matches the corresponding testEvent. The messageId will not match since it is a random number. Verify the string before and after the messageId.

◆ TEST_F() [60/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_withoutDialogIdOrContext   
)

Call the callBuildJsonEventString without context and without dialogRequestId. Expect a json event string that matches the corresponding testEvent. The messageId will not match since it is a random number. Verify the string before and after the messageId.

◆ TEST_F() [61/79]

alexaClientSDK::avsCommon::test::TEST_F ( DialogUXAggregatorTest  ,
test_doNotSetToIdleIfConnectionIsAvailableForDifferentEngine   
)

Test that don't change the state is if THERE IS an active connection for a different engine typ.

◆ TEST_F() [62/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesAvs   
)

◆ TEST_F() [63/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_withContextAndNoDialogId   
)

Call the callBuildJsonEventString multiple times with context and without dialogRequestId. Expect a json event string that matches the corresponding testEvent. The messageId will not match since it is a random number. Verify the string before and after the messageId.

◆ TEST_F() [64/79]

alexaClientSDK::avsCommon::test::TEST_F ( CapabilityAgentTest  ,
test_sendExceptionEncounteredWithNullInfo   
)

Call sendExceptionEncounteredAndReportFailed with info pointing to null directive. Expect sendExceptionEncountered to not be called. Send again with info pointing to a valid directive. Expect sendExceptionEncountered to be called

◆ TEST_F() [65/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendFakeBoundaryAsData   
)

◆ TEST_F() [66/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendFakeBoundaryAsOnlyData   
)

◆ TEST_F() [67/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendBoundaryWithCRLF   
)

◆ TEST_F() [68/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendEndBoundaryWithoutCRLF   
)

◆ TEST_F() [69/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingBoundariesSendBoundaryWithData   
)

◆ TEST_F() [70/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_decodingSanity   
)

We choose an arbitrary buffer size

We need to pass a header with boundary info

Test individual MIME parts and headers note: header order may have changed

◆ TEST_F() [71/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_singlePayloadSinglePass   
)

◆ TEST_F() [72/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_singlePayloadMultiplePasses   
)

◆ TEST_F() [73/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_multiplePayloadsSinglePass   
)

◆ TEST_F() [74/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_multiplePayloadsMultiplePasses   
)

◆ TEST_F() [75/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_duplicateBoundaries   
)

Test feeding mime text including duplicate boundaries that we want to just skip over.

We choose an arbitrary buffer size

We need to pass a header with boundary info

verify only the 12 messages added above are written to sink(no empty payloads from newlines)

◆ TEST_F() [76/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_aBORT   
)

◆ TEST_F() [77/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_pAUSE   
)

◆ TEST_F() [78/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_variableChunkSizes   
)

We test for cases when the amount of data to be encoded/decoded from chunk varies a lot between calls

Since encoding output gives partial chunks in case of PAUSE if some bytes have already been encoded, the PAUSE count encountered may not match. However, since we add a PAUSE in the very beginning, that one is guaranteed to be received

◆ TEST_F() [79/79]

alexaClientSDK::avsCommon::test::TEST_F ( MIMEParserTest  ,
test_prefixCases   
)

◆ testPrefixCase()

static void alexaClientSDK::avsCommon::test::testPrefixCase ( const std::string &  readablePrefix,
const std::string &  prefix,
size_t  firstChunkSize,
int  numberChunks,
bool  expectSuccess 
)
static

Test one of many prefix use cases.

Parameters
readablePrefixThe prefix string to log if there is a failure (some prefixes are unreadable).
prefixThe prefix to add to the body to decode.
firstChunkSizeThe size of the first chunk to pass to the decoder.
numberChunksThe number of chunks in which to send the body.
expectSuccessWhether or not to expect the parse to succeed.

◆ UUID_LENGTH()

static const unsigned int alexaClientSDK::avsCommon::test::UUID_LENGTH ( 36  )
static

The length of the UUID string - 32 hexadecimal digits and 4 hyphens.

◆ UUID_VARIANT()

static const unsigned int alexaClientSDK::avsCommon::test::UUID_VARIANT ( )
static

The variant of the UUID generated.

◆ UUID_VARIANT_OFFSET()

static const unsigned int alexaClientSDK::avsCommon::test::UUID_VARIANT_OFFSET ( 19  )
static

The offset of the UUID variant in the string.

◆ UUID_VERSION()

static const std::string alexaClientSDK::avsCommon::test::UUID_VERSION ( "4"  )
static

The version of the UUID generated.

◆ UUID_VERSION_OFFSET()

static const unsigned int alexaClientSDK::avsCommon::test::UUID_VERSION_OFFSET ( 14  )
static

The offset of the UUID version in the string.

Variable Documentation

◆ BOUNDARY

const std::string alexaClientSDK::avsCommon::test::BOUNDARY = MIME_BOUNDARY_DASHES + MIME_TEST_BOUNDARY_STRING
static

The test boundary string with the preceding dashes.

◆ BOUNDARY_HEADER_PREFIX

const std::string alexaClientSDK::avsCommon::test::BOUNDARY_HEADER_PREFIX = "content-type:mixed/multipart;boundary="
static

Boundary test constants Response header prefix used to set boundary for decoder

◆ BOUNDARY_LINE

const std::string alexaClientSDK::avsCommon::test::BOUNDARY_LINE = MIME_NEWLINE + BOUNDARY
static

A complete boundary, including the CRLF prefix.

◆ CONTEXT_TEST

const std::string alexaClientSDK::avsCommon::test::CONTEXT_TEST
static
Initial value:
=
"{"
"\"properties\":["
"{"
"\"header\":{"
"\"namespace\":\"SpeechSynthesizer\","
"\"name\":\"SpeechState\""
"},"
"\"payload\":{"
"\"playerActivity\":\"FINISHED\","
"\"offsetInMilliseconds\":0,"
"\"token\":\"\""
"}"
"}"
"]"
"}"

A context for testing.

◆ CRLF_DUPLICATE_BOUNDARY_LINES

const std::string alexaClientSDK::avsCommon::test::CRLF_DUPLICATE_BOUNDARY_LINES = BOUNDARY_LINE + MIME_NEWLINE + NORMAL_LINES
static

Normal section preceded by a duplicate boundary and CRLF (two CRLFs between boundaries)

Note
assumes previous terminating boundary and CRLF in the mime stream that this is appended to.

◆ CRLF_TRIPLICATE_BOUNDARY_LINES

const std::string alexaClientSDK::avsCommon::test::CRLF_TRIPLICATE_BOUNDARY_LINES
static
Initial value:
=
static const std::string MIME_NEWLINE
The newline characters that MIME parsers expect.
Definition: MIMEParserTest.cpp:60
static const std::string NORMAL_LINES
Definition: MIMEParserTest.cpp:86
static const std::string BOUNDARY_LINE
A complete boundary, including the CRLF prefix.
Definition: MIMEParserTest.cpp:66

Normal section preceded by triplicate boundaries with trailing CRLF (two CRLFs between boundaries)

Note
assumes previous terminating boundary and CRLF in the mime stream that this is appended to.

◆ DEFAULT_TIMEOUT

const auto alexaClientSDK::avsCommon::test::DEFAULT_TIMEOUT = std::chrono::seconds(5)
static

Long time out for observers to wait for the state change callback (we should not reach this).

◆ DUPLICATE_BOUNDARY_LINES

const std::string alexaClientSDK::avsCommon::test::DUPLICATE_BOUNDARY_LINES = BOUNDARY + MIME_NEWLINE + NORMAL_LINES
static

Normal section preceded by a duplicate boundary (one CRLF between boundaries)

Note
assumes previous terminating boundary and CRLF in the mime stream that this is appended to.

◆ ERROR_MESSAGE_KEY

const std::string alexaClientSDK::avsCommon::test::ERROR_MESSAGE_KEY = "message"
static

JSON key for the message field of a ExceptionEncountered event's error description.

◆ ERROR_TYPE_KEY

const std::string alexaClientSDK::avsCommon::test::ERROR_TYPE_KEY = "type"
static

JSON key for the type field of a ExceptionEncountered event's error.

◆ EXCEPTION_ENCOUNTERED_ERROR_KEY

const std::string alexaClientSDK::avsCommon::test::EXCEPTION_ENCOUNTERED_ERROR_KEY = "error"
static

JSON key for the error field of an ExceptionEncountered event.

◆ EXCEPTION_ENCOUNTERED_EVENT_NAME

const std::string alexaClientSDK::avsCommon::test::EXCEPTION_ENCOUNTERED_EVENT_NAME = "ExceptionEncountered"
static

JSON value for a ExceptionEncountered event's name.

◆ HEADER_LINE

const std::string alexaClientSDK::avsCommon::test::HEADER_LINE = "Content-Type: application/json"
static

Header line without prefix or suffix CRLF.

◆ HEADER_PART_SIZE

const int alexaClientSDK::avsCommon::test::HEADER_PART_SIZE {10}
static

◆ LARGE

const int alexaClientSDK::avsCommon::test::LARGE {500}
static

◆ MEDIUM

const int alexaClientSDK::avsCommon::test::MEDIUM {200}
static

◆ MESSAGE_CONTEXT_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_CONTEXT_KEY = "context"
static

JSON key for the context section of a message.

◆ MESSAGE_EVENT_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_EVENT_KEY = "event"
static

JSON key for the event section of a message.

◆ MESSAGE_HEADER_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_HEADER_KEY = "header"
static

JSON key for the header section of a message.

◆ MESSAGE_MESSAGE_ID_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_MESSAGE_ID_KEY = "messageId"
static

JSON key for the message ID field of a message header.

◆ MESSAGE_NAME_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_NAME_KEY = "name"
static

JSON key for the name field of a message header.

◆ MESSAGE_NAMESPACE_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_NAMESPACE_KEY = "namespace"
static

JSON key for the namespace field of a message header.

◆ MESSAGE_PAYLOAD_KEY

const std::string alexaClientSDK::avsCommon::test::MESSAGE_PAYLOAD_KEY = "payload"
static

JSON key for the payload section of an message.

◆ MIME_BOUNDARY_DASHES

const std::string alexaClientSDK::avsCommon::test::MIME_BOUNDARY_DASHES = "--"
static

The double dashes which may occur before and after a boundary string.

◆ MIME_NEWLINE

const std::string alexaClientSDK::avsCommon::test::MIME_NEWLINE = "\r\n"
static

The newline characters that MIME parsers expect.

◆ MIME_TEST_BOUNDARY_STRING

const std::string alexaClientSDK::avsCommon::test::MIME_TEST_BOUNDARY_STRING = "84109348-943b-4446-85e6-e73eda9fac43"
static

A test boundary string, copied from a real interaction with AVS.

◆ NAMESPACE

const std::string alexaClientSDK::avsCommon::test::NAMESPACE = "System"
static

The namespace for this event.

◆ NORMAL_LINES

const std::string alexaClientSDK::avsCommon::test::NORMAL_LINES = HEADER_LINE + MIME_NEWLINE + MIME_NEWLINE + TEST_MESSAGE + BOUNDARY_LINE
static

Normal section with header, test message and terminating boundary

Note
assumes previous terminating boundary and CRLF in the mime stream that this is appended to.

◆ OTHER_ENGINE_TYPE

const auto alexaClientSDK::avsCommon::test::OTHER_ENGINE_TYPE = 2
static

◆ PAYLOAD_SPEECH_RECOGNIZER

const std::string alexaClientSDK::avsCommon::test::PAYLOAD_SPEECH_RECOGNIZER
static
Initial value:
=
"{"
"\"profile\":\"CLOSE_TALK\","
"\"format\":\"AUDIO_L16_RATE_16000_CHANNELS_1\""
"}"

A payload for testing.

◆ QUOTE_CHAR

const std::string alexaClientSDK::avsCommon::test::QUOTE_CHAR = "\""
static

The " char.

◆ SEPARATOR

const std::string alexaClientSDK::avsCommon::test::SEPARATOR = ": "
static

Separator for keys and values in mime part headers.

◆ SHORT_TIMEOUT

const auto alexaClientSDK::avsCommon::test::SHORT_TIMEOUT = std::chrono::milliseconds(50)
static

Short time out for when callbacks are expected not to occur.

◆ SMALL

const int alexaClientSDK::avsCommon::test::SMALL {100}
static

Guideline sizes for test payloads and headers.

◆ TEST_MESSAGE

const std::string alexaClientSDK::avsCommon::test::TEST_MESSAGE
static
Initial value:
=
"{\"directive\":{\"header\":{\"namespace\":\"SpeechRecognizer\",\"name\":"
"\"StopCapture\",\"messageId\":\"4e5612af-e05c-4611-8910-1e23f47ffb41\"},"
"\"payload\":{}}}"

JSON payload.

◆ TEST_SOURCE_ID

const MediaPlayerInterface::SourceId alexaClientSDK::avsCommon::test::TEST_SOURCE_ID = static_cast<MediaPlayerInterface::SourceId>(-1)
static

Dummy value for a media player source id.

◆ testEventWithContextAndNoDialogReqId

const std::tuple<std::string, std::string, std::string> alexaClientSDK::avsCommon::test::testEventWithContextAndNoDialogReqId
static

◆ testEventWithDialogReqIdAndContext

const std::tuple<std::string, std::string, std::string> alexaClientSDK::avsCommon::test::testEventWithDialogReqIdAndContext
static

TestEvents for testing. Tuple contains test event string to compare the result string with, the dialogRequestID and the context to be passed as arguments.

◆ testEventWithDialogReqIdNoContext

const std::tuple<std::string, std::string, std::string> alexaClientSDK::avsCommon::test::testEventWithDialogReqIdNoContext
static
Initial value:
= {
"{"
"\"event\":{"
"\"header\":{"
"\"namespace\":\"SpeechRecognizer\","
"\"name\":\"Recognize\","
"\"messageId\":\""+MESSAGE_ID_TEST+"\","
"\"dialogRequestId\":\""+DIALOG_REQUEST_ID_TEST+"\""
"},"
"\"payload\":{"
"\"profile\":\"CLOSE_TALK\","
"\"format\":\"AUDIO_L16_RATE_16000_CHANNELS_1\""
"}"
"}"
static const std::string DIALOG_REQUEST_ID_TEST("DialogRequestId_Test")
DialogRequestId for testing.
tuple make_tuple()
Definition: gtest-tuple.h:675
static const std::string MESSAGE_ID_TEST("MessageId_Test")
Message Id for testing.

◆ testEventWithoutDialogReqIdOrContext

const std::tuple<std::string, std::string, std::string> alexaClientSDK::avsCommon::test::testEventWithoutDialogReqIdOrContext
static
Initial value:
= {
"{"
"\"event\":{"
"\"header\":{"
"\"namespace\":\"SpeechRecognizer\","
"\"name\":\"Recognize\","
"\"messageId\":\""+MESSAGE_ID_TEST+"\""
"},"
"\"payload\":{"
"\"profile\":\"CLOSE_TALK\","
"\"format\":\"AUDIO_L16_RATE_16000_CHANNELS_1\""
"}"
"}"
"}", "", "")}
tuple make_tuple()
Definition: gtest-tuple.h:675
static const std::string MESSAGE_ID_TEST("MessageId_Test")
Message Id for testing.

◆ TRANSITION_TIMEOUT

const auto alexaClientSDK::avsCommon::test::TRANSITION_TIMEOUT = std::chrono::milliseconds(300)
static

Time out for testing if transitionFromThinking or transitionFromListneing timeouts have occurred.

◆ TRIPLICATE_BOUNDARY_LINES

const std::string alexaClientSDK::avsCommon::test::TRIPLICATE_BOUNDARY_LINES = BOUNDARY + MIME_NEWLINE + BOUNDARY + MIME_NEWLINE + NORMAL_LINES
static

Normal section preceded by triplicate boundaries (one CRLF between boundaries)

Note
assumes previous terminating boundary and CRLF in the mime stream that this is appended to.

◆ UNPARSED_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::avsCommon::test::UNPARSED_DIRECTIVE_JSON_STRING = "unparsedDirective Json String"
static

String to send unparsed Directive in testExceptionEncounteredSucceeds.

◆ UNPARSED_DIRECTIVE_KEY

const std::string alexaClientSDK::avsCommon::test::UNPARSED_DIRECTIVE_KEY = "unparsedDirective"
static

JSON key for the Unparsed Directive field of an ExceptionEncountered event.

◆ XLARGE

const int alexaClientSDK::avsCommon::test::XLARGE {5000}
static

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