AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Classes | |
struct | FuturePromisePair |
class | MockNotificationRenderer |
class | MockNotificationRendererObserver |
class | NotificationRendererTest |
class | NotificationsCapabilityAgentTest |
class | NotificationsStorageTest |
class | StubAudioFactory |
class | TestNotificationsAudioFactory |
class | TestNotificationsObserver |
class | TestNotificationsStorage |
Typedefs | |
using | IndicatorState = avsCommon::avs::IndicatorState |
Functions | |
TEST_F (NotificationRendererTest, test_createWithNullMediaPlayer) | |
TEST_F (NotificationRendererTest, test_createWithNullApplicationAudioPipelineFactory) | |
TEST_F (NotificationRendererTest, test_createWithNullShutdownNotifier) | |
TEST_F (NotificationRendererTest, test_createWithNullFocusManager) | |
TEST_F (NotificationRendererTest, test_createNotificationsMediaPlayerWithAudioPipelineFactory) | |
TEST_F (NotificationRendererTest, test_playPreferredStream) | |
TEST_F (NotificationRendererTest, testTimer_playDefaultStream) | |
TEST_F (NotificationRendererTest, test_secondPlayRejected) | |
TEST_F (NotificationRendererTest, testTimer_secondPlayWhilePlayingDefaultStream) | |
TEST_F (NotificationRendererTest, test_cancelNotificationRendering) | |
TEST_F (NotificationRendererTest, test_renderNotificationWhileNotifying) | |
TEST_F (NotificationRendererTest, test_renderWhenAcquireChannelsSucceeds) | |
TEST_F (NotificationRendererTest, test_renderWhenAcquireChannelsFails) | |
TEST_F (NotificationRendererTest, testShutdown) | |
static std::chrono::milliseconds | MY_WAIT_TIMEOUT (1000) |
Plenty of time for a test to complete. More... | |
static std::chrono::milliseconds | RENDER_TIME (10) |
Time to simulate a notification rendering. More... | |
static const std::string | NAMESPACE_NOTIFICATIONS ("Notifications") |
Notifications namespace. More... | |
static const std::string | NAME_SET_INDICATOR ("SetIndicator") |
Name for Notifications SetIndicator directive. More... | |
static const std::string | NAME_CLEAR_INDICATOR ("ClearIndicator") |
Name for Notifications ClearIndicator directive. More... | |
static const std::string | MESSAGE_ID_TEST ("MessageId_Test") |
Message Id for testing. More... | |
static const std::string | MESSAGE_ID_TEST2 ("MessageId_Test2") |
static const std::string | CONTEXT_ID_TEST ("ContextId_Test") |
Context ID for testing. More... | |
static const std::string | ASSET_ID1 ("assetId1") |
Test fields for payloads. More... | |
static const std::string | ASSET_ID2 ("assetId2") |
static const std::string | ASSET_URL1 ("assetUrl1") |
static const std::string | ASSET_URL2 ("assetUrl2") |
static const std::string | TAG ("NotificationsCapabilityAgentTest") |
String to identify log entries originating from this file. More... | |
TEST_F (NotificationsCapabilityAgentTest, test_createNotificationsCapabilityAgent) | |
TEST_F (NotificationsCapabilityAgentTest, test_nonEmptyStartupQueue) | |
TEST_F (NotificationsCapabilityAgentTest, test_sendSetIndicator) | |
TEST_F (NotificationsCapabilityAgentTest, test_sendSetIndicatorIncreasesCount) | |
TEST_F (NotificationsCapabilityAgentTest, test_persistVisualIndicatorPreservedIncreasesCount) | |
TEST_F (NotificationsCapabilityAgentTest, test_sendSetIndicatorWithAudio) | |
TEST_F (NotificationsCapabilityAgentTest, test_sendSetIndicatorWithVisualIndicator) | |
TEST_F (NotificationsCapabilityAgentTest, test_sameAssetId) | |
TEST_F (NotificationsCapabilityAgentTest, test_persistVisualIndicatorPreserved) | |
TEST_F (NotificationsCapabilityAgentTest, test_clearIndicatorWithEmptyQueue) | |
TEST_F (NotificationsCapabilityAgentTest, test_clearIndicatorWithEmptyQueueAndIndicatorOn) | |
TEST_F (NotificationsCapabilityAgentTest, testSlow_clearIndicatorAfterMultipleSetIndicators) | |
TEST_F (NotificationsCapabilityAgentTest, test_multipleSetIndicators) | |
TEST_F (NotificationsCapabilityAgentTest, test_clearData) | |
TEST_F (NotificationsCapabilityAgentTest, test_addObserverToNotificationsAfterCapabilityAgentDestroyed) | |
static bool | isOpen (const std::shared_ptr< acsdkNotificationsInterfaces::NotificationsStorageInterface > &storage) |
TEST_F (NotificationsStorageTest, test_constructionAndDestruction) | |
TEST_F (NotificationsStorageTest, test_databaseCreation) | |
TEST_F (NotificationsStorageTest, test_openAndCloseDatabase) | |
TEST_F (NotificationsStorageTest, test_databaseEnqueueAndDequeue) | |
TEST_F (NotificationsStorageTest, test_settingAndGettingIndicatorState) | |
TEST_F (NotificationsStorageTest, test_clearingNotificationIndicators) | |
TEST_F (NotificationsStorageTest, test_defaultValueForEmptyStorage) | |
TEST_F (NotificationsStorageTest, test_defaultValueForInvalidDBContents) | |
TEST_F (NotificationsStorageTest, test_checkingEmptyQueue) | |
TEST_F (NotificationsStorageTest, test_databasePersistence) | |
TEST_F (NotificationsStorageTest, test_queueOrder) | |
TEST_F (NotificationsStorageTest, test_peek) | |
TEST_F (NotificationsStorageTest, test_size) | |
Variables | |
static const std::chrono::milliseconds | ZERO_TIMEOUT {0} |
static const std::chrono::milliseconds | EXPECTED_TIMEOUT {100} |
(short) Timeout value to use when reaching the timeout is expected. More... | |
static const std::chrono::milliseconds | UNEXPECTED_TIMEOUT {5000} |
(long) Timeout value to use when reaching the timeout is NOT expected. More... | |
static std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >)> | goodStreamFunction |
static const NamespaceAndName | NAMESPACE_AND_NAME_INDICATOR_STATE {NAMESPACE_NOTIFICATIONS, "IndicatorState"} |
The NamespaceAndName to send to the ContextManager . More... | |
static const std::string | DEFAULT_NOTIFICATION_AUDIO {"default notification audio"} |
Default "audio" for testing. More... | |
static const std::string | NOTIFICATIONS_CONFIG_JSON |
Mocking the json config file. More... | |
static const std::string | TEST_DATABASE_FILE_PATH = "notificationsStorageTestDatabase.db" |
The filename we will use for the test database file. More... | |
static const std::string | PATH_DELIMITER = "/" |
The path delimiter used by the OS to identify file locations. More... | |
static const std::string | TEST_ASSET_ID1 = "testAssetId1" |
AssetId strings for testing. More... | |
static const std::string | TEST_ASSET_ID2 = "testAssetId2" |
static const std::string | TEST_ASSET_URL1 = "testAssetUrl1" |
AssetUrl strings for testing. More... | |
static const std::string | TEST_ASSET_URL2 = "testAssetUrl2" |
static const std::string | INDICATOR_STATE_NAME = "indicatorState" |
Indicator state table/column name in the database. More... | |
static const int | INVALID_STATE_VALUE = 123 |
Value to represent the invalid indicator state. More... | |
static const unsigned int | NUM_TEST_INDICATORS = 15 |
Number to use when generating many NotificationIndicators. More... | |
static const unsigned int | NOTIFICATION_INDICATOR_SEED = 1 |
Seed to generate random values for NotificationIndicators. More... | |
static const unsigned int | MAX_RANDOM_INT = 100 |
The max random number to generate. More... | |
using alexaClientSDK::acsdkNotifications::test::IndicatorState = typedef avsCommon::avs::IndicatorState |
|
static |
Test fields for payloads.
|
static |
|
static |
|
static |
|
static |
Context ID for testing.
|
static |
Utility function to determine if the storage component is opened.
storage | The storage component to check. |
|
static |
Message Id for testing.
|
static |
|
static |
Plenty of time for a test to complete.
|
static |
Name for Notifications ClearIndicator directive.
|
static |
Name for Notifications SetIndicator directive.
|
static |
Notifications namespace.
|
static |
Time to simulate a notification rendering.
|
static |
String to identify log entries originating from this file.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_constructionAndDestruction | |||
) |
Test basic construction. Database should not be open.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_databaseCreation | |||
) |
Test database creation.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_openAndCloseDatabase | |||
) |
Test opening and closing a database.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_databaseEnqueueAndDequeue | |||
) |
Test enqueueing and dequeueing records in the database.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_createWithNullMediaPlayer | |||
) |
Test that create fails with a null MediaPlayer
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_createWithNullApplicationAudioPipelineFactory | |||
) |
Test that create fails with a null AudioPipelineFactory.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_settingAndGettingIndicatorState | |||
) |
Test setting and getting the IndicatorState
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_createWithNullShutdownNotifier | |||
) |
Test that create fails with a null shutdown notifier.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_createWithNullFocusManager | |||
) |
Test that create fails with a null FocusManager
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_clearingNotificationIndicators | |||
) |
Test just clearing the notification indicators table.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_createNotificationsMediaPlayerWithAudioPipelineFactory | |||
) |
Test that renderer creates a correctly-configured notifications application media interfaces with the audio pipeline factory.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_defaultValueForEmptyStorage | |||
) |
Test that empty database (due to a corruption or crash) results in default indicator state being used (non-undefined).
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_playPreferredStream | |||
) |
Exercise rendering the preferred stream. Verify that the MediaPlayer's setSource() and play() methods get called (once each) and that the NotificationRenderer's observer gets called back to indicate that playback had completed.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_defaultValueForInvalidDBContents | |||
) |
Test that invalid database value (due to a corruption or crash) results in default indicator state being used (non-undefined).
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
testTimer_playDefaultStream | |||
) |
Exercise rendering the default stream. Verify that the MediaPlayer's setSource() and play() methods get called (once each) and that the NotificationRenderer's observer gets called back to indicate that playback had completed.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_checkingEmptyQueue | |||
) |
Test checking for an empty queue.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_secondPlayRejected | |||
) |
Exercise making a second renderNotification()
call while a previous one is still outstanding. Verify that it is rejected.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
testTimer_secondPlayWhilePlayingDefaultStream | |||
) |
Exercise rendering the default stream. Verify that a call to renderNotification()
while the default stream is playing is rejected.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_databasePersistence | |||
) |
Test persistence across closing and reopening database.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_cancelNotificationRendering | |||
) |
Exercise cancelNotificationRendering(). Verify that it causes rendering to complete.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_renderNotificationWhileNotifying | |||
) |
Verify that calling renderNotification() while notification of rendering completion is underway (but not from the callback itself) is accepted. This verifies the use case where onNotificationRenderingFinished() is used as a trigger to render the next notification.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_queueOrder | |||
) |
Test that ordering is maintained with multiple queueing/dequeueing.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_renderWhenAcquireChannelsSucceeds | |||
) |
Test that notification renders properly when acquireChannel succeeds and that the audio channel is successfully released
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_peek | |||
) |
Test that peek() functionality works.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
test_renderWhenAcquireChannelsFails | |||
) |
Test that notification does not render when acquireChannel fails
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationRendererTest | , |
testShutdown | |||
) |
Test that shutdown does the correct cleanup.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsStorageTest | , |
test_size | |||
) |
Test that queueSize() works correctly.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_createNotificationsCapabilityAgent | |||
) |
Test createNotificationsCapabilityAgent() with nullptrs
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_nonEmptyStartupQueue | |||
) |
Test starting up the capability agent with a non-empty queue. Expect that the next item in the queue will be played.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_sendSetIndicator | |||
) |
Test a single SetIndicator directive with persistVisualIndicator and playAudioIndicator set to false. Expect that the NotificationsObserver is notified of the indicator's state remaining OFF. Expect no calls to render notifications since playAudioIndicator is false.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_sendSetIndicatorIncreasesCount | |||
) |
Test that duplicate SetIndicator directive with persistVisualIndicator and playAudioIndicator set to various values. Expect that the NotificationsObserver is notified of the indicator's count on initialization. Expect all calls to increase notification count.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_persistVisualIndicatorPreservedIncreasesCount | |||
) |
Test that the indication count is preserved across shutdown.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_sendSetIndicatorWithAudio | |||
) |
Test a single SetIndicator directive with with playAudioIndicator set to true. Expect the renderer to start playback of the Notification. Expect that the NotificationsObserver is notified of the indicator's state being OFF.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_sendSetIndicatorWithVisualIndicator | |||
) |
Test a single SetIndicator directive with with persistVisualIndicator set to true. Expect that the NotificationsObserver is notified of the indicator's state being ON.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_sameAssetId | |||
) |
Test sending two SetIndicator directives where the second has the same assetId as the first. Expect that the renderer only gets one call to renderNotification().
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_persistVisualIndicatorPreserved | |||
) |
Test that the persistVisualIndicator setting is preserved and used across shutdown.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_clearIndicatorWithEmptyQueue | |||
) |
Test sending a ClearIndicator directive with an empty queue, expecting nothing to happen.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_clearIndicatorWithEmptyQueueAndIndicatorOn | |||
) |
Test sending a ClearIndicator directive with an empty queue and the indicator state set to ON. Expect that the indicator is set to OFF.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
testSlow_clearIndicatorAfterMultipleSetIndicators | |||
) |
Test sending a ClearIndicator directive after multiple SetIndicator directives. Expect that the indicator is set to OFF.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_multipleSetIndicators | |||
) |
Test sending multiple SetIndicators and letting them all render. Expect multiple calls to renderNotification().
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_clearData | |||
) |
Test that clearData()
removes all notifications and sets the indicator to OFF.
alexaClientSDK::acsdkNotifications::test::TEST_F | ( | NotificationsCapabilityAgentTest | , |
test_addObserverToNotificationsAfterCapabilityAgentDestroyed | |||
) |
|
static |
Default "audio" for testing.
|
static |
(short) Timeout value to use when reaching the timeout is expected.
|
static |
Factory of non-null istreams.
|
static |
Indicator state table/column name in the database.
|
static |
Value to represent the invalid indicator state.
|
static |
The max random number to generate.
|
static |
The NamespaceAndName
to send to the ContextManager
.
|
static |
Seed to generate random values for NotificationIndicators.
|
static |
Mocking the json config file.
|
static |
Number to use when generating many NotificationIndicators.
|
static |
The path delimiter used by the OS to identify file locations.
|
static |
AssetId strings for testing.
|
static |
|
static |
AssetUrl strings for testing.
|
static |
|
static |
The filename we will use for the test database file.
|
static |
(long) Timeout value to use when reaching the timeout is NOT expected.
|
static |
Timeout value to use when no wait is desired (e.g. to check the status of a signal)
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0