tests: correct bus name in DBusProxyTest
authorAleksandar Kanchev <kanchev@itestra.com>
Mon, 25 Feb 2013 17:27:27 +0000 (18:27 +0100)
committerAleksandar Kanchev <kanchev@itestra.com>
Wed, 27 Feb 2013 13:00:48 +0000 (14:00 +0100)
src/test/DBusProxyTest.cpp

index e583f38..4801e90 100644 (file)
@@ -30,7 +30,7 @@
 
 
 static const std::string commonApiAddress = "local:CommonAPI.DBus.tests.DBusProxyTestInterface:CommonAPI.DBus.tests.DBusProxyTestService";
-static const std::string commonApiServiceName = "CommonAPI.DBus.tests.DBusProxyTest";
+static const std::string commonApiServiceName = "CommonAPI.DBus.tests.DBusProxyTestInterface";
 static const std::string interfaceName = "CommonAPI.DBus.tests.DBusProxyTestInterface";
 static const std::string busName = "CommonAPI.DBus.tests.DBusProxyTestService";
 static const std::string objectPath = "/CommonAPI/DBus/tests/DBusProxyTestService";
@@ -201,20 +201,10 @@ TEST_F(ProxyTest, ServiceStatus) {
 }
 
 TEST_F(ProxyTest, IsAvailableBlocking) {
-    std::shared_ptr<commonapi::tests::TestInterfaceStubDefault> stubDefault = std::make_shared<commonapi::tests::TestInterfaceStubDefault>();
-    std::shared_ptr<commonapi::tests::TestInterfaceDBusStubAdapter> stubAdapter =  std::make_shared<commonapi::tests::TestInterfaceDBusStubAdapter>(
-                    commonApiAddress,
-                    interfaceName,
-                    busName,
-                    objectPath,
-                    proxyDBusConnection_,
-                    stubDefault);
-
-    stubAdapter->init();
+    registerTestStub();
 
-    bool registered = proxyDBusConnection_->requestServiceNameAndBlock(busName);
-    bool isAvailable = proxy_->isAvailableBlocking();
-    EXPECT_EQ(registered, isAvailable);
+    const bool isAvailable = proxy_->isAvailableBlocking();
+    EXPECT_TRUE(isAvailable);
 }
 
 TEST_F(ProxyTest, HasNecessaryAttributesAndEvents) {