AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Classes | |
class | DirectiveHandlerMockAdapter |
class | DirectiveProcessorTest |
class | DirectiveRouterTest |
class | DirectiveSequencerTest |
DirectiveSequencerTest. More... | |
class | MessageIntepreterTest |
class | MockDirectiveHandler |
class | MockDirectiveSequencer |
class | MockExceptionEncounteredSender |
Functions | |
static const std::string | MESSAGE_ID_0_0 ("Message_0_0") |
Generic messageId used for tests. More... | |
static const std::string | MESSAGE_ID_0_1 ("Message_0_1") |
Generic MessageId used for test. More... | |
static const std::string | MESSAGE_ID_0_2 ("Message_0_2") |
Generic MessageId used for test. More... | |
static const std::string | MESSAGE_ID_0_3 ("Message_0_3") |
Generic MessageId used for test. More... | |
static const std::string | MESSAGE_ID_1_0 ("Message_1_0") |
Generic MessageId used for tests. More... | |
static const std::string | DIALOG_REQUEST_ID_0 ("DialogRequestId_0") |
Generic DialogRequestId used for tests. More... | |
static const std::string | DIALOG_REQUEST_ID_1 ("DialogRequestId_1") |
Generic DialogRequestId used for tests. More... | |
static const std::string | UNPARSED_DIRECTIVE ("unparsedDirectiveForTest") |
An unparsed directive for test. More... | |
static const std::string | PAYLOAD_TEST ("payloadForTest") |
A paylaod for test;. More... | |
static const std::string | NAMESPACE_0 ("namespace_0") |
A generic namespace string for tests. More... | |
static const std::string | NAMESPACE_1 ("namespace_1") |
A generic namespace string for tests. More... | |
static const std::string | NAME_0 ("name_0") |
A generic name string for tests. More... | |
static const std::string | NAME_1 ("name_1") |
A generic name string for tests. More... | |
static const std::string | NAME_2 ("name_2") |
A generic name string for tests. More... | |
static const std::string | NAME_3 ("name_3") |
A generic name string for tests. More... | |
static const std::string | TEST_ATTACHMENT_CONTEXT_ID ("TEST_ATTACHMENT_CONTEXT_ID") |
TEST_F (DirectiveProcessorTest, test_nullptrDirective) | |
TEST_F (DirectiveProcessorTest, test_wrongDialogRequestId) | |
TEST_F (DirectiveProcessorTest, test_sendNonBlocking) | |
TEST_F (DirectiveProcessorTest, test_sendBlockingThenNonBlocking) | |
TEST_F (DirectiveProcessorTest, test_onUnregisteredDirective) | |
TEST_F (DirectiveProcessorTest, test_setDialogRequestIdCancelsOutstandingDirectives) | |
TEST_F (DirectiveProcessorTest, test_addDirectiveWhileDisabled) | |
TEST_F (DirectiveProcessorTest, test_addDirectiveAfterReEnabled) | |
TEST_F (DirectiveProcessorTest, test_audioAndVisualIsBlockingAudio) | |
TEST_F (DirectiveProcessorTest, test_differentMediums) | |
TEST_F (DirectiveProcessorTest, test_releaseOneMedium) | |
TEST_F (DirectiveProcessorTest, test_blockingQueuedDirectivIsBlocking) | |
TEST_F (DirectiveProcessorTest, test_nonBlockingQueuedDirectivIsNotBlocking) | |
static const std::string | MESSAGE_ID_0_0 ("Message_0_0") |
Generic messageId used for tests. More... | |
static const std::string | MESSAGE_ID_0_1 ("Message_0_1") |
Generic MessageId used for test. More... | |
static const std::string | MESSAGE_ID_0_2 ("Message_0_2") |
Generic MessageId used for test. More... | |
static const std::string | MESSAGE_ID_1_0 ("Message_1_0") |
Generic MessageId used for tests. More... | |
static const std::string | MESSAGE_ID_2_0 ("Message_2_0") |
Generic MessageId used for test. More... | |
static const std::string | DIALOG_REQUEST_ID_0 ("DialogRequestId_0") |
Generic DialogRequestId used for tests. More... | |
static const std::string | UNPARSED_DIRECTIVE ("unparsedDirectiveForTest") |
An unparsed directive for test. More... | |
static const std::string | PAYLOAD_TEST ("payloadForTest") |
A paylaod for test;. More... | |
static const std::string | NAMESPACE_0 ("namespace_0") |
A generic namespace string for tests. More... | |
static const std::string | NAMESPACE_1 ("namespace_1") |
A generic namespace string for tests. More... | |
static const std::string | NAMESPACE_2 ("namespace_2") |
A generic namespace string for tests. More... | |
static const std::string | NAME_0 ("name_0") |
A generic name string for tests. More... | |
static const std::string | NAME_1 ("name_1") |
A generic name string for tests. More... | |
static const std::string | NAME_2 ("name_2") |
A generic name string for tests. More... | |
static const std::string | NAME_ANY ("*") |
A generic 'any name' string for tests. More... | |
static const std::string | TEST_ATTACHMENT_CONTEXT_ID ("TEST_ATTACHMENT_CONTEXT_ID") |
static const std::chrono::seconds | LONG_TIMEOUT (15) |
Long timeout we only reach when a concurrency test fails. More... | |
TEST_F (DirectiveRouterTest, test_unroutedDirective) | |
TEST_F (DirectiveRouterTest, test_settingADirectiveHandler) | |
TEST_F (DirectiveRouterTest, test_registeringMultipeHandler) | |
TEST_F (DirectiveRouterTest, test_removingChangingAndNotChangingHandlers) | |
TEST_F (DirectiveRouterTest, test_resultOfHandleDirectiveFailure) | |
TEST_F (DirectiveRouterTest, test_handlerMethodsCanRunConcurrently) | |
TEST_F (DirectiveRouterTest, test_perDirectiveRuleMatching) | |
TEST_F (DirectiveRouterTest, test_perNamespaceRuleMatching) | |
TEST_F (DirectiveRouterTest, test_perInstanceRuleMatching) | |
TEST_F (DirectiveRouterTest, test_perNamespaceAnyInstanceRuleMatching) | |
TEST_F (DirectiveRouterTest, test_perEndpointMatching) | |
TEST_F (DirectiveRouterTest, test_addDirectiveHandlerWithInvalidRoutingRuleShouldFail) | |
static const std::chrono::milliseconds | LONG_HANDLING_TIME_MS (30000) |
Long amount of time for handling a directive to allow other things to happen (we should not reach this). More... | |
static const std::string | NAMESPACE_TEST ("Test") |
Namespace for Test only directives. More... | |
static const std::string | NAMESPACE_SPEAKER ("Speaker") |
Namespace for Speaker directives. More... | |
static const std::string | NAMESPACE_SPEECH_SYNTHESIZER ("SpeechSynthesizer") |
Namespace for SpeechSynthesizer directives. More... | |
static const std::string | NAMESPACE_AUDIO_PLAYER ("AudioPlayer") |
Namespace for AudioPlayer directives. More... | |
static const std::string | NAME_DONE ("Done") |
Name for Test directive used to terminate tests. More... | |
static const std::string | NAME_SET_VOLUME ("SetVolume") |
Name for Speaker::setVolume Directives. More... | |
static const std::string | NAME_SPEAK ("Speak") |
Name for SpeechSynthesizer::Speak directives. More... | |
static const std::string | NAME_PLAY ("Play") |
Name for AudioPlayer::Play directives. More... | |
static const std::string | NAME_BLOCKING ("Blocking") |
Name for Test::Blocking directives. More... | |
static const std::string | NAME_NON_BLOCKING ("Non-Blocking") |
Name for Test::Non-Blocking directives. More... | |
static const std::string | NAME_HANDLE_IMMEDIATELY ("Handle-Immediately") |
Name for Test::Handle-Immediately directives. More... | |
static const std::string | MESSAGE_ID_DONE ("Message_Done") |
MessageId for Testing:Done directives used to terminate tests. More... | |
static const std::string | MESSAGE_ID_0 ("Message_0") |
Generic messageId used for tests. More... | |
static const std::string | MESSAGE_ID_1 ("Message_1") |
Generic MessageId used for test. More... | |
static const std::string | MESSAGE_ID_2 ("Message_2") |
Generic MessageId used for tests. More... | |
static const std::string | DIALOG_REQUEST_ID_DONE ("DialogRequestId_Done") |
Default DialogRequestId for directives used to terminate tests. More... | |
static const std::string | DIALOG_REQUEST_ID_0 ("DialogRequestId_0") |
Generic DialogRequestId used for tests. More... | |
static const std::string | DIALOG_REQUEST_ID_1 ("DialogRequestId_1") |
Generic DialogRequestId used for tests. More... | |
static const std::string | UNPARSED_DIRECTIVE ("unparsedDirectiveForTest") |
An unparsed directive for test. More... | |
static const std::string | PAYLOAD_TEST ("payloadForTest") |
A paylaod for test;. More... | |
static const std::string | DIALOG_REQUEST_ID_2 ("DialogRequestId_2") |
Generic DialogRequestId used for tests. More... | |
static const std::string | TEST_ATTACHMENT_CONTEXT_ID ("TEST_ATTACHMENT_CONTEXT_ID") |
TEST_F (DirectiveSequencerTest, test_createNullptrExceptionSender) | |
TEST_F (DirectiveSequencerTest, test_createDirectiveSequencerInterfaceNullptrExceptionSender) | |
TEST_F (DirectiveSequencerTest, test_createDirectiveSequencerInterfaceNullptrShutdownNotifier) | |
TEST_F (DirectiveSequencerTest, test_createAndDoneTrigger) | |
TEST_F (DirectiveSequencerTest, test_nullptrDirective) | |
TEST_F (DirectiveSequencerTest, test_unhandledDirective) | |
TEST_F (DirectiveSequencerTest, test_emptyDialogRequestId) | |
TEST_F (DirectiveSequencerTest, test_handleImmediatelyHandler) | |
TEST_F (DirectiveSequencerTest, test_removingAndChangingHandlers) | |
TEST_F (DirectiveSequencerTest, test_blockingDirective) | |
TEST_F (DirectiveSequencerTest, test_blockingThenNonDialogDirective) | |
TEST_F (DirectiveSequencerTest, test_bargeIn) | |
TEST_F (DirectiveSequencerTest, testTimer_blockingThenNonBockingOnSameDialogId) | |
TEST_F (DirectiveSequencerTest, test_thatBargeInDropsSubsequentDirectives) | |
TEST_F (DirectiveSequencerTest, test_preHandleDirectiveError) | |
TEST_F (DirectiveSequencerTest, test_handleDirectiveError) | |
TEST_F (DirectiveSequencerTest, test_addDirectiveHandlersWhileHandlingDirectives) | |
TEST_F (DirectiveSequencerTest, test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId) | |
TEST_F (DirectiveSequencerTest, test_addDirectiveAfterDisabled) | |
TEST_F (DirectiveSequencerTest, test_disableCancelsDirective) | |
TEST_F (DirectiveSequencerTest, test_addDirectiveAfterReEnabled) | |
TEST_F (MessageIntepreterTest, test_messageIsInValidJSON) | |
TEST_F (MessageIntepreterTest, test_messageHasInvalidDirectiveKey) | |
TEST_F (MessageIntepreterTest, test_messageHasInvalidHeaderKey) | |
TEST_F (MessageIntepreterTest, test_messageHasInvalidNamespaceKey) | |
TEST_F (MessageIntepreterTest, test_messageHasInvalidNameKey) | |
TEST_F (MessageIntepreterTest, test_messageHasInvalidMessageIdKey) | |
TEST_F (MessageIntepreterTest, test_messageHasNoDialogRequestIdKey) | |
TEST_F (MessageIntepreterTest, test_messageHasNoPayloadKey) | |
TEST_F (MessageIntepreterTest, test_messageHasInvalidPayloadKey) | |
TEST_F (MessageIntepreterTest, test_messageIsValidDirective) | |
Variables | |
static const std::string | NEW_DIALOG_REQUEST_DIRECTIVE_V0 |
static const std::string | NO_CONTEXT = "" |
A null context ID string. More... | |
static const NamespaceAndName | NEW_DIALOG_REQUEST_SIGNATURE {"InteractionModel", "NewDialogRequest"} |
The NewDialogRequest directive signature. More... | |
static const std::string | WILDCARD = "*" |
Represent a wildcard string. 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 | INVALID_JSON = "invalidTestJSON }}" |
An invalid JSON string for testing. More... | |
static const std::string | TEST_ATTACHMENT_CONTEXT_ID = "testContextId" |
static const std::string | SPEAK_DIRECTIVE |
A sample AVS speak directive with all valid JSON keys. More... | |
static const std::string | DIRECTIVE_INVALID_DIRECTIVE_KEY |
A sample AVS speak directive with invalid directive JSON keys. More... | |
static const std::string | DIRECTIVE_INVALID_HEADER_KEY |
A sample AVS speak directive with invalid header key. More... | |
static const std::string | DIRECTIVE_INVALID_NAMESPACE_KEY |
A sample AVS speak directive with invalid namespace key. More... | |
static const std::string | DIRECTIVE_INVALID_NAME_KEY |
A sample AVS speak directive with invalid name key. More... | |
static const std::string | DIRECTIVE_INVALID_MESSAGEID_KEY |
A sample AVS speak directive with invalid messageId key. More... | |
static const std::string | DIRECTIVE_NO_PAYLOAD |
A sample AVS speak directive with no payload key. More... | |
static const std::string | DIRECTIVE_INVALID_PAYLOAD_KEY |
A sample AVS speak directive with invalid payload key. More... | |
static const std::string | DIRECTIVE_NO_DIALOG_REQUEST_ID_KEY |
A sample AVS speak directive with no dialogRequestId key. More... | |
|
static |
Generic DialogRequestId used for tests.
|
static |
Generic DialogRequestId used for tests.
|
static |
Generic DialogRequestId used for tests.
|
static |
Generic DialogRequestId used for tests.
|
static |
Generic DialogRequestId used for tests.
|
static |
Generic DialogRequestId used for tests.
|
static |
Default DialogRequestId for directives used to terminate tests.
|
static |
Long amount of time for handling a directive to allow other things to happen (we should not reach this).
|
static |
Long timeout we only reach when a concurrency test fails.
|
static |
Generic messageId used for tests.
|
static |
Generic messageId used for tests.
|
static |
Generic messageId used for tests.
|
static |
Generic MessageId used for test.
|
static |
Generic MessageId used for test.
|
static |
Generic MessageId used for test.
|
static |
Generic MessageId used for test.
|
static |
Generic MessageId used for test.
|
static |
Generic MessageId used for test.
|
static |
Generic MessageId used for tests.
|
static |
Generic MessageId used for tests.
|
static |
Generic MessageId used for tests.
|
static |
Generic MessageId used for test.
|
static |
MessageId for Testing:Done directives used to terminate tests.
|
static |
A generic name string for tests.
|
static |
A generic name string for tests.
|
static |
A generic name string for tests.
|
static |
A generic name string for tests.
|
static |
A generic name string for tests.
|
static |
A generic name string for tests.
|
static |
A generic name string for tests.
|
static |
A generic 'any name' string for tests.
|
static |
Name for Test::Blocking directives.
|
static |
Name for Test directive used to terminate tests.
|
static |
Name for Test::Handle-Immediately directives.
|
static |
Name for Test::Non-Blocking directives.
|
static |
Name for AudioPlayer::Play directives.
|
static |
Name for Speaker::setVolume Directives.
|
static |
Name for SpeechSynthesizer::Speak directives.
|
static |
A generic namespace string for tests.
|
static |
A generic namespace string for tests.
|
static |
A generic namespace string for tests.
|
static |
A generic namespace string for tests.
|
static |
A generic namespace string for tests.
|
static |
Namespace for AudioPlayer directives.
|
static |
Namespace for Speaker directives.
|
static |
Namespace for SpeechSynthesizer directives.
|
static |
Namespace for Test only directives.
|
static |
A paylaod for test;.
|
static |
A paylaod for test;.
|
static |
A paylaod for test;.
|
static |
|
static |
|
static |
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_nullptrDirective | |||
) |
Send a nullptr AVSDirective
. Expect that it is ignored and a failure status (false) is returned.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_createNullptrExceptionSender | |||
) |
Test DirectiveSequencer::create() with a nullptr ExceptionEncounteredSender
. Expect create to fail.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_unroutedDirective | |||
) |
Check that an un-registered AVDirective
will not be routed.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_wrongDialogRequestId | |||
) |
Register a DirectiveHandler
and set the dialogRequestId
. Send a AVSDirective
that the handler registered for, but with a dialogRequestId
that does not match. Expect that onDirective()
returns true (because the handler was registered) but that none of the handler methods are called (because directives with the wrong dialogRequestID
are dropped).
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_createDirectiveSequencerInterfaceNullptrExceptionSender | |||
) |
Test DirectiveSequencer::createDirectiveSequencerInterface() with a nullptr ExceptionEncounteredSender
. Expect create to fail.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_settingADirectiveHandler | |||
) |
Register an AVSDirective
for routing. Exercise routing via handleDirectiveImmediately()
. Expect that the AVSDirective
is routed.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageIsInValidJSON | |||
) |
Test when the content of message is invalid JSON format. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_createDirectiveSequencerInterfaceNullptrShutdownNotifier | |||
) |
Test DirectiveSequencer::createDirectiveSequencerInterface() with a nullptr ShutdownNotifier
. Expect create to fail.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasInvalidDirectiveKey | |||
) |
Test when the message doesn't contain the directive key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_sendNonBlocking | |||
) |
Register an AUDIO_NON_BLOCKING
DirectiveHandler
. Send an AVSDirective
that matches the registered handler. Expect that preHandleDirective()
and handleDirective()
are called.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_createAndDoneTrigger | |||
) |
Verify core DirectiveSequencerTest. Expect a new non-null instance of m_sequencer.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_registeringMultipeHandler | |||
) |
Register AVSDirectives
to be routed to different handlers. Exercise routing via preHandleDirective()
. Expect that the AVSDirectives
make it to their registered handler.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasInvalidHeaderKey | |||
) |
Test when the message doesn't contain the header key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_nullptrDirective | |||
) |
Exercise sending a nullptr
to onDirective
. Expect that false is returned.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasInvalidNamespaceKey | |||
) |
Test when the message doesn't contain the namespace key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_unhandledDirective | |||
) |
Exercise sending a AVSDirective
for which no handler has been registered. Expect that m_exceptionEncounteredSender will receive a request to send the ExceptionEncountered message.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_sendBlockingThenNonBlocking | |||
) |
Test sending a blocking and then a non-blocking directive. Expect that preHandleDirective()
and handleDirective()
is called for each.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasInvalidNameKey | |||
) |
Test when the message doesn't contain the name key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_emptyDialogRequestId | |||
) |
Send a directive with an empty DialogRequestId. Expect a call to handleDirectiveImmediately().
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasInvalidMessageIdKey | |||
) |
Test when the message doesn't contain the messageId key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasNoDialogRequestIdKey | |||
) |
Test when the message doesn't contain the dialogRequestId key in JSON content. DialogRequestId is optional, so AVSDirective should be created and passed to the directive sequencer.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_handleImmediatelyHandler | |||
) |
Send a directive with a DialogRequestId but with HANDLE_IMMEDIATELY policy in its handlier. Expect a call to handleDirectiveImmediately().
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_onUnregisteredDirective | |||
) |
Register a handler for two AVSDirectives
. Send an AVSDirective
for which no handler is registered. Then send an AVSDirective
with the same dialogRequestId
. Expect that the first AVSDirective
will be dropped (and onDirective()
will return false) because there is no handler. Expect the second directive to be handled, including preHandleDirective()
and handleDirective()
calls. After handleDirective()
has been called, set the dialogRequestId
and send an AVSDirective
for which the other handler was registered. Expect that the last directive is handled as well.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasNoPayloadKey | |||
) |
Test when the message doesn't contain the payload key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_removingAndChangingHandlers | |||
) |
Set handlers (NON_BLOCKING) for two namespace,name pairs. Then remove one and change the other. Send directives for each of the NamespaceAndName values. Expect that the directive with no mapping is not seen by a handler and that the one that still has a handler is handled.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageHasInvalidPayloadKey | |||
) |
Test when the message contains an invalid payload key in JSON content. The AVSDirective shouldn't be created and and passed to directive sequencer. ExceptionEncounteredEvent should be sent to AVS.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_removingChangingAndNotChangingHandlers | |||
) |
Register AVSDirectives
to be routed to different handlers. Then update the registration by clearing it and replacing it with a new configuration where one of the handlers is removed, one is changed, and one is not changed. Exercise routing via handleDirective()
. Expect that the AVSDirectives
are delivered to the last handler they were last assigned to and that false and a BlockingPolicy
of NONE is returned for the directive whose handler was removed.
alexaClientSDK::adsl::test::TEST_F | ( | MessageIntepreterTest | , |
test_messageIsValidDirective | |||
) |
Test when the message is valid JSON content with all keys required in the header. An AVSDirective should be created and passed to the directive sequencer.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_setDialogRequestIdCancelsOutstandingDirectives | |||
) |
Register a long running and BLOCKING
DirectiveHandler
for one AVSDirective
and a short running DirectiveHandler
for two more AVSDirectives
. Send the long running AVSDirective
followed by a short running one. Wait until the long running AVSDirective
has entered handleDirective() and the short running AVSDirective
has entered preHandleDirective(). then change the dialogRequestId()
and send a final AVSDirective
with the new dialogRequestId()
. Expect the first two AVSDirectives
to be cancelled and expect the final AVSDirective
to be processed normally.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_blockingDirective | |||
) |
Send a long running directive with an non-empty DialogRequestId
and a BLOCKING policy. Expect a call to preHandleDirective()
and a call to handleDirective()
. The AVSDirective
is the cancelled, triggering a call to cancelDirective() to close out the test.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_addDirectiveWhileDisabled | |||
) |
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_resultOfHandleDirectiveFailure | |||
) |
Register two AVSDirectives
to be routed to different handlers with different blocking policies. Configure the mock handlers to return false from handleDirective()
. Exercise routing via handleDirective(). Expect that DirectiveRouter::handleDirective()
returns false
and BlockingPolicy::nonePolicy() to indicate failure.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_blockingThenNonDialogDirective | |||
) |
Send a long running directive with an non-empty DialogRequestId
and a BLOCKING policy.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_addDirectiveAfterReEnabled | |||
) |
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_audioAndVisualIsBlockingAudio | |||
) |
Verify that an AVSDirective
using MEDIUMS_AUDIO_AND_VISUAL
is blocking MEDIUM_AUDIO
but not blocking MEDIUMS_NONE
.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_handlerMethodsCanRunConcurrently | |||
) |
Register an AVSDirective
for handling. Invoke preHandleDirective() on a new thread and block its return until a subsequent invocation of handleDirective()
has started. Expect the blocked call to preHandleDirective() to complete quickly.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_bargeIn | |||
) |
Send a directive with an non-empty DialogRequestId
and a BLOCKING
policy, to an DirectiveHandler
with a long handling time. Once the DirectiveHandler
is handling the AVSDirective
, set the DirectiveSequencer's
DialogRequestId
(simulating an outgoing SpeechRecognizer
request). Expect a call to preHandleDirective
() a call to handleDirective
(MessageId
, DirectiveHandlingResult
), and a call to cancelDirective
(MessageId
).
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_perDirectiveRuleMatching | |||
) |
Check that we are able to match directives to handlers that use a per directive routing rule.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_differentMediums | |||
) |
Verify that a blocking AVSDirective
is not blocking a future AVSDirective
on a different Medium
.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
testTimer_blockingThenNonBockingOnSameDialogId | |||
) |
Send an AVSDirective
with an non-empty DialogRequestId
and a BLOCKING
policy followed by two NON_BLOCKING
AVSDirectives
with the same DialogRequestId
. Expect a call to preHandleDirective
(AVSDirective
) and a call to handleDirective()
for each AVSDirective
. Along the way we set the DialogRequestId to the same value to verify that that setting it to the current value does not cancel queued directives.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_perNamespaceRuleMatching | |||
) |
Check that we are able to match directives to handlers that use a per name space routing rule.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_releaseOneMedium | |||
) |
Verify that when MEDIUM_AUDIO
and MEDIUM_VISUAL
have been blocked by two different AVSDirectives
, When one of the blocking has been completed, only its Medium
is released.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_perInstanceRuleMatching | |||
) |
Check that we are able to match directives to handlers that use a per instance routing rule.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_perNamespaceAnyInstanceRuleMatching | |||
) |
Check that we are able to match directives to handlers that use a per name space with any instance routing rule.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_thatBargeInDropsSubsequentDirectives | |||
) |
Send a long-running BLOCKING
AVSDirective
followed by a NON_BLOCKING
AVSDirective
with the same DialogRequestId
. Once the first AVSDirective
is being handled and the second AVSDirective
is being preHandled send a new AVDirective
with a different DialogRequestId
to simulate 'barge-in'. Expect that the first two directives will be cancelled and the third one will be handled (and then cancelled at the end by setting the dialogRequestId to close out the test).
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_perEndpointMatching | |||
) |
Check that we are able to match directives to handlers that use a per endpoint routing rule.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_blockingQueuedDirectivIsBlocking | |||
) |
Verify that a blocked directive with isBlocking=true on the queue is blocking subsequent directives using the same Medium
.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveRouterTest | , |
test_addDirectiveHandlerWithInvalidRoutingRuleShouldFail | |||
) |
Check that we fail when a directive handler declares an invalid routing rule.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_preHandleDirectiveError | |||
) |
Send a long-running BLOCKING
AVSDirective
followed by a NON_BLOCKING
AVSDirective
with the same DialogRequestId
. When the first AVSDirective
is preHandled, report a failure via setFailed()
. Expect that the first AVSDirective
will not be cancelled and that the second AVSDirective
will be dropped entirely.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_handleDirectiveError | |||
) |
Send a long-running BLOCKING
AVSDirective
followed by a NON_BLOCKING
directive with the same DialogRequestId
. When the first AVSDirective
is handled, report a failure via setFailed()
. Expect that the first AVSDirective
will not be cancelled and that the second AVSDirective
may be dropped before preHandleDirective()
is called, and that if not, it will be cancelled.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveProcessorTest | , |
test_nonBlockingQueuedDirectivIsNotBlocking | |||
) |
Verify that a blocked directive with isBlocking=false on the queue is NOT blocking subsequent directives using the same Medium
.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_addDirectiveHandlersWhileHandlingDirectives | |||
) |
Send a long-running BLOCKING
AVSDirective
followed by two NON_BLOCKING
AVSDirectives
with the same DialogRequestId
. Once they have reached the handling and preHandling stages respectively, call addDirectiveHandler()
, changing the handlers for the first two AVSDirectives
. After the handlers have been changed, trigger completion of the first AVSDirective
. Expect that the first directive will be completed by its initial handler (the switch was after handleDirective() was called, and there is no trigger to cancel it. Expect that the second directive's first handler will get the preHandleDirective() call and that its second handler will receive the handleDirective(). Expect that the third directive's handler will get calls for preHandleDirective() and cancelDirective(). The cancel is triggered because the second directive's second handler did not recognize the messageId passed in to handleDirective(), and returned false, canceling any subsequent directives with the same dialogRequestId. Along the way, call addDirectiveHandler()
while inside cancelDirective() to verify that that operation is refused.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId | |||
) |
Send an AVSDirective
with an non-empty DialogRequestId
and a BLOCKING
policy followed by HANDLE_IMMEDIATELY
and NON_BLOCKING
AVSDirectives
with the same DialogRequestId
. Expect a call to preHandleDirective
(AVSDirective
) and a call to handleDirective()
for the AVSDirective
that are not HANDLE_IMMEDIATELY
. And for the one with HANDLE_IMMEDIATELY
, only handleDirectiveImmediately()
is called.
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_addDirectiveAfterDisabled | |||
) |
Check that the @ DirectiveSequencer does not handle directives when it is disabled
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_disableCancelsDirective | |||
) |
Check that the @ DirectiveSequencer.disable() cancel directive being handled
alexaClientSDK::adsl::test::TEST_F | ( | DirectiveSequencerTest | , |
test_addDirectiveAfterReEnabled | |||
) |
Check that the @ DirectiveSequencer can handle directives after being re-enabled
|
static |
An unparsed directive for test.
|
static |
An unparsed directive for test.
|
static |
An unparsed directive for test.
|
static |
The dialogRequestId in AVS message.
|
static |
A sample AVS speak directive with invalid directive JSON keys.
|
static |
A sample AVS speak directive with invalid header key.
|
static |
A sample AVS speak directive with invalid messageId key.
|
static |
A sample AVS speak directive with invalid name key.
|
static |
A sample AVS speak directive with invalid namespace key.
|
static |
A sample AVS speak directive with invalid payload key.
|
static |
A sample AVS speak directive with no dialogRequestId key.
|
static |
A sample AVS speak directive with no payload key.
|
static |
An invalid JSON string for testing.
|
static |
The messageId in AVS message.
|
static |
The name field in AVS message.
|
static |
The namespace in AVS message.
|
static |
An InteractionModel.NewDialogRequest v1.0 directive. The v1.0 directive has a dialogRequestID in the header and payload.
|
static |
The NewDialogRequest directive signature.
|
static |
A null context ID string.
|
static |
The payload in AVS message.
|
static |
A sample AVS speak directive with all valid JSON keys.
|
static |
|
static |
Represent a wildcard string.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0