AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest Class Reference

Test harness for StateSynchronizer class. More...

Inheritance diagram for alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest:
Collaboration graph
[legend]

Public Member Functions

void SetUp () override
 Set up the test harness for running a test. More...
 
void TearDown () override
 Clean up the test harness after running a test. More...
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 

Protected Member Functions

void verifyButtonPressed (std::function< void()> func, const std::string &expectedMessageName, const std::string &expectedMessagePayloadName)
 
void verifyTogglePressed (std::function< void()> func, const std::string &expectedMessageName, const std::string &expectedMessagePayloadName, const std::string &expectedMessagePayloadAction)
 
void checkMessageRequestAndReleaseTrigger (std::shared_ptr< MessageRequest > messageRequest, bool sendException, const std::string &expected_name, const std::string &expected_payload_name, const std::string &expected_payload_action)
 
void checkGetContextAndReleaseTrigger (std::shared_ptr< ContextRequesterInterface > contextRequester)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 

Protected Attributes

avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status m_messageStatus
 This holds the return status of sendMessage() calls. More...
 
std::shared_ptr< StrictMock< MockContextManager > > m_mockContextManager
 Mocked Context Manager. Note that we make it a strict mock to ensure we test the flow completely. More...
 
std::shared_ptr< StrictMock< MockMessageSender > > m_mockMessageSender
 Mocked Message Sender. Note that we make it a strict mock to ensure we test the flow completely. More...
 
std::shared_ptr< PlaybackControllerm_playbackController
 PlaybackController instance. More...
 
std::condition_variable m_messageTrigger
 This is the condition variable to be used to control sending of a message in test cases. More...
 
std::condition_variable m_contextTrigger
 This is the condition variable to be used to control getting of a context in test cases. More...
 
std::mutex m_mutex
 mutex for the conditional variables. More...
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Test harness for StateSynchronizer class.

Member Function Documentation

◆ checkGetContextAndReleaseTrigger()

void alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::checkGetContextAndReleaseTrigger ( std::shared_ptr< ContextRequesterInterface contextRequester)
protected

Check if message contextRequester is a nullptr and notify the m_contextTrigger to continue execution of the test.

Parameters
contextRequesterThe ContextRequesterInterface.

◆ checkMessageRequestAndReleaseTrigger()

void alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::checkMessageRequestAndReleaseTrigger ( std::shared_ptr< MessageRequest messageRequest,
bool  sendException,
const std::string &  expected_name,
const std::string &  expected_payload_name = "",
const std::string &  expected_payload_action = "" 
)
protected

Check if message request has errors and notify the g_messageTrigger to continue execution of the test.

Parameters
messageRequestThe message requests to be checked.
sendExceptionIf this is true, then an exceptionReceived() will be sent, otherwise sendCompleted()
expected_nameThe string of the expected AVS message name sent.
expected_payload_nameThe string of the expected AVS message payload name sent

◆ SetUp()

void alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::SetUp ( )
overridevirtual

Set up the test harness for running a test.

Reimplemented from testing::Test.

◆ TearDown()

void alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::TearDown ( )
overridevirtual

Clean up the test harness after running a test.

Reimplemented from testing::Test.

◆ verifyButtonPressed()

void alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::verifyButtonPressed ( std::function< void()>  func,
const std::string &  expectedMessageName,
const std::string &  expectedMessagePayloadName = "" 
)
protected

Check if message contextRequester is a nullptr and notify the m_contextTrigger to continue execution of the test.

Parameters
funcThe callable object to execute the key press API.
expectedMessageNameThe string of the expected AVS message name sent by the key pressed.
expectedMessagePayloadThe string of the expected payload name value

◆ verifyTogglePressed()

void alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::verifyTogglePressed ( std::function< void()>  func,
const std::string &  expectedMessageName,
const std::string &  expectedMessagePayloadName,
const std::string &  expectedMessagePayloadAction = "" 
)
protected

Check if message contextRequester is a nullptr and notify the m_contextTrigger to continue execution of the test.

Parameters
funcThe callable object to execute the key press API.
expectedMessageNameThe string of the expected AVS message name sent by the key pressed.
expectedMessagePayloadThe string of the expected payload name value
actionThe bool value of the expected toggle message

Member Data Documentation

◆ m_contextTrigger

std::condition_variable alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_contextTrigger
protected

This is the condition variable to be used to control getting of a context in test cases.

◆ m_messageStatus

avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_messageStatus
protected

This holds the return status of sendMessage() calls.

◆ m_messageTrigger

std::condition_variable alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_messageTrigger
protected

This is the condition variable to be used to control sending of a message in test cases.

◆ m_mockContextManager

std::shared_ptr<StrictMock<MockContextManager> > alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_mockContextManager
protected

Mocked Context Manager. Note that we make it a strict mock to ensure we test the flow completely.

◆ m_mockMessageSender

std::shared_ptr<StrictMock<MockMessageSender> > alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_mockMessageSender
protected

Mocked Message Sender. Note that we make it a strict mock to ensure we test the flow completely.

◆ m_mutex

std::mutex alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_mutex
protected

mutex for the conditional variables.

◆ m_playbackController

std::shared_ptr<PlaybackController> alexaClientSDK::capabilityAgents::playbackController::test::PlaybackControllerTest::m_playbackController
protected

PlaybackController instance.


The documentation for this class was generated from the following file:

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