diff options
author | Stefan Laner <laner@itestra.de> | 2013-11-14 02:09:54 +0100 |
---|---|---|
committer | Stefan Laner <laner@itestra.de> | 2013-11-14 02:11:56 +0100 |
commit | f6eda262a1040205f7a6cbe6f9eac8b0f7cfa5fc (patch) | |
tree | ba819df920289595512b1d112ca836c5bd2658a7 /src/test/DBusCommunicationTest.cpp | |
parent | 1ba1a4cdac9b6821d285cb685da65fdbc68a5c66 (diff) | |
download | genivi-common-api-dbus-runtime-f6eda262a1040205f7a6cbe6f9eac8b0f7cfa5fc.tar.gz |
Fixed interfaceVersion attribute and added test for that
Diffstat (limited to 'src/test/DBusCommunicationTest.cpp')
-rw-r--r-- | src/test/DBusCommunicationTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/DBusCommunicationTest.cpp b/src/test/DBusCommunicationTest.cpp index 4f4bb06..d27d82c 100644 --- a/src/test/DBusCommunicationTest.cpp +++ b/src/test/DBusCommunicationTest.cpp @@ -215,6 +215,30 @@ TEST_F(DBusCommunicationTest, RemoteMethodCallHeavyLoad) { servicePublisher_->unregisterService(serviceAddress4_); } +TEST_F(DBusCommunicationTest, ProxyCanFetchVersionAttributeFromStub) { + auto defaultTestProxy = proxyFactory_->buildProxy<commonapi::tests::TestInterfaceProxy>(serviceAddress4_); + ASSERT_TRUE((bool)defaultTestProxy); + + auto stub = std::make_shared<commonapi::tests::TestInterfaceStubDefault>(); + + bool serviceRegistered = servicePublisher_->registerService(stub, serviceAddress4_, stubFactory_); + + ASSERT_TRUE(serviceRegistered); + + for (unsigned int i = 0; !defaultTestProxy->isAvailable() && i < 100; ++i) { + usleep(10000); + } + ASSERT_TRUE(defaultTestProxy->isAvailable()); + + CommonAPI::InterfaceVersionAttribute& versionAttribute = defaultTestProxy->getInterfaceVersionAttribute(); + + CommonAPI::Version version; + CommonAPI::CallStatus status; + versionAttribute.getValue(status, version); + ASSERT_EQ(CommonAPI::CallStatus::SUCCESS, status); + ASSERT_TRUE(version.Major > 0 || version.Minor > 0); +} + //XXX This test case requires CommonAPI::DBus::DBusConnection::suspendDispatching and ...::resumeDispatching to be public! |