diff options
Diffstat (limited to 'java/test/Ice/exceptions/Server.java')
-rw-r--r-- | java/test/Ice/exceptions/Server.java | 64 |
1 files changed, 21 insertions, 43 deletions
diff --git a/java/test/Ice/exceptions/Server.java b/java/test/Ice/exceptions/Server.java index 2f2d93e9561..ffbb1d690db 100644 --- a/java/test/Ice/exceptions/Server.java +++ b/java/test/Ice/exceptions/Server.java @@ -7,61 +7,39 @@ // // ********************************************************************** -public class Server +package test.Ice.exceptions; + +public class Server extends test.Util.Application { - private static int - run(String[] args, Ice.Communicator communicator) + public int run(String[] args) { - Ice.Properties properties = communicator.getProperties(); - // We don't need to disable warnings, because we have a dummy logger. - //properties.setProperty("Ice.Warn.Dispatch", "0"); - properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000:udp"); + Ice.Communicator communicator = communicator(); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); Ice.Object object = new ThrowerI(adapter); adapter.add(object, communicator.stringToIdentity("thrower")); adapter.activate(); - communicator.waitForShutdown(); - return 0; + return WAIT; } - public static void - main(String[] args) + protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - // - // For this test, we need a dummy logger, otherwise the - // assertion test will print an error message. - // - Ice.InitializationData initData = new Ice.InitializationData(); - initData.logger = new DummyLogger(); + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(argsH); + initData.logger = new DummyLogger(); - communicator = Ice.Util.initialize(args, initData); - status = run(args, communicator); - } - catch(Exception ex) - { - ex.printStackTrace(); - status = 1; - } + initData.properties.setProperty("Ice.Package.Test", "test.Ice.exceptions"); + initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000:udp"); + // We don't need to disable warnings, because we have a dummy logger. + // properties.setProperty("Ice.Warn.Dispatch", "0"); - if(communicator != null) - { - try - { - communicator.destroy(); - } - catch(Ice.LocalException ex) - { - ex.printStackTrace(); - status = 1; - } - } + return initData; + } + public static void main(String[] args) + { + Server app = new Server(); + int result = app.main("Server", args); System.gc(); - System.exit(status); + System.exit(result); } } |