diff options
author | Naveen Bobbili <nbobbili@amazon.com> | 2019-02-25 17:24:29 -0800 |
---|---|---|
committer | Naveen Bobbili <nbobbili@amazon.com> | 2019-02-25 20:55:05 -0800 |
commit | 9eb3a90df3681586b58146b47eea7f3848c348a0 (patch) | |
tree | 9c507e13c233fb649d04c6a45d152f7ec12185f8 /src/plugins/test/mocks | |
parent | 143363b9e864ea465c927057ce7214f124a984cb (diff) |
Refactored VSHL into vshl-core and vshl-capabilities.
vshl-core: This API is responsible for request arbitration. Verbs exposed are
1. startListening
2. cancelListening
3. subscribe
4. enumerateVoiceAgents
5. setDefaultVoiceAgent Used by applications to subscribe to dialog, connection and auth states of underlying low level voiceagent bindings. Used by applications to trigger voice recognition routine of the underlying low level voiceagent binding.
vshl-capabilities: This API exposes publish and subscribe methods for all the speech framework domains/capabilities. For eg. navigation, phonecontrol etc. This API is used by apps and low level voice agent binding to subscribe and publish these capability messages whenever applicable. The code for this is agl-service-voice-high-capabilities repository.
This specific commit is for vshl-core API.
Change-Id: I1101db19b57ee918482a178843641b088508ac5d
Signed-off-by: Naveen Bobbili <nbobbili@amazon.com>
Diffstat (limited to 'src/plugins/test/mocks')
-rw-r--r-- | src/plugins/test/mocks/AFBApiMock.h | 5 | ||||
-rw-r--r-- | src/plugins/test/mocks/AFBEventMock.h | 9 | ||||
-rw-r--r-- | src/plugins/test/mocks/AFBRequestMock.h | 5 | ||||
-rw-r--r-- | src/plugins/test/mocks/CapabilityMock.h | 35 | ||||
-rw-r--r-- | src/plugins/test/mocks/VoiceAgentsChangeObserverMock.h | 17 |
5 files changed, 16 insertions, 55 deletions
diff --git a/src/plugins/test/mocks/AFBApiMock.h b/src/plugins/test/mocks/AFBApiMock.h index 46e2e99..846468d 100644 --- a/src/plugins/test/mocks/AFBApiMock.h +++ b/src/plugins/test/mocks/AFBApiMock.h @@ -18,11 +18,10 @@ #include <gmock/gmock.h> #include "interfaces/afb/IAFBApi.h" - -namespace vshl { +namespace vshlcore { namespace test { -class AFBApiMock : public vshl::common::interfaces::IAFBApi { +class AFBApiMock : public vshlcore::common::interfaces::IAFBApi { public: MOCK_METHOD1(createEvent, std::shared_ptr<IAFBEvent>(const std::string& eventName)); MOCK_METHOD6( diff --git a/src/plugins/test/mocks/AFBEventMock.h b/src/plugins/test/mocks/AFBEventMock.h index 3d78e9f..0e47029 100644 --- a/src/plugins/test/mocks/AFBEventMock.h +++ b/src/plugins/test/mocks/AFBEventMock.h @@ -18,11 +18,10 @@ #include <gmock/gmock.h> #include "interfaces/afb/IAFBApi.h" - -namespace vshl { +namespace vshlcore { namespace test { -class AFBEventMock : public vshl::common::interfaces::IAFBApi::IAFBEvent { +class AFBEventMock : public vshlcore::common::interfaces::IAFBApi::IAFBEvent { public: void setName(const std::string& name) { mName = name; @@ -34,8 +33,8 @@ public: MOCK_METHOD0(isValid, bool()); MOCK_METHOD1(publishEvent, int(struct json_object* payload)); - MOCK_METHOD1(subscribe, bool(vshl::common::interfaces::IAFBRequest& request)); - MOCK_METHOD1(unsubscribe, bool(vshl::common::interfaces::IAFBRequest& request)); + MOCK_METHOD1(subscribe, bool(vshlcore::common::interfaces::IAFBRequest& request)); + MOCK_METHOD1(unsubscribe, bool(vshlcore::common::interfaces::IAFBRequest& request)); private: std::string mName; diff --git a/src/plugins/test/mocks/AFBRequestMock.h b/src/plugins/test/mocks/AFBRequestMock.h index 5557565..02cc34e 100644 --- a/src/plugins/test/mocks/AFBRequestMock.h +++ b/src/plugins/test/mocks/AFBRequestMock.h @@ -18,11 +18,10 @@ #include <gmock/gmock.h> #include "interfaces/afb/IAFBApi.h" - -namespace vshl { +namespace vshlcore { namespace test { -class AFBRequestMock : public vshl::common::interfaces::IAFBRequest { +class AFBRequestMock : public vshlcore::common::interfaces::IAFBRequest { public: MOCK_METHOD0(getNativeRequest, void*()); }; diff --git a/src/plugins/test/mocks/CapabilityMock.h b/src/plugins/test/mocks/CapabilityMock.h deleted file mode 100644 index a2201df..0000000 --- a/src/plugins/test/mocks/CapabilityMock.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -#ifndef VSHL_TEST_MOCKS_CAPABILITYMOCK_H_ -#define VSHL_TEST_MOCKS_CAPABILITYMOCK_H_ - -#include <gmock/gmock.h> - -#include "interfaces/capabilities/ICapability.h" - -namespace vshl { -namespace test { - -class CapabilityMock : public vshl::common::interfaces::ICapability { -public: - MOCK_CONST_METHOD0(getName, std::string()); - MOCK_CONST_METHOD0(getUpstreamMessages, std::list<std::string>()); - MOCK_CONST_METHOD0(getDownstreamMessages, std::list<std::string>()); -}; - -} // namespace test -} // namespace vshl - -#endif // VSHL_TEST_MOCKS_CAPABILITYMOCK_H_
\ No newline at end of file diff --git a/src/plugins/test/mocks/VoiceAgentsChangeObserverMock.h b/src/plugins/test/mocks/VoiceAgentsChangeObserverMock.h index 6edeea2..5935ab6 100644 --- a/src/plugins/test/mocks/VoiceAgentsChangeObserverMock.h +++ b/src/plugins/test/mocks/VoiceAgentsChangeObserverMock.h @@ -18,18 +18,17 @@ #include <gmock/gmock.h> #include "interfaces/voiceagents/IVoiceAgentsChangeObserver.h" - -namespace vshl { +namespace vshlcore { namespace test { -class VoiceAgentsChangeObserverMock : public vshl::common::interfaces::IVoiceAgentsChangeObserver { +class VoiceAgentsChangeObserverMock : public vshlcore::common::interfaces::IVoiceAgentsChangeObserver { public: - MOCK_METHOD1(OnDefaultVoiceAgentChanged, void(shared_ptr<vshl::common::interfaces::IVoiceAgent> defaultVoiceAgent)); - MOCK_METHOD1(OnVoiceAgentAdded, void(shared_ptr<vshl::common::interfaces::IVoiceAgent> voiceAgent)); - MOCK_METHOD1(OnVoiceAgentRemoved, void(shared_ptr<vshl::common::interfaces::IVoiceAgent> voiceAgent)); - MOCK_METHOD1(OnVoiceAgentActiveWakeWordChanged, void(shared_ptr<vshl::common::interfaces::IVoiceAgent> voiceAgent)); - MOCK_METHOD1(OnVoiceAgentActivated, void(shared_ptr<vshl::common::interfaces::IVoiceAgent> voiceAgent)); - MOCK_METHOD1(OnVoiceAgentDeactivated, void(shared_ptr<vshl::common::interfaces::IVoiceAgent> voiceAgent)); + MOCK_METHOD1(OnDefaultVoiceAgentChanged, void(shared_ptr<vshlcore::common::interfaces::IVoiceAgent> defaultVoiceAgent)); + MOCK_METHOD1(OnVoiceAgentAdded, void(shared_ptr<vshlcore::common::interfaces::IVoiceAgent> voiceAgent)); + MOCK_METHOD1(OnVoiceAgentRemoved, void(shared_ptr<vshlcore::common::interfaces::IVoiceAgent> voiceAgent)); + MOCK_METHOD1(OnVoiceAgentActiveWakeWordChanged, void(shared_ptr<vshlcore::common::interfaces::IVoiceAgent> voiceAgent)); + MOCK_METHOD1(OnVoiceAgentActivated, void(shared_ptr<vshlcore::common::interfaces::IVoiceAgent> voiceAgent)); + MOCK_METHOD1(OnVoiceAgentDeactivated, void(shared_ptr<vshlcore::common::interfaces::IVoiceAgent> voiceAgent)); }; } // namespace test |