AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Functions | Variables
SpeechSynthesizerIntegrationTest.cpp File Reference
#include <chrono>
#include <deque>
#include <iostream>
#include <mutex>
#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <acsdkManufactory/Annotated.h>
#include <ADSL/DirectiveSequencer.h>
#include <ADSL/MessageInterpreter.h>
#include <AFML/FocusManager.h>
#include <AVSCommon/AVS/Attachment/InProcessAttachmentReader.h>
#include <AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h>
#include <AVSCommon/AVS/BlockingPolicy.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <AVSCommon/Utils/LibcurlUtils/HTTPContentFetcherFactory.h>
#include <AVSCommon/SDKInterfaces/DirectiveHandlerInterface.h>
#include <AVSCommon/SDKInterfaces/Endpoints/MockEndpointCapabilitiesRegistrar.h>
#include <AVSCommon/Utils/Logger/LogEntry.h>
#include <AVSCommon/Utils/Metrics/MockMetricRecorder.h>
#include <acsdkInteractionModel/InteractionModelCapabilityAgent.h>
#include <acsdkInteractionModel/InteractionModelNotifier.h>
#include <SpeechSynthesizer/SpeechSynthesizer.h>
#include "Integration/ACLTestContext.h"
#include "Integration/ObservableMessageRequest.h"
#include "Integration/TestDirectiveHandler.h"
#include "Integration/TestExceptionEncounteredSender.h"
#include "Integration/TestMessageSender.h"
#include "Integration/TestSpeechSynthesizerObserver.h"
#include "Integration/TestMediaPlayer.h"
Include dependency graph for SpeechSynthesizerIntegrationTest.cpp:

Classes

class  alexaClientSDK::integration::test::TestClient
 A test observer that mocks out the ChannelObserverInterface#onFocusChanged() call. More...
 
class  alexaClientSDK::integration::test::SpeechSynthesizerTest
 

Namespaces

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

Macros

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

Functions

static const std::chrono::seconds alexaClientSDK::integration::test::WAIT_FOR_TIMEOUT_DURATION (15)
 
static const std::chrono::seconds alexaClientSDK::integration::test::SEND_EVENT_TIMEOUT_DURATION (20)
 
static const std::chrono::seconds alexaClientSDK::integration::test::DIRECTIVE_TIMEOUT_DURATION (7)
 
static const std::chrono::seconds alexaClientSDK::integration::test::WANTING_TIMEOUT_DURATION (1)
 
static const std::chrono::seconds alexaClientSDK::integration::test::WAIT_FOR_MEDIA_PLAYER_TIMEOUT_DURATION (60)
 
static const std::string alexaClientSDK::integration::test::TAG ("SpeechSynthesizerIntegrationTest")
 String to identify log entries originating from this file. More...
 
 alexaClientSDK::integration::test::TEST_F (SpeechSynthesizerTest, DISABLED_test_handleMultipleConsecutiveSpeaks)
 
 alexaClientSDK::integration::test::TEST_F (SpeechSynthesizerTest, test_bargeInOnOneSpeech)
 
 alexaClientSDK::integration::test::TEST_F (SpeechSynthesizerTest, test_bargeInOnMultipleSpeaksAtTheBeginning)
 
 alexaClientSDK::integration::test::TEST_F (SpeechSynthesizerTest, DISABLED_test_bargeInOnMultipleSpeaksInTheMiddle)
 
 alexaClientSDK::integration::test::TEST_F (SpeechSynthesizerTest, test_multiturnScenario)
 
 alexaClientSDK::integration::test::TEST_F (SpeechSynthesizerTest, test_handleNoDirectives)
 
int main (int argc, char **argv)
 

Variables

static const std::string alexaClientSDK::integration::test::RECOGNIZE_JOKE_AUDIO_FILE_NAME = "/recognize_joke_test.wav"
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_WIKI_AUDIO_FILE_NAME = "/recognize_wiki_test.wav"
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_LIONS_AUDIO_FILE_NAME = "/recognize_lions_test.wav"
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_FLASHBRIEFING_AUDIO_FILE_NAME = "/recognize_flashbriefing_test.wav"
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_WHATS_UP_AUDIO_FILE_NAME = "/recognize_whats_up_test.wav"
 
static const std::string alexaClientSDK::integration::test::RECOGNIZE_VOLUME_UP_AUDIO_FILE_NAME = "/recognize_volume_up_test.wav"
 
static const std::string alexaClientSDK::integration::test::CT_FIRST_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK, FIRST_DIALOG_REQUEST_ID)
 
static const std::string alexaClientSDK::integration::test::CT_FIRST_RECOGNIZE_EVENT_JSON_NEAR = RECOGNIZE_EVENT_JSON(NEAR_FIELD, FIRST_DIALOG_REQUEST_ID)
 
static const std::string alexaClientSDK::integration::test::CT_SECOND_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK, SECOND_DIALOG_REQUEST_ID)
 
static const std::string alexaClientSDK::integration::test::NAME_SPEAK = "Speak"
 
static const std::string alexaClientSDK::integration::test::NAME_RECOGNIZE = "Recognize"
 
static const std::string alexaClientSDK::integration::test::NAME_ADJUST_VOLUME = "AdjustVolume"
 
static const std::string alexaClientSDK::integration::test::NAME_EXPECT_SPEECH = "ExpectSpeech"
 
static const std::string alexaClientSDK::integration::test::NAME_SET_MUTE = "SetMute"
 
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_SPEECH_INTERRUPTED = "SpeechInterrupted"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEECH_RECOGNIZER = "SpeechRecognizer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEECH_SYNTHESIZER = "SpeechSynthesizer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEAKER = "Speaker"
 
static const NamespaceAndName alexaClientSDK::integration::test::SPEAK_PAIR = {NAMESPACE_SPEECH_SYNTHESIZER, NAME_SPEAK}
 
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::ADJUST_VOLUME_PAIR = {NAMESPACE_SPEAKER, NAME_ADJUST_VOLUME}
 
static const std::string alexaClientSDK::integration::test::DIALOG_ACTIVITY_ID = "Dialog"
 
static const std::string alexaClientSDK::integration::test::ALERTS_ACTIVITY_ID = "Alerts"
 Sample alerts activity id. More...
 
static const unsigned int alexaClientSDK::integration::test::NUMBER_OF_SPEAK_DIRECTIVES_TO_VALIDATE = 3
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_EVENT_KEY = "event"
 JSON key to get the event object of a message. More...
 
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 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