AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Functions | Variables
AlexaDirectiveSequencerLibraryTest.cpp File Reference
#include <chrono>
#include <deque>
#include <future>
#include <fstream>
#include <mutex>
#include <string>
#include <unordered_map>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <rapidjson/error/en.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <ACL/AVSConnectionManager.h>
#include <ADSL/DirectiveSequencer.h>
#include <ADSL/MessageInterpreter.h>
#include <AVSCommon/AVS/Attachment/InProcessAttachmentReader.h>
#include <AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h>
#include <AVSCommon/AVS/BlockingPolicy.h>
#include <AVSCommon/AVS/EventBuilder.h>
#include <AVSCommon/SDKInterfaces/DirectiveHandlerInterface.h>
#include <AVSCommon/SDKInterfaces/DirectiveHandlerResultInterface.h>
#include <AVSCommon/SDKInterfaces/ExceptionEncounteredSenderInterface.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <AVSCommon/Utils/Logger/Logger.h>
#include "Integration/ACLTestContext.h"
#include "Integration/ObservableMessageRequest.h"
#include "Integration/TestDirectiveHandler.h"
#include "Integration/TestExceptionEncounteredSender.h"
Include dependency graph for AlexaDirectiveSequencerLibraryTest.cpp:

Classes

class  alexaClientSDK::integration::test::AlexaDirectiveSequencerLibraryTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::integration
 
 alexaClientSDK::integration::test
 

Macros

#define LX(event)   alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
 
#define RECOGNIZE_EVENT_JSON(PROFILE, DIALOG_REQUEST_ID)
 
#define FIRST_DIALOG_REQUEST_ID   "DialogRequestID123"
 
#define SECOND_DIALOG_REQUEST_ID   "DialogRequestID456"
 

Functions

static const std::string alexaClientSDK::integration::test::TAG ("AlexaDirectiveSequencerLibraryTest")
 String to identify log entries originating from this file. More...
 
static const std::chrono::seconds alexaClientSDK::integration::test::WAIT_FOR_TIMEOUT_DURATION (5)
 
static const std::chrono::seconds alexaClientSDK::integration::test::SEND_EVENT_TIMEOUT_DURATION (20)
 
static const std::chrono::seconds alexaClientSDK::integration::test::RESPONSE_DELAY (2)
 
bool alexaClientSDK::integration::test::getToken (TestDirectiveHandler::DirectiveParams params, std::string &returnToken)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_sendEventWithDirective)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_sendDirectiveGroupWithoutBlocking)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_sendDirectiveWithDifferentDialogRequestID)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, DISABLED_test_dropQueueAfterBargeIn)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, DISABLED_test_sendDirectiveWithoutADialogRequestID)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_sendDirectivesForPreHandling)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_cancelDirectivesWhileInQueue)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_oneBlockingDirectiveAtTheFront)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_oneBlockingDirectiveInTheMiddle)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_noDirectiveHandlerRegisteredForADirectiveAtTheFront)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, DISABLED_test_noDirectiveHandlerRegisteredForADirectiveInTheMiddle)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_twoDirectiveHandlersRegisteredForADirective)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_multiturnScenario)
 
 alexaClientSDK::integration::test::TEST_F (AlexaDirectiveSequencerLibraryTest, test_getAttachmentWithContentId)
 
int main (int argc, char **argv)
 

Variables

static const std::string alexaClientSDK::integration::test::RECOGNIZE_JOKE_AUDIO_FILE_NAME = "/recognize_joke_test.wav"
 This is a 16 bit 16 kHz little endian linear PCM audio file of "Joke" to be recognized. More...
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_WIKI_AUDIO_FILE_NAME = "/recognize_wiki_test.wav"
 This is a 16 bit 16 kHz little endian linear PCM audio file of "Wikipedia" to be recognized. More...
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_LIONS_AUDIO_FILE_NAME = "/recognize_lions_test.wav"
 This is a 16 bit 16 kHz little endian linear PCM audio file of "Lions" to be recognized. More...
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_WHATS_UP_AUDIO_FILE_NAME = "/recognize_whats_up_test.wav"
 This is a 16 bit 16 kHz little endian linear PCM audio file of "What's up" to be recognized. More...
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_TIMER_AUDIO_FILE_NAME = "/recognize_timer_test.wav"
 This is a 16 bit 16 kHz little endian linear PCM audio file of "Set a timer for 5 seconds" to be recognized. More...
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_FLASHBRIEFING_AUDIO_FILE_NAME = "/recognize_flashbriefing_test.wav"
 This is a 16 bit 16 kHz little endian linear PCM audio file of "flashbriefing" to be recognized. More...
 
