~thomas-voss/dbus-cpp/refactor-core-dbus-object

« back to all changes in this revision

Viewing changes to tests/service_watcher_test.cpp

  • Committer: thomas-voss
  • Date: 2014-04-02 19:50:44 UTC
  • Revision ID: thomas.voss@canonical.com-20140402195044-smlwkv1o7g4znxan
First cut at making core::dbus::Message an interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
        auto bus = session_bus();
73
73
        bus->install_executor(core::dbus::asio::make_executor(bus));
74
 
        auto service_tiny = dbus::Service::add_service<test::ServiceTiny>(bus);
75
 
        auto service = dbus::Service::add_service<test::Service>(bus);
 
74
        auto service_tiny = dbus::Service::Skeleton::create<test::ServiceTiny>(
 
75
                    bus,
 
76
                    dbus::Bus::RequestNameFlag::replace_existing | dbus::Bus::RequestNameFlag::do_not_queue);
76
77
 
77
78
        std::thread t{[bus](){ bus->run(); }};
78
79
 
96
97
        dbus::DBus daemon(bus);
97
98
        dbus::ServiceWatcher::Ptr service_watcher(
98
99
                daemon.make_service_watcher(
99
 
                        dbus::traits::Service<test::Service>::interface_name(),
 
100
                        dbus::traits::Service<test::ServiceTiny>::interface_name(),
100
101
                        dbus::DBus::WatchMode::registration));
101
102
 
102
103
        std::vector<std::pair<std::string, std::string>> owner_changed;
151
152
                              std::chrono::milliseconds{500}));
152
153
 
153
154
        // We just let this be destroyed immediately
154
 
        dbus::Service::add_service<test::ServiceTiny>(bus);
 
155
        dbus::Service::Skeleton::create<test::ServiceTiny>(
 
156
                    bus,
 
157
                    dbus::Bus::RequestNameFlag::replace_existing | dbus::Bus::RequestNameFlag::do_not_queue);
155
158
 
156
159
        std::thread t{[bus](){ bus->run(); }};
157
160