summaryrefslogtreecommitdiff
path: root/java/test/Ice/dispatcher/Client.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2011-05-02 19:33:59 -0700
committerMark Spruiell <mes@zeroc.com>2011-05-02 19:33:59 -0700
commit29fa72f67e9eceebc765d7cbc997a4626797d9b5 (patch)
tree239719dc3ff622d4b3225aa2414bd90091b60357 /java/test/Ice/dispatcher/Client.java
parentupdates for PHP 5.3.6 (diff)
downloadice-29fa72f67e9eceebc765d7cbc997a4626797d9b5.tar.bz2
ice-29fa72f67e9eceebc765d7cbc997a4626797d9b5.tar.xz
ice-29fa72f67e9eceebc765d7cbc997a4626797d9b5.zip
bug 5002 - fixing several Java tests for Android compatibility
Diffstat (limited to 'java/test/Ice/dispatcher/Client.java')
-rw-r--r--java/test/Ice/dispatcher/Client.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/java/test/Ice/dispatcher/Client.java b/java/test/Ice/dispatcher/Client.java
index 67ce0ac07e9..34252606782 100644
--- a/java/test/Ice/dispatcher/Client.java
+++ b/java/test/Ice/dispatcher/Client.java
@@ -13,16 +13,19 @@ public class Client extends test.Util.Application
{
public int run(String[] args)
{
- AllTests.allTests(communicator(), getWriter());
+ AllTests.allTests(communicator(), getWriter(), _dispatcher);
+ _dispatcher.terminate();
return 0;
}
protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
{
+ assert(_dispatcher == null);
+ _dispatcher = new Dispatcher();
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties(argsH);
initData.properties.setProperty("Ice.Package.Test", "test.Ice.dispatcher");
- initData.dispatcher = new Dispatcher();
+ initData.dispatcher = _dispatcher;
return initData;
}
@@ -30,8 +33,15 @@ public class Client extends test.Util.Application
{
Client app = new Client();
int result = app.main("Client", args);
- Dispatcher.terminate();
System.gc();
System.exit(result);
}
+
+ //
+ // The Dispatcher class uses a static "_instance" member in other language
+ // mappings. In Java, we avoid the use of static members because we need to
+ // maintain support for Android (in which the client and server run in the
+ // same process).
+ //
+ private Dispatcher _dispatcher;
}