AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Public Attributes | Protected Attributes | List of all members
alexaClientSDK::acsdkBluetooth::test::BluetoothTest Class Reference
Inheritance diagram for alexaClientSDK::acsdkBluetooth::test::BluetoothTest:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkBluetooth::test::BluetoothTest:
Collaboration graph
[legend]

Public Member Functions

void SetUp () override
 
void TearDown () override
 
void wakeOnSetCompleted ()
 Function to wait for m_wakeSetCompleteFuture to be set. More...
 
std::string getRequestName (std::shared_ptr< avsCommon::avs::MessageRequest > request)
 
bool verifyMessage (std::shared_ptr< avsCommon::avs::MessageRequest > request, std::string expectedName)
 
bool verifyMessagesSentInOrder (std::vector< std::string > orderedEvents, std::function< void()> trigger)
 
void verifyMessagesCount (std::shared_ptr< avsCommon::avs::MessageRequest > request, std::map< std::string, int > *messages)
 
 BluetoothTest ()
 A Constructor which initializes the promises and futures needed for the test class. More...
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 

Public Attributes

std::shared_ptr< Bluetoothm_Bluetooth
 Bluetooth to test More...
 
std::shared_ptr< MockContextManagerm_mockContextManager
 ContextManager to provide state and update state. More...
 
acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterfacem_annotatedFocusManager
 FocusManager to request focus to the CONTENT channel. More...
 
std::shared_ptr< MockFocusManagerm_mockFocusManager
 
std::shared_ptr< MockMessageSenderm_mockMessageSender
 A message sender used to send events to AVS. More...
 
std::shared_ptr< MockExceptionEncounteredSenderm_mockExceptionSender
 An exception sender used to send exception encountered events to AVS. More...
 
std::shared_ptr< SQLiteBluetoothStoragem_bluetoothStorage
 The storage component for Bluetooth. More...
 
std::shared_ptr< MockMediaPlayerm_mockBluetoothMediaPlayer
 Player to send the audio to. More...
 
std::shared_ptr< avsCommon::utils::bluetooth::BluetoothEventBusm_eventBus
 A bus to abstract Bluetooth stack specific messages. More...
 
std::shared_ptr< NiceMock< registrationManager::MockCustomerDataManager > > m_customerDataManager
 Object that will track the CustomerDataHandler. More...
 
std::shared_ptr< MockBluetoothHostControllerm_mockBluetoothHostController
 BluetoothHostController to create MockBluetoothDeviceManager More...
 
std::list< std::shared_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface > > m_mockDiscoveredBluetoothDevices
 The list of discovered devices to create MockBluetoothDeviceManager. More...
 
std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::test::MockApplicationAudioPipelineFactorym_mockAudioPipelineFactory
 The mock ApplicationAudioPipelineFactoryInterface. More...
 
acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterfacem_mockEndpointCapabilitiesRegistrar
 An endpoint capabilities registrar with which to register the Bluetooth CA. More...
 
std::shared_ptr< acsdkBluetoothInterfaces::BluetoothDeviceConnectionRulesProviderInterfacem_connectionRulesProvider
 An object that provides the Bluetooth device connection rules. More...
 
std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterfacem_shutdownNotifier
 Object to notify the Bluetooth CA when to shut down. More...
 
std::shared_ptr< MockBluetoothDevicem_mockBluetoothDevice1
 Bluetooth devices used to test the Bluetooth CA connection logic. More...
 
std::shared_ptr< MockBluetoothDevicem_mockBluetoothDevice2
 
std::shared_ptr< MockBluetoothDevicem_mockBluetoothDevice3
 
std::shared_ptr< MockBluetoothDeviceConnectionRulem_remoteControlConnectionRule
 
std::shared_ptr< MockBluetoothDeviceConnectionRulem_gadgetConnectionRule
 Bluetooth device connection rule for DeviceCategory::GADGET. More...
 
std::unique_ptr< MockBluetoothDeviceManagerm_mockDeviceManager
 A manager to take care of Bluetooth devices. More...
 
std::unique_ptr< MockDirectiveHandlerResultm_mockDirectiveHandlerResult
 A directive handler result to send the result to. More...
 
std::shared_ptr< acsdkBluetoothInterfaces::test::MockBluetoothDeviceObserverm_mockBluetoothDeviceObserver
 An observer to be notified of the Bluetooth connection change. More...
 
