summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/test/AmRoutingInterfaceTest
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-03-01 19:12:55 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-03-01 19:12:55 +0100
commitdfcafbec34e0e454d9995551998af5d40a27c7ad (patch)
treed93d70fea7feb7004f6a2ce9bfce9b83d3469e42 /AudioManagerDaemon/test/AmRoutingInterfaceTest
parentffccf1e2003cea4230413ccfdfd4cd6515484e4f (diff)
downloadaudiomanager-dfcafbec34e0e454d9995551998af5d40a27c7ad.tar.gz
* fix [GAM-28] problems in routingsender.cpp
* [GAM-27] major refactoring: bringing everything to standardized names * Enhancement of CAmSerializer.h * improvement of documentation * adoption & regeneration of inerfaces
Diffstat (limited to 'AudioManagerDaemon/test/AmRoutingInterfaceTest')
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp439
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h74
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt84
3 files changed, 597 insertions, 0 deletions
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
new file mode 100644
index 0000000..3e8cd21
--- /dev/null
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
@@ -0,0 +1,439 @@
+/**
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file routingInterfaces.cpp
+ *
+ * \date 20-Oct-2011 3:42:04 PM
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ *
+ * \section License
+ * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+ * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+ * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+ * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+
+#include "CAmRoutingInterfaceTest.h"
+#include "shared/CAmDltWrapper.h"
+
+using namespace am;
+using namespace testing;
+
+CAmRoutingInterfaceTest::CAmRoutingInterfaceTest() :
+ plistRoutingPluginDirs(), //
+ plistCommandPluginDirs(), //
+ pSocketHandler(), //
+ pDatabaseHandler(std::string(":memory:")), //
+ pRoutingSender(plistRoutingPluginDirs), //
+ pCommandSender(plistCommandPluginDirs), //
+ pControlSender(""), //
+ pRouter(&pDatabaseHandler, &pControlSender), //
+ pMockInterface(), //
+ pRoutingInterfaceBackdoor(), //
+ pCommandInterfaceBackdoor(), //
+ pControlReceiver(&pDatabaseHandler, &pRoutingSender, &pCommandSender, &pSocketHandler, &pRouter), //
+ pObserver(&pCommandSender, &pRoutingSender, &pSocketHandler)
+{
+ pDatabaseHandler.registerObserver(&pObserver);
+ pRoutingInterfaceBackdoor.unloadPlugins(&pRoutingSender);
+ pRoutingInterfaceBackdoor.injectInterface(&pRoutingSender, &pMockInterface, "mock");
+ pCommandInterfaceBackdoor.unloadPlugins(&pCommandSender);
+}
+
+CAmRoutingInterfaceTest::~CAmRoutingInterfaceTest()
+{
+}
+
+void CAmRoutingInterfaceTest::SetUp()
+{
+ logInfo("RoutingSendInterface Test started ");
+
+}
+
+void CAmRoutingInterfaceTest::TearDown()
+{
+}
+
+TEST_F(CAmRoutingInterfaceTest,abort)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_connectionID_t connectionID;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+
+ //prepare the stage
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+
+ //start a connect, expect a call on the routingInterface
+ EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2));
+
+ //check the correctness of the handle
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_CONNECT);
+
+ //the handle must be inside the handlelist
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[0].handle==handle.handle);
+ ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
+
+ //send an abort expect a call on the routing interface
+ EXPECT_CALL(pMockInterface,asyncAbort(_)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.abortAction(handle));
+
+ //the reaction on the abort is specific for every function
+
+ //now we try to abort a handle that does not exist
+ handle.handle = 24;
+ ASSERT_EQ(E_NON_EXISTENT, pControlReceiver.abortAction(handle));
+}
+
+TEST_F(CAmRoutingInterfaceTest,abortNonExistent)
+{
+ EXPECT_CALL(pMockInterface,asyncAbort(_)).Times(0);
+ am_Handle_s handle;
+ ASSERT_EQ(E_NON_EXISTENT, pControlReceiver.abortAction(handle));
+}
+
+TEST_F(CAmRoutingInterfaceTest,alreadyConnected)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK));
+ am_Handle_s handle;
+ am_connectionID_t connectionID;
+ ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID));
+ ASSERT_EQ(E_ALREADY_EXISTS, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_CONNECT);
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSinkSoundPropertyNoChange)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_SoundProperty_s soundProperty;
+ soundProperty.type = SP_EXAMPLE_TREBLE;
+ soundProperty.value = 23;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ sink.listSoundProperties.push_back(soundProperty);
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncSetSinkSoundProperty(_,sinkID,_)).Times(0);
+ ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSinkSoundProperty(handle,sinkID,soundProperty));
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSourceState)
+{
+ am_Source_s source;
+ am_sourceID_t sourceID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ handle.handle = 0;
+ am_SourceState_e state = SS_PAUSED;
+ pCF.createSource(source);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ source.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ EXPECT_CALL(pMockInterface,asyncSetSourceState(_,sourceID,state)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.setSourceState(handle,sourceID,state));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_SETSOURCESTATE);
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSourceSoundProperty)
+{
+ am_Source_s source;
+ am_sourceID_t sourceID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_SoundProperty_s soundProperty;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSource(source);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ source.sourceID = 2;
+ source.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ EXPECT_CALL(pMockInterface,asyncSetSourceSoundProperty(_,sourceID,_)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.setSourceSoundProperty(handle,sourceID,soundProperty));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_SETSOURCESOUNDPROPERTY);
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[0].handle==handle.handle);
+ ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSinkSoundProperty)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_SoundProperty_s soundProperty;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncSetSinkSoundProperty(_,sinkID,_)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.setSinkSoundProperty(handle,sinkID,soundProperty));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_SETSINKSOUNDPROPERTY);
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[0].handle==handle.handle);
+ ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSourceVolumeNoChange)
+{
+ am_Source_s source;
+ am_sourceID_t sourceID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_volume_t volume = 34;
+ am_RampType_e rampType = RAMP_GENIVI_DIRECT;
+ am_time_t rampTime = 300;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSource(source);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ source.sourceID = 2;
+ source.domainID = 1;
+ source.volume = volume;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ EXPECT_CALL(pMockInterface,asyncSetSourceVolume(_,2,volume,rampType,rampTime)).Times(0);
+ ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSourceVolume(handle,2,volume,rampType,rampTime));
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles.empty());
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSourceVolume)
+{
+ am_Source_s source;
+ am_sourceID_t sourceID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_volume_t volume = 34;
+ am_RampType_e rampType = RAMP_GENIVI_DIRECT;
+ am_time_t rampTime = 300;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSource(source);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ source.sourceID = 2;
+ source.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ EXPECT_CALL(pMockInterface,asyncSetSourceVolume(_,2,volume,rampType,rampTime)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.setSourceVolume(handle,2,volume,rampType,rampTime));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_SETSOURCEVOLUME);
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[0].handle==handle.handle);
+ ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSinkVolumeNoChange)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_volume_t volume = 34;
+ am_RampType_e rampType = RAMP_GENIVI_DIRECT;
+ am_time_t rampTime = 300;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ sink.volume = volume;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncSetSinkVolume(_,2,volume,rampType,rampTime)).Times(0);
+ ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSinkVolume(handle,2,volume,rampType,rampTime));
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles.empty());
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSinkVolume)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_volume_t volume = 34;
+ am_RampType_e rampType = RAMP_GENIVI_DIRECT;
+ am_time_t rampTime = 300;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncSetSinkVolume(_,2,volume,rampType,rampTime)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.setSinkVolume(handle,2,volume,rampType,rampTime));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_SETSINKVOLUME);
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[0].handle==handle.handle);
+ ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
+}
+
+TEST_F(CAmRoutingInterfaceTest,connect)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_connectionID_t connectionID;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_CONNECT);
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[0].handle==handle.handle);
+ ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
+}
+
+TEST_F(CAmRoutingInterfaceTest,disconnect)
+{
+ am_Sink_s sink;
+ am_sinkID_t sinkID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ am_connectionID_t connectionID;
+ std::vector<am_Handle_s> listHandles;
+ pCF.createSink(sink);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ sink.sinkID = 2;
+ sink.domainID = 1;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ EXPECT_CALL(pMockInterface,asyncConnect(_,_,1,sinkID,CF_GENIVI_ANALOG)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.connect(handle,connectionID,CF_GENIVI_ANALOG,1,2));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID));
+ EXPECT_CALL(pMockInterface,asyncDisconnect(_,connectionID)).WillOnce(Return(E_OK));
+ ASSERT_EQ(E_OK, pControlReceiver.disconnect(handle,connectionID));
+ ASSERT_NE(handle.handle, 0);
+ ASSERT_EQ(handle.handleType, H_DISCONNECT);
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles[1].handle==handle.handle);
+ ASSERT_TRUE(listHandles[1].handleType==handle.handleType);
+}
+
+TEST_F(CAmRoutingInterfaceTest,nothingTodisconnect)
+{
+ am_Handle_s handle;
+ am_connectionID_t connectionID = 4;
+ std::vector<am_Handle_s> listHandles;
+ ASSERT_EQ(E_NON_EXISTENT, pControlReceiver.disconnect(handle,connectionID));
+ ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
+ ASSERT_TRUE(listHandles.empty());
+}
+
+TEST_F(CAmRoutingInterfaceTest,setSourceStateNoChange)
+{
+ am_Source_s source;
+ am_sourceID_t sourceID;
+ am_Domain_s domain;
+ am_domainID_t domainID;
+ am_Handle_s handle;
+ handle.handle = 0;
+ am_SourceState_e state = SS_PAUSED;
+ pCF.createSource(source);
+ pCF.createDomain(domain);
+ domain.name = "mock";
+ domain.busname = "mock";
+ source.domainID = 1;
+ source.sourceState = state;
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ EXPECT_CALL(pMockInterface,asyncSetSourceState(_,sourceID,state)).Times(0);
+ ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSourceState(handle,sourceID,state));
+}
+
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
new file mode 100644
index 0000000..a66599d
--- /dev/null
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger AudioManagerDaemon
+ *
+ * \file routingInterfaces.h
+ *
+ * \date 20-Oct-2011 3:42:04 PM
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ *
+ * \section License
+ * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+ * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+ * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+ * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+
+#ifndef ROUTINGINTERFACETEST_H_
+#define ROUTINGINTERFACETEST_H_
+
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
+#include <algorithm>
+#include <string>
+#include <vector>
+#include <set>
+#include "CAmDatabaseHandler.h"
+#include "CAmControlReceiver.h"
+#include "CAmControlSender.h"
+#include "CAmDatabaseObserver.h"
+#include "CAmRouter.h"
+#include "../IAmRoutingBackdoor.h"
+#include "../IAmCommandBackdoor.h"
+#include "../CAmCommonFunctions.h"
+#include "../MockIAmRoutingSend.h"
+#include "shared/CAmSocketHandler.h"
+
+namespace am
+{
+
+class CAmRoutingInterfaceTest: public ::testing::Test
+{
+public:
+ CAmRoutingInterfaceTest();
+ ~CAmRoutingInterfaceTest();
+ std::vector<std::string> plistRoutingPluginDirs;
+ std::vector<std::string> plistCommandPluginDirs;
+ CAmSocketHandler pSocketHandler;
+ CAmDatabaseHandler pDatabaseHandler;
+ CAmRoutingSender pRoutingSender;
+ CAmCommandSender pCommandSender;
+ CAmControlSender pControlSender;
+ CAmRouter pRouter;
+ MockIAmRoutingSend pMockInterface;
+ IAmRoutingBackdoor pRoutingInterfaceBackdoor;
+ IAmCommandBackdoor pCommandInterfaceBackdoor;
+ CAmControlReceiver pControlReceiver;
+ CAmDatabaseObserver pObserver;
+ CAmCommonFunctions pCF;
+ void SetUp();
+ void TearDown();
+};
+
+}
+
+#endif /* ROUTINGINTERFACETEST_H_ */
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
new file mode 100644
index 0000000..ac87e8d
--- /dev/null
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CMakeLists.txt
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2011, BMW AG
+#
+# GeniviAudioMananger AmRoutingInterfaceTest
+#
+# \file CMakeLists.txt
+#
+# \date 20-Oct-2011 3:42:04 PM
+# \author Christian Mueller (christian.ei.mueller@bmw.de)
+#
+# \section License
+# GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+# Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+#
+# This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+# You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+# Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+# Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+# As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+# Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+#
+
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(AmRoutingInterfaceTest)
+
+#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager")
+
+FIND_PACKAGE(PkgConfig)
+pkg_check_modules(SQLITE REQUIRED sqlite3)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${AUDIO_include_FOLDER}
+ ${DBUS_ARCH_INCLUDE_DIR}
+ ${DBUS_include_FOLDER}
+ ${CMAKE_SOURCE_DIR}
+ ${STD_INCLUDE_DIRS}
+ ${DLT_INCLUDE_DIRS}
+ ${DBUS_INCLUDE_DIR}
+ ${include_FOLDER}
+)
+
+file(GLOB ROUTING_INTERFACE_SRCS_CXX
+ "../../src/CAmControlReceiver.cpp"
+ "../../src/CAmDatabaseHandler.cpp"
+ "../../src/CAmDatabaseObserver.cpp"
+ "../../src/CAmCommandSender.cpp"
+ "../../src/CAmRoutingSender.cpp"
+ "../../src/CAmRouter.cpp"
+ "../../src/CAmControlSender.cpp"
+ "../CAmCommonFunctions.cpp"
+ "../../src/CAmDltWrapper.cpp"
+ "../../src/CAmSocketHandler.cpp"
+ "../../src/CAmRoutingReceiver.cpp"
+ "../../src/CAmCommandReceiver.cpp"
+ "*.cpp"
+)
+
+ADD_EXECUTABLE(AmRoutingInterfaceTest ${ROUTING_INTERFACE_SRCS_CXX})
+
+TARGET_LINK_LIBRARIES(AmRoutingInterfaceTest
+ ${SQLITE_LIBRARIES}
+ ${DLT_LIBRARIES}
+ ${DBUS_LIBRARY}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${GTEST_LIBRARIES}
+ gmock
+)
+
+INSTALL(TARGETS AmRoutingInterfaceTest
+ DESTINATION "~/AudioManagerTest/"
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+ COMPONENT tests
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+
+
+