Mercurial > projects > dbus-d
view 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 source
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; } } int main(char[][] args) { char[] address = Environment.get( "DBUS_ADDRESS" ); if( ! address ){ Stdout.formatln( "Environment variable DBUS_ADDRESS not set" ); return 1; } 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(); Stdout.formatln("D-App disconnected"); return 0; }