summaryrefslogtreecommitdiff
path: root/java/test/Ice/operations/Client.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2009-03-24 12:31:31 -0230
committerMatthew Newhook <matthew@zeroc.com>2009-03-24 12:31:31 -0230
commit4cc5d77c383b6c91c3af9fe44df9687bb9b15580 (patch)
tree64ce3d6cf35b15497de50f298f7225a8c72f64b6 /java/test/Ice/operations/Client.java
parentMerge commit 'origin/R3_3_branch' (diff)
downloadice-4cc5d77c383b6c91c3af9fe44df9687bb9b15580.tar.bz2
ice-4cc5d77c383b6c91c3af9fe44df9687bb9b15580.tar.xz
ice-4cc5d77c383b6c91c3af9fe44df9687bb9b15580.zip
Merged android-testsuite branch.
Diffstat (limited to 'java/test/Ice/operations/Client.java')
-rw-r--r--java/test/Ice/operations/Client.java80
1 files changed, 29 insertions, 51 deletions
diff --git a/java/test/Ice/operations/Client.java b/java/test/Ice/operations/Client.java
index 8b57a5c4189..5c55b5e7a6a 100644
--- a/java/test/Ice/operations/Client.java
+++ b/java/test/Ice/operations/Client.java
@@ -7,15 +7,19 @@
//
// **********************************************************************
-public class Client
+package test.Ice.operations;
+
+import test.Ice.operations.Test.MyClassPrx;
+
+public class Client extends test.Util.Application
{
- private static int
- run(String[] args, Ice.Communicator communicator)
+ public int run(String[] args)
{
- Test.MyClassPrx myClass = AllTests.allTests(communicator, false);
+ java.io.PrintWriter out = getWriter();
+ MyClassPrx myClass = AllTests.allTests(this, false, out);
- System.out.print("testing server shutdown... ");
- System.out.flush();
+ out.print("testing server shutdown... ");
+ out.flush();
myClass.shutdown();
try
{
@@ -24,58 +28,32 @@ public class Client
}
catch(Ice.LocalException ex)
{
- System.out.println("ok");
+ out.println("ok");
}
return 0;
}
- public static void
- main(String[] args)
+ protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
{
- int status = 0;
- Ice.Communicator communicator = null;
-
- try
- {
- //
- // In this test, we need at least two threads in the
- // client side thread pool for nested AMI.
- //
- Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args);
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(argsH);
- initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
- initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
-
- //
- // We must set MessageSizeMax to an explicit values,
- // because we run tests to check whether
- // Ice.MemoryLimitException is raised as expected.
- //
- initData.properties.setProperty("Ice.MessageSizeMax", "100");
-
- communicator = Ice.Util.initialize(argsH, initData);
- status = run(argsH.value, communicator);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- status = 1;
- }
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
+ initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
+ initData.properties.setProperty("Ice.Package.Test", "test.Ice.operations");
+ //
+ // We must set MessageSizeMax to an explicit values,
+ // because we run tests to check whether
+ // Ice.MemoryLimitException is raised as expected.
+ //
+ initData.properties.setProperty("Ice.MessageSizeMax", "100");
+ return initData;
+ }
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- ex.printStackTrace();
- status = 1;
- }
- }
+ public static void main(String[] args)
+ {
+ Client c = new Client();
+ int status = c.main("Client", args);
System.gc();
System.exit(status);