static const std::string alexaClientSDK::integration::test::CT_FIRST_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK, FIRST_DIALOG_REQUEST_ID)
 This string specifies a Recognize event using the CLOSE_TALK profile and uses the first DialogRequestID. More...
 
static const std::string alexaClientSDK::integration::test::CT_SECOND_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK, SECOND_DIALOG_REQUEST_ID)
 This string specifies a Recognize event using the CLOSE_TALK profile and uses the second DialogRequestID. More...
 
static const std::string alexaClientSDK::integration::test::NAME_CLEAR_QUEUE = "ClearQueue"
 
static const std::string alexaClientSDK::integration::test::NAME_EXPECT_SPEECH = "ExpectSpeech"
 
static const std::string alexaClientSDK::integration::test::NAME_PLAY = "Play"
 
static const std::string alexaClientSDK::integration::test::NAME_SET_MUTE = "SetMute"
 
static const std::string alexaClientSDK::integration::test::NAME_SPEAK = "Speak"
 
static const std::string alexaClientSDK::integration::test::NAME_STOP = "Stop"
 
static const std::string alexaClientSDK::integration::test::NAME_SPEECH_STARTED = "SpeechStarted"
 
static const std::string alexaClientSDK::integration::test::NAME_SPEECH_FINISHED = "SpeechFinished"
 
static const std::string alexaClientSDK::integration::test::NAME_SET_ALERT_FAILED = "SetAlertFailed"
 
static const std::string alexaClientSDK::integration::test::NAME_SET_ALERT = "SetAlert"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_AUDIO_PLAYER = "AudioPlayer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_ALERTS = "Alerts"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEAKER = "Speaker"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEECH_RECOGNIZER = "SpeechRecognizer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEECH_SYNTHESIZER = "SpeechSynthesizer"
 
static const NamespaceAndName alexaClientSDK::integration::test::EXPECT_SPEECH_PAIR (NAMESPACE_SPEECH_RECOGNIZER, NAME_EXPECT_SPEECH)
 
static const NamespaceAndName alexaClientSDK::integration::test::SET_MUTE_PAIR (NAMESPACE_SPEAKER, NAME_SET_MUTE)
 
static const NamespaceAndName alexaClientSDK::integration::test::SPEAK_PAIR (NAMESPACE_SPEECH_SYNTHESIZER, NAME_SPEAK)
 
static const NamespaceAndName alexaClientSDK::integration::test::SET_ALERT_PAIR (NAMESPACE_ALERTS, NAME_SET_ALERT)
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_DIRECTIVE_KEY = "directive"
 JSON key to get the directive object of a message. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_HEADER_KEY = "header"
 JSON key to get the header object of a message. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_NAMESPACE_KEY = "namespace"
 JSON key to get the namespace value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_NAME_KEY = "name"
 JSON key to get the name value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_MESSAGE_ID_KEY = "messageId"
 JSON key to get the messageId value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_DIALOG_REQUEST_ID_KEY = "dialogRequestId"
 JSON key to get the dialogRequestId value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_PAYLOAD_KEY = "payload"
 JSON key to get the payload object of a message. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_TOKEN_KEY = "token"
 JSON key to get the payload object of a message. More...
 
static const char alexaClientSDK::integration::test::TOKEN_KEY [] = "token"
 JSON key to add to the payload object of a message. More...
 
static std::string alexaClientSDK::integration::test::g_configPath
 Path to the AlexaClientSDKConfig.json file (from command line arguments). More...
 
static std::string alexaClientSDK::integration::test::g_inputPath
 Path to resources (e.g. audio files) for tests (from command line arguments). More...
 

Macro Definition Documentation

◆ FIRST_DIALOG_REQUEST_ID

#define FIRST_DIALOG_REQUEST_ID   "DialogRequestID123"

◆ LX

#define LX (   event)    alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

Create a LogEntry using this file's TAG and the specified event string.

Parameters
Theevent string for this LogEntry.

◆ RECOGNIZE_EVENT_JSON

#define RECOGNIZE_EVENT_JSON (   PROFILE,
  DIALOG_REQUEST_ID 
)

This string specifies a Recognize event using the specified profile.

CLOSE_TALK performs end-of-speech detection on the client, so no directive is sent from AVS to stop recording. NEAR_FIELD performs end-of-speech detection in AVS, so a directive is sent from AVS to stop recording.

◆ SECOND_DIALOG_REQUEST_ID

#define SECOND_DIALOG_REQUEST_ID   "DialogRequestID456"

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

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