AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Functions
alexaClientSDK::contextManager::test Namespace Reference

Classes

class  ContextManagerTest
 Context Manager Test. More...
 
struct  MockContextObserver
 Mock context observer. More...
 
struct  MockContextRequester
 Mock context requester. More...
 
struct  MockLegacyStateProvider
 Mock legacy state provider. More...
 
class  MockStateProvider
 Mock state provider. More...
 

Functions

 TEST_F (ContextManagerTest, test_setStateForLegacyRegisteredProvider)
 
 TEST_F (ContextManagerTest, test_setStateForUnregisteredLegacyProvider)
 
 TEST_F (ContextManagerTest, test_getContextLegacyProvider)
 
 TEST_F (ContextManagerTest, test_setLegacyStateProviderSetStateTwiceShouldFail)
 
 TEST_F (ContextManagerTest, test_provideStateTimeout)
 
 TEST_F (ContextManagerTest, test_incorrectToken)
 
 TEST_F (ContextManagerTest, test_sometimesProviderWithValidState)
 
 TEST_F (ContextManagerTest, test_sometimesProviderWithEmptyState)
 
 TEST_F (ContextManagerTest, test_neverProvider)
 
 TEST_F (ContextManagerTest, test_getEndpointContextShouldIncludeOnlyRelevantStates)
 Test that only context relevant to the given endpoint is included in the getContext. More...
 
 TEST_F (ContextManagerTest, test_getContextWhenStateAndCacheAreUnavailableShouldFail)
 Test that requester will get notified of a failure when one provider was not able to provide its state. More...
 
 TEST_F (ContextManagerTest, test_getContextWhenStateUnavailableShouldReturnCache)
 Test that requester will get cached value when provider cannot provide latest state. More...
 
 TEST_F (ContextManagerTest, test_reportStateChangeShouldNotifyObserver)
 Test that report state change notifies the ContextManagerObserverInterface. More...
 
 TEST_F (ContextManagerTest, test_getContextInParallelShouldSucceed)
 Test that getContext can handle multiple getContext at the same time. More...
 
 TEST_F (ContextManagerTest, test_getContextWithoutReportableStateProperties)
 
 TEST_F (ContextManagerTest, test_getContextWithReportableStateProperties)
 Test if the getContext() method includes state from StateProviders which have reportable state properties. More...
 
 TEST_F (ContextManagerTest, test_getContextShouldReturnCache)
 Test that requester will get cached value when provider set shouldQueryState to false. More...
 

Function Documentation

◆ TEST_F() [1/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_setStateForLegacyRegisteredProvider   
)

Set the state with a StateRefreshPolicy ALWAYS for a StateProviderInterface that is registered with the ContextManager. Expect SetStateResult SUCCESS is returned.

◆ TEST_F() [2/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_setStateForUnregisteredLegacyProvider   
)

Set the state with a StateRefreshPolicy NEVER for a StateProviderInterface that is not registered with the ContextManager. Expect SetStateResult SUCCESS is returned.

◆ TEST_F() [3/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextLegacyProvider   
)

Set the states with a StateRefreshPolicy ALWAYS for StateProviderInterfaces that are registered with the ContextManager. Request for context by calling getContext. Expect that the context is returned within the timeout period. Check the context that is returned by the ContextManager. Expect it should match the test value.

◆ TEST_F() [4/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_setLegacyStateProviderSetStateTwiceShouldFail   
)

Respond to the same state request twice. The first one should succeed while the second one should fail.

◆ TEST_F() [5/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_provideStateTimeout   
)

Register a StateProviderInterfaces with the ContextManager which responds slowly to requests. Set the states with a StateRefreshPolicy ALWAYS for StateProviderInterfaces. Request for context by calling getContext. Expect that failure occurs due to timeout.

◆ TEST_F() [6/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_incorrectToken   
)

Request for context by calling getContextSet. Wait for context. Set the state for a StateProviderInterface that is registered with the ContextManager with a wrong token value. Expect that SetStateResult STATE_TOKEN_OUTDATED is returned.

◆ TEST_F() [7/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_sometimesProviderWithValidState   
)

Test that a StateProvider that has a refreshPolicy SOMETIMES is queried on call to getContext(). If the stateProvider provides a valid (non-empty) state, test that it is reflected in the corresponding context that is generated.

◆ TEST_F() [8/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_sometimesProviderWithEmptyState   
)

Test that a StateProvider that has a refreshPolicy SOMETIMES is queried on call to getContext(). If the stateProvider provides an empty state, test that it is NOT reflected in the corresponding context that is generated.

◆ TEST_F() [9/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_neverProvider   
)

Test that a provider that sets its policy to NEVER is not queried but that the state is included in the context.

◆ TEST_F() [10/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getEndpointContextShouldIncludeOnlyRelevantStates   
)

Test that only context relevant to the given endpoint is included in the getContext.

◆ TEST_F() [11/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextWhenStateAndCacheAreUnavailableShouldFail   
)

Test that requester will get notified of a failure when one provider was not able to provide its state.

◆ TEST_F() [12/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextWhenStateUnavailableShouldReturnCache   
)

Test that requester will get cached value when provider cannot provide latest state.

◆ TEST_F() [13/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_reportStateChangeShouldNotifyObserver   
)

Test that report state change notifies the ContextManagerObserverInterface.

◆ TEST_F() [14/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextInParallelShouldSucceed   
)

Test that getContext can handle multiple getContext at the same time.

◆ TEST_F() [15/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextWithoutReportableStateProperties   
)

Test if the getContextWithoutReportableStateProperties() method skips state from StateProviders which have reportable state properties.

◆ TEST_F() [16/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextWithReportableStateProperties   
)

Test if the getContext() method includes state from StateProviders which have reportable state properties.

◆ TEST_F() [17/17]

alexaClientSDK::contextManager::test::TEST_F ( ContextManagerTest  ,
test_getContextShouldReturnCache   
)

Test that requester will get cached value when provider set shouldQueryState to false.

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