std::shared_ptr< MockChannelVolumeInterfacem_mockChannelVolumeInterface
 A ChannelVolumeInterface object to control volume. More...
 
std::shared_ptr< acsdkBluetoothInterfaces::BluetoothNotifierInterfacem_bluetoothNotifier
 A BluetoothNotifierInterface to notify observers. More...
 
std::condition_variable m_messageSentTrigger
 Condition variable to wake on a message being sent. More...
 
std::map< std::string, int > m_messages
 Expected messages. More...
 

Protected Attributes

std::promise< void > m_wakeSetCompletedPromise
 Promise to synchronize directive handling through SetCompleted. More...
 
std::future< void > m_wakeSetCompletedFuture
 Future to synchronize directive handling through SetCompleted. 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)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 

Constructor & Destructor Documentation

◆ BluetoothTest()

alexaClientSDK::acsdkBluetooth::test::BluetoothTest::BluetoothTest ( )
inline

A Constructor which initializes the promises and futures needed for the test class.

Member Function Documentation

◆ getRequestName()

std::string alexaClientSDK::acsdkBluetooth::test::BluetoothTest::getRequestName ( std::shared_ptr< avsCommon::avs::MessageRequest request)

Get the request event name.

Parameters
requestThe MessageRequest to verify.
Returns
The event name.

◆ SetUp()

void alexaClientSDK::acsdkBluetooth::test::BluetoothTest::SetUp ( )
overridevirtual

create MockChannelVolumeInterface for ducking.

Set up expected calls to injected objects.

Reimplemented from testing::Test.

◆ TearDown()

void alexaClientSDK::acsdkBluetooth::test::BluetoothTest::TearDown ( )
overridevirtual

Reimplemented from testing::Test.

◆ verifyMessage()

bool alexaClientSDK::acsdkBluetooth::test::BluetoothTest::verifyMessage ( std::shared_ptr< avsCommon::avs::MessageRequest request,
std::string  expectedName 
)

Verify that the message name matches the expected name.

Parameters
requestThe MessageRequest to verify.
expectedNameThe expected name to find in the json header.
Returns
true if the message name matched the expect name.

◆ verifyMessagesCount()

void alexaClientSDK::acsdkBluetooth::test::BluetoothTest::verifyMessagesCount ( std::shared_ptr< avsCommon::avs::MessageRequest request,
std::map< std::string, int > *  messages 
)

Verify that the messages sent matches the count.

Parameters
requestThe MessageRequest to verify.
messagesThe Map<RequestName, Count> expected messages.

◆ verifyMessagesSentInOrder()

bool alexaClientSDK::acsdkBluetooth::test::BluetoothTest::verifyMessagesSentInOrder ( std::vector< std::string >  orderedEvents,
std::function< void()>  trigger 
)

Verify that the messages sent matches the ordered list of events.

Parameters
requestThe MessageRequest to verify.
triggerThe function to trigger sending the messages.
Returns
true if the messages sent matches the ordered list of events.

◆ wakeOnSetCompleted()

void alexaClientSDK::acsdkBluetooth::test::BluetoothTest::wakeOnSetCompleted ( )

Function to wait for m_wakeSetCompleteFuture to be set.

Member Data Documentation

◆ m_annotatedFocusManager

acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_annotatedFocusManager

FocusManager to request focus to the CONTENT channel.

◆ m_Bluetooth

std::shared_ptr<Bluetooth> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_Bluetooth

Bluetooth to test

◆ m_bluetoothNotifier

std::shared_ptr<acsdkBluetoothInterfaces::BluetoothNotifierInterface> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_bluetoothNotifier

A BluetoothNotifierInterface to notify observers.

◆ m_bluetoothStorage

std::shared_ptr<SQLiteBluetoothStorage> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_bluetoothStorage

The storage component for Bluetooth.

◆ m_connectionRulesProvider

std::shared_ptr<acsdkBluetoothInterfaces::BluetoothDeviceConnectionRulesProviderInterface> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_connectionRulesProvider

An object that provides the Bluetooth device connection rules.

◆ m_customerDataManager

std::shared_ptr<NiceMock<registrationManager::MockCustomerDataManager> > alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_customerDataManager

