diff options
author | Christian Mueller <christian@lmuc329619u.(none)> | 2011-12-14 11:36:44 +0100 |
---|---|---|
committer | Christian Mueller <christian@lmuc329619u.(none)> | 2011-12-14 11:36:44 +0100 |
commit | 68678bed2dc3d4a5849d283bec84a01e2836603f (patch) | |
tree | 57b58aa549d7e0547468c8f13475b3e5ac1326e8 /AudioManagerDaemon/test | |
parent | 92c8b837306ff1dcd889f9c075435aec50e9aea3 (diff) | |
download | audiomanager-68678bed2dc3d4a5849d283bec84a01e2836603f.tar.gz |
update in headers, small things
Diffstat (limited to 'AudioManagerDaemon/test')
10 files changed, 46 insertions, 25 deletions
diff --git a/AudioManagerDaemon/test/CommandInterfaceBackdoor.h b/AudioManagerDaemon/test/CommandInterfaceBackdoor.h index 10bb135..c5cfc8a 100644 --- a/AudioManagerDaemon/test/CommandInterfaceBackdoor.h +++ b/AudioManagerDaemon/test/CommandInterfaceBackdoor.h @@ -8,6 +8,7 @@ #ifndef COMMANDINTERFACEBACKDOOR_H_ #define COMMANDINTERFACEBACKDOOR_H_ +#include <command/CommandSendInterface.h> #include "CommandSender.h" using namespace am; diff --git a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt index bd09acd..a96cfe8 100644 --- a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt +++ b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt @@ -54,7 +54,7 @@ INCLUDE_DIRECTORIES( file(GLOB CONTROL_INTERFACE_SRCS_CXX "../../src/DatabaseHandler.cpp" - "../../src/Observer.cpp" + "../../src/DatabaseObserver.cpp" "../../src/RoutingSender.cpp" "../../src/RoutingReceiver.cpp" "../../src/CommandSender.cpp" diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp index 8c57cfd..9bfc5f6 100644 --- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp +++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp @@ -10,20 +10,22 @@ controlInterfaceTest::controlInterfaceTest() - :pDatabaseHandler(), - pRoutingSender(), - pCommandSender(), + :plistCommandPluginDirs(), + plistRoutingPluginDirs(), + pDatabaseHandler(std::string(":memory:")), + pRoutingSender(plistRoutingPluginDirs), + pCommandSender(plistCommandPluginDirs), pMockControlInterface(), pMockRoutingInterface(), - pControlSender(), + pControlSender(std::string("")), pRoutingInterfaceBackdoor(), pCommandInterfaceBackdoor(), pControlInterfaceBackdoor(), - pObserver(&pCommandSender,&pRoutingSender), - pControlReceiver(&pDatabaseHandler,&pRoutingSender), + pDatabaseObserver(&pCommandSender,&pRoutingSender), + pControlReceiver(&pDatabaseHandler,&pRoutingSender,&pCommandSender), pRoutingReceiver(&pDatabaseHandler,&pRoutingSender,&pControlSender) { - pDatabaseHandler.registerObserver(&pObserver); + pDatabaseHandler.registerObserver(&pDatabaseObserver); pRoutingInterfaceBackdoor.unloadPlugins(&pRoutingSender); pCommandInterfaceBackdoor.unloadPlugins(&pCommandSender); pControlInterfaceBackdoor.replaceController(&pControlSender,&pMockControlInterface); @@ -207,15 +209,17 @@ TEST_F(controlInterfaceTest,setSourceState) source.domainID=1; ASSERT_EQ(E_OK,pDatabaseHandler.enterDomainDB(domain,domainID)); ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,sourceID)); - EXPECT_CALL(pMockRoutingInterface,asyncSetSourceState(_,2,SS_PAUSED)); + EXPECT_CALL(pMockRoutingInterface,asyncSetSourceState(_,2,SS_PAUSED)).WillOnce(Return(E_OK)); ASSERT_EQ(E_OK,pControlReceiver.setSourceState(handle,source.sourceID,SS_PAUSED)); ASSERT_EQ(E_OK,pControlReceiver.getListHandles(handlesList)); ASSERT_EQ(handlesList[0].handle,handle.handle); ASSERT_EQ(handlesList[0].handleType,handle.handleType); ASSERT_EQ(E_OK,pDatabaseHandler.getSoureState(source.sourceID,state)); - ASSERT_EQ(state,SS_PAUSED); + ASSERT_EQ(state,SS_ON); //ok, since value will be added after the ack! EXPECT_CALL(pMockControlInterface,cbAckSetSourceState(_,E_OK)).Times(1); - //pRoutingReceiver.ackSetSourceState(handle,SS_PAUSED); + pRoutingReceiver.ackSetSourceState(handle,E_OK); + ASSERT_EQ(E_OK,pDatabaseHandler.getSoureState(source.sourceID,state)); + ASSERT_EQ(state,SS_PAUSED); } diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h index d85c1f0..daac707 100644 --- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h +++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h @@ -19,7 +19,7 @@ #include "DatabaseHandler.h" #include "ControlReceiver.h" #include "RoutingReceiver.h" -#include "Observer.h" +#include "DatabaseObserver.h" #include "ControlSender.h" #include "RoutingSender.h" #include "../RoutingInterfaceBackdoor.h" @@ -54,7 +54,9 @@ using ::testing::MatchResultListener; class controlInterfaceTest : public Test{ public: controlInterfaceTest(); - virtual ~controlInterfaceTest(); + ~controlInterfaceTest(); + std::vector<std::string> plistRoutingPluginDirs; + std::vector<std::string> plistCommandPluginDirs; DatabaseHandler pDatabaseHandler; RoutingSender pRoutingSender; CommandSender pCommandSender; @@ -64,7 +66,7 @@ public: RoutingInterfaceBackdoor pRoutingInterfaceBackdoor; CommandInterfaceBackdoor pCommandInterfaceBackdoor; ControlInterfaceBackdoor pControlInterfaceBackdoor; - Observer pObserver; + DatabaseObserver pDatabaseObserver; ControlReceiver pControlReceiver; RoutingReceiver pRoutingReceiver; CommonFunctions pCF; diff --git a/AudioManagerDaemon/test/database/CMakeLists.txt b/AudioManagerDaemon/test/database/CMakeLists.txt index 33e6f87..33a1b40 100644 --- a/AudioManagerDaemon/test/database/CMakeLists.txt +++ b/AudioManagerDaemon/test/database/CMakeLists.txt @@ -54,7 +54,7 @@ INCLUDE_DIRECTORIES( file(GLOB DATABASE_SRCS_CXX "../../src/DatabaseHandler.cpp" - "../../src/Observer.cpp" + "../../src/DatabaseObserver.cpp" "../../src/CommandSender.cpp" "../../src/RoutingSender.cpp" "../CommonFunctions.cpp" diff --git a/AudioManagerDaemon/test/database/databaseTest.cpp b/AudioManagerDaemon/test/database/databaseTest.cpp index 6f269e9..a1580fe 100644 --- a/AudioManagerDaemon/test/database/databaseTest.cpp +++ b/AudioManagerDaemon/test/database/databaseTest.cpp @@ -24,7 +24,7 @@ */ #include "databaseTest.h" -#include "Observer.h" +#include "DatabaseObserver.h" using namespace am; @@ -35,6 +35,15 @@ extern bool equalRoutingElement (const am_RoutingElement_s a,const am_RoutingEle extern bool equalClassProperties (const am_ClassProperty_s a,const am_ClassProperty_s b); extern std::string int2string(int i); +databaseTest::databaseTest() + :pDatabaseHandler(std::string(":memory:")) +{ +} + +databaseTest::~databaseTest() +{ +} + void databaseTest::createMainConnectionSetup() { //fill the connection database @@ -111,7 +120,7 @@ void databaseTest::SetUp() DLT_REGISTER_APP("Dtest","AudioManagerDeamon"); DLT_REGISTER_CONTEXT(AudioManager,"Main","Main Context"); DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Database Test started ")); - Observer *observer=NULL; + DatabaseObserver *observer=NULL; pDatabaseHandler.registerObserver(observer); } diff --git a/AudioManagerDaemon/test/database/databaseTest.h b/AudioManagerDaemon/test/database/databaseTest.h index 3255b71..d7fb36f 100644 --- a/AudioManagerDaemon/test/database/databaseTest.h +++ b/AudioManagerDaemon/test/database/databaseTest.h @@ -24,6 +24,8 @@ using namespace testing; class databaseTest : public Test { public: + databaseTest(); + ~databaseTest(); DatabaseHandler pDatabaseHandler; CommonFunctions pCF; diff --git a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt index b3db54a..0376683 100644 --- a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt +++ b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt @@ -55,7 +55,7 @@ INCLUDE_DIRECTORIES( file(GLOB ROUTING_INTERFACE_SRCS_CXX "../../src/ControlReceiver.cpp" "../../src/DatabaseHandler.cpp" - "../../src/Observer.cpp" + "../../src/DatabaseObserver.cpp" "../../src/CommandSender.cpp" "../../src/RoutingSender.cpp" "../CommonFunctions.cpp" diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp index bc3e583..1e89d7a 100644 --- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp +++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp @@ -22,13 +22,14 @@ using ::testing::ElementsAre; using ::testing::NotNull; routingInterfaceTest::routingInterfaceTest() - :pDatabaseHandler(), - pRoutingSender(), - pCommandSender(), + :plistCommandPluginDirs(), + pDatabaseHandler(std::string(":memory:")), + pRoutingSender(plistRoutingPluginDirs), + pCommandSender(plistCommandPluginDirs), pMockInterface(), pRoutingInterfaceBackdoor(), pCommandInterfaceBackdoor(), - pControlReceiver(&pDatabaseHandler,&pRoutingSender), + pControlReceiver(&pDatabaseHandler,&pRoutingSender,&pCommandSender), pObserver(&pCommandSender,&pRoutingSender) { pDatabaseHandler.registerObserver(&pObserver); diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h index f46ea5f..3b27701 100644 --- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h +++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.h @@ -19,7 +19,7 @@ #include "DatabaseHandler.h" #include "ControlReceiver.h" #include "ControlSender.h" -#include "Observer.h" +#include "DatabaseObserver.h" #include "../RoutingInterfaceBackdoor.h" #include "../CommandInterfaceBackdoor.h" #include "../CommonFunctions.h" @@ -32,7 +32,9 @@ using namespace am; class routingInterfaceTest : public Test{ public: routingInterfaceTest(); - virtual ~routingInterfaceTest(); + ~routingInterfaceTest(); + std::vector<std::string> plistRoutingPluginDirs; + std::vector<std::string> plistCommandPluginDirs; DatabaseHandler pDatabaseHandler; RoutingSender pRoutingSender; CommandSender pCommandSender; @@ -40,7 +42,7 @@ public: RoutingInterfaceBackdoor pRoutingInterfaceBackdoor; CommandInterfaceBackdoor pCommandInterfaceBackdoor; ControlReceiver pControlReceiver; - Observer pObserver; + DatabaseObserver pObserver; CommonFunctions pCF; void SetUp(); void TearDown(); |