diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-09-20 09:46:52 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-09-20 09:46:52 +0000 |
commit | 396de10e1cf954e8c879700f37730497fbdd341f (patch) | |
tree | b93342da5de2bcbae7159d96839cb5f032cf4bc7 /java/test/IceGrid/simple/Client.java | |
parent | added Makefile. (diff) | |
download | ice-396de10e1cf954e8c879700f37730497fbdd341f.tar.bz2 ice-396de10e1cf954e8c879700f37730497fbdd341f.tar.xz ice-396de10e1cf954e8c879700f37730497fbdd341f.zip |
Added IceGrid simple test.
Diffstat (limited to 'java/test/IceGrid/simple/Client.java')
-rw-r--r-- | java/test/IceGrid/simple/Client.java | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/java/test/IceGrid/simple/Client.java b/java/test/IceGrid/simple/Client.java new file mode 100644 index 00000000000..71bab6fdb99 --- /dev/null +++ b/java/test/IceGrid/simple/Client.java @@ -0,0 +1,79 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Test.*; + +public class Client +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + boolean withDeploy = false; + for(int i = 1; i < args.length; i++) + { + if(args[i].equals("--with-deploy")) + { + withDeploy = true; + break; + } + } + + TestIntfPrx obj; + + if(!withDeploy) + { + obj = AllTests.allTests(communicator); + } + else + { + obj = AllTests.allTestsWithDeploy(communicator); + } + + System.out.print("shutting down server... "); + System.out.flush(); + obj.shutdown(); + System.out.println("ok"); + + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + status = run(args, communicator); + } + catch (Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + + if (communicator != null) + { + try + { + communicator.destroy(); + } + catch (Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.gc(); + System.exit(status); + } +} |