Object that will track the CustomerDataHandler.

◆ m_eventBus

std::shared_ptr<avsCommon::utils::bluetooth::BluetoothEventBus> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_eventBus

A bus to abstract Bluetooth stack specific messages.

◆ m_gadgetConnectionRule

std::shared_ptr<MockBluetoothDeviceConnectionRule> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_gadgetConnectionRule

Bluetooth device connection rule for DeviceCategory::GADGET.

◆ m_messages

std::map<std::string, int> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_messages

Expected messages.

◆ m_messageSentTrigger

std::condition_variable alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_messageSentTrigger

Condition variable to wake on a message being sent.

◆ m_mockAudioPipelineFactory

std::shared_ptr<acsdkApplicationAudioPipelineFactoryInterfaces::test::MockApplicationAudioPipelineFactory> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockAudioPipelineFactory

The mock ApplicationAudioPipelineFactoryInterface.

◆ m_mockBluetoothDevice1

std::shared_ptr<MockBluetoothDevice> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockBluetoothDevice1

Bluetooth devices used to test the Bluetooth CA connection logic.

◆ m_mockBluetoothDevice2

std::shared_ptr<MockBluetoothDevice> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockBluetoothDevice2

◆ m_mockBluetoothDevice3

std::shared_ptr<MockBluetoothDevice> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockBluetoothDevice3

◆ m_mockBluetoothDeviceObserver

std::shared_ptr<acsdkBluetoothInterfaces::test::MockBluetoothDeviceObserver> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockBluetoothDeviceObserver

An observer to be notified of the Bluetooth connection change.

◆ m_mockBluetoothHostController

std::shared_ptr<MockBluetoothHostController> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockBluetoothHostController

BluetoothHostController to create MockBluetoothDeviceManager

◆ m_mockBluetoothMediaPlayer

std::shared_ptr<MockMediaPlayer> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockBluetoothMediaPlayer

Player to send the audio to.

◆ m_mockChannelVolumeInterface

std::shared_ptr<MockChannelVolumeInterface> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockChannelVolumeInterface

A ChannelVolumeInterface object to control volume.

◆ m_mockContextManager

std::shared_ptr<MockContextManager> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockContextManager

ContextManager to provide state and update state.

◆ m_mockDeviceManager

std::unique_ptr<MockBluetoothDeviceManager> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockDeviceManager

A manager to take care of Bluetooth devices.

◆ m_mockDirectiveHandlerResult

std::unique_ptr<MockDirectiveHandlerResult> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockDirectiveHandlerResult

A directive handler result to send the result to.

◆ m_mockDiscoveredBluetoothDevices

std::list<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> > alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockDiscoveredBluetoothDevices

The list of discovered devices to create MockBluetoothDeviceManager.

◆ m_mockEndpointCapabilitiesRegistrar

An endpoint capabilities registrar with which to register the Bluetooth CA.

◆ m_mockExceptionSender

std::shared_ptr<MockExceptionEncounteredSender> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockExceptionSender

An exception sender used to send exception encountered events to AVS.

◆ m_mockFocusManager

std::shared_ptr<MockFocusManager> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockFocusManager

The mock focus manager, wrapped by m_annotatedFocusManager. Keeping a reference to this mock is required in order to set expectations on it.

◆ m_mockMessageSender

std::shared_ptr<MockMessageSender> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_mockMessageSender

A message sender used to send events to AVS.

◆ m_remoteControlConnectionRule

std::shared_ptr<MockBluetoothDeviceConnectionRule> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_remoteControlConnectionRule

Bluetooth device connection rules. Bluetooth device connection rule for DeviceCategory::REMOTE_CONTROL.

◆ m_shutdownNotifier

std::shared_ptr<acsdkShutdownManagerInterfaces::ShutdownNotifierInterface> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_shutdownNotifier

Object to notify the Bluetooth CA when to shut down.

◆ m_wakeSetCompletedFuture

std::future<void> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_wakeSetCompletedFuture
protected

Future to synchronize directive handling through SetCompleted.

◆ m_wakeSetCompletedPromise

std::promise<void> alexaClientSDK::acsdkBluetooth::test::BluetoothTest::m_wakeSetCompletedPromise
protected

Promise to synchronize directive handling through SetCompleted.


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