Release v2.5.91
[platform/core/uifw/at-spi2-atk.git] / droute / droute-test.c
index 8b3fb7c..a2ebe4d 100644 (file)
@@ -4,7 +4,7 @@
 #include <droute/droute.h>
 #include <dbind/dbind.h>
 
-#include "dbus/dbus-glib-lowlevel.h"
+#include "atspi/atspi.h"
 
 #define TEST_OBJECT_PATH    "/test/object"
 #define TEST_INTERFACE_ONE  "test.interface.One"
 #define OBJECT_ONE "ObjectOne";
 #define OBJECT_TWO "ObjectTwo";
 
-#if !defined TEST_INTROSPECTION_DIRECTORY
-    #error "No introspection XML directory defined"
-#endif
-
 #define STRING_ONE "StringOne"
 #define STRING_TWO "StringTwo"
 
 
 #define NONE_REPLY_STRING "NoneMethod"
 
+const gchar *test_interface_One = \
+"<interface name=\"test.interface.One\">"
+"  <method name=\"null\"/>"
+"  <method name=\"getInt\">"
+"    <arg direction=\"out\" type=\"o\"/>"
+"  </method>"
+"  <method name=\"setInt\">"
+"    <arg direction=\"in\" type=\"o\"/>"
+"  </method>"
+"  <method name=\"getString\">"
+"    <arg direction=\"out\" type=\"s\"/>"
+"  </method>"
+"  <method name=\"setString\">"
+"    <arg direction=\"in\" type=\"s\"/>"
+"  </method>"
+"</interface>";
+
+const gchar *test_interface_Two = \
+"<interface name=\"test.interface.One\">"
+"  <method name=\"null\"/>"
+"  <method name=\"getInt\">"
+"    <arg direction=\"out\" type=\"o\"/>"
+"  </method>"
+"  <method name=\"setInt\">"
+"    <arg direction=\"in\" type=\"o\"/>"
+"  </method>"
+"  <method name=\"getString\">"
+"    <arg direction=\"out\" type=\"s\"/>"
+"  </method>"
+"  <method name=\"setString\">"
+"    <arg direction=\"in\" type=\"s\"/>"
+"  </method>"
+"</interface>";
+
 typedef struct _AnObject
 {
     gchar *astring;
@@ -219,23 +249,25 @@ int main (int argc, char **argv)
     dbus_error_init (&error);
     main_loop = g_main_loop_new(NULL, FALSE);
     bus = dbus_bus_get (DBUS_BUS_SESSION, &error);
-    dbus_connection_setup_with_g_main(bus, g_main_context_default());
+    atspi_dbus_connection_setup_with_g_main(bus, g_main_context_default());
 
-    cnx = droute_new (bus, TEST_INTROSPECTION_DIRECTORY);
+    cnx = droute_new (bus);
     path = droute_add_one (cnx, TEST_OBJECT_PATH, object);
 
     droute_path_add_interface (path,
                                TEST_INTERFACE_ONE,
+                               test_interface_One,
                                test_methods_one,
                                test_properties);
 
     droute_path_add_interface (path,
                                TEST_INTERFACE_TWO,
+                               test_interface_Two,
                                test_methods_two,
                                test_properties);
 
     g_idle_add (do_tests_func, NULL);
-    g_main_run(main_loop);
+    g_main_loop_run(main_loop);
     if (success)
             return 0;
     else