};
void DBusConnection::dispatch(std::shared_ptr<DBusConnection>* selfReference) {
-//void DBusConnection::dispatch() {
- //auto selfReference = this->shared_from_this();
while (!stopDispatching_ && readWriteDispatch(10) && !selfReference->unique()) {
if(pauseDispatching_) {
dispatchSuspendLock_.lock();
auto defaultTestProxy = proxyFactory->buildProxy<commonapi::tests::TestInterfaceProxy>("local:commonapi.tests.TestInterface:commonapi.tests.TestInterface");
ASSERT_TRUE((bool)defaultTestProxy);
}
-#ifndef WIN32
+
+
TEST_F(DBusProxyFactoryTest, CreatesDefaultExtendedTestProxy) {
std::shared_ptr<CommonAPI::Factory> proxyFactory = runtime_->createFactory();
ASSERT_TRUE((bool)proxyFactory);
auto attributeExtension = specificAttributeExtendedTestProxy->getTestDerivedArrayAttributeAttributeExtension();
ASSERT_TRUE(attributeExtension.testExtensionMethod());
}
-#endif // !WIN32
TEST_F(DBusProxyFactoryTest, HandlesRegistrationOfStubAdapters) {
std::shared_ptr<CommonAPI::Factory> proxyFactory = runtime_->createFactory();
const std::string serviceAddress = "local:commonapi.tests.TestInterface:commonapi.tests.TestInterface";
class DBusMultipleConnectionTest: public ::testing::Test {
- protected:
+protected:
virtual void SetUp() {
proxyFactory = CommonAPI::Runtime::load()->createFactory();
stubFactory = CommonAPI::Runtime::load()->createFactory();
stub = std::make_shared<commonapi::tests::TestInterfaceStubDefault>();
bool serviceNameAcquired = stubFactory->registerService(stub, serviceAddress);
- for(unsigned int i = 0; !serviceNameAcquired && i < 100; i++) {
+ for (unsigned int i = 0; !serviceNameAcquired && i < 100; i++) {
usleep(10000);
serviceNameAcquired = stubFactory->registerService(stub, serviceAddress);
}
proxy = proxyFactory->buildProxy<commonapi::tests::TestInterfaceProxy>(serviceAddress);
ASSERT_TRUE((bool)proxy);
- for(unsigned int i = 0; !proxy->isAvailable() && i < 100; ++i) {
+ for (unsigned int i = 0; !proxy->isAvailable() && i < 100; ++i) {
usleep(10000);
}
}
virtual void TearDown() {
- stubFactory->unregisterService(serviceAddress);
- usleep(30000);
+ stubFactory->unregisterService(serviceAddress);
+ usleep(30000);
}
std::shared_ptr<CommonAPI::Factory> proxyFactory;
std::shared_ptr<CommonAPI::Factory> stubFactory;
std::shared_ptr<commonapi::tests::TestInterfaceStubDefault> stub;
- std::shared_ptr<commonapi::tests::TestInterfaceProxy<> > proxy;
-
+ std::shared_ptr<commonapi::tests::TestInterfaceProxyDefault> proxy;
};
-
TEST_F(DBusMultipleConnectionTest, RemoteMethodCall) {
uint32_t v1 = 5;
std::string v2 = "Hai :)";
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
-#endif
\ No newline at end of file
+#endif
std::shared_ptr<TestInterfaceProxyBase> delegate_;
};
+#ifdef WIN32
+ typedef TestInterfaceProxy<CommonAPI::WINDummyAttributeExtension<CommonAPI::WINDummyAttribute>> TestInterfaceProxyDefault;
+#else
+ typedef TestInterfaceProxy<> TestInterfaceProxyDefault;
+#endif
+
namespace TestInterfaceExtensions {
template <template <typename > class _ExtensionType>
class TestPredefinedTypeAttributeAttributeExtension {
template <typename ... _AttributeExtensions>
TestInterfaceProxy<_AttributeExtensions...>::TestInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
delegate_(std::dynamic_pointer_cast<TestInterfaceProxyBase>(delegate))
-#ifndef WIN32
, _AttributeExtensions(*(std::dynamic_pointer_cast<TestInterfaceProxyBase>(delegate)))...
-#endif
{ }
template <typename ... _AttributeExtensions>