diff dbus-d-javatests/dsrc/DBusTesting.d @ 4:427c0332a111

work on DBusTesting
author Frank Benoit <benoit@tionex.de>
date Sun, 21 Oct 2007 14:49:02 +0200
parents c8f7d77e4d4a
children 7c2c75740370
line wrap: on
line diff
--- a/dbus-d-javatests/dsrc/DBusTesting.d	Sat Oct 20 19:41:51 2007 +0200
+++ b/dbus-d-javatests/dsrc/DBusTesting.d	Sun Oct 21 14:49:02 2007 +0200
@@ -2,10 +2,31 @@
 module DBusTesting;
 
 import tango.sys.Environment;
+import tango.io.Stdout;
+import tango.core.Exception;
+
+import org.freedesktop.dbus.DBus;
 
 import DBusTestingGen;
 
+bool exceptionsActive = false;
+char[][] called;
+void checkCall( char[] name ){
+	called ~= name.dup;
+	if( exceptionsActive ){
+		throw new TracedException( "Test Exception thrown" );
+	}
+}
 
+class Dimpl : DBusInterface.dbustest.DImpl {
+	public void testV_V(){
+		checkCall( "testV_V" );
+	}
+	public int testI_I( in int arg1 ){
+		checkCall( "testI_I" );
+		return arg1 + 1234;
+	}
+}
 
 
 
@@ -13,16 +34,16 @@
 	
 	char[] address = Environment.get( "DBUS_ADDRESS" );
 	if( ! address ){
-	    Cout( "Environment variable DBUS_ADDRESS not set" ).newline;
+		Stdout.formatln( "Environment variable DBUS_ADDRESS not set" );
 		return 1;
 	}
-    Cout( "D-App started").newline;
-    DBus.DirectConnection dc = new DBus.DirectConnection( args[1] );
-    Cout("D-App connected").newline;
+    Stdout.formatln( "D-App started");
+    DirectConnection dc = new DirectConnection( args[1] );
+    Stdout.formatln("D-App connected");
 //    auto o = new MyDataFileSystem();
 //    o.registerDBusObject( dc.conn );
 //    Cout("Export obj : ")( o.getDBusInstanceName() ).newline;
     dc.mainLoop();
-    Cout("D-App disconnected").newline;
+    Stdout.formatln("D-App disconnected");
     return 0;
 }