1
1
// **********************************************************************
3
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
5
5
// This copy of Ice is licensed to you under the terms described in the
6
6
// ICE_LICENSE file included in this distribution.
8
8
// **********************************************************************
10
package test.Ice.exceptions;
12
public class Server extends test.Util.Application
13
run(String[] args, Ice.Communicator communicator)
14
public int run(String[] args)
15
Ice.Properties properties = communicator.getProperties();
16
// We don't need to disable warnings, because we have a dummy logger.
17
//properties.setProperty("Ice.Warn.Dispatch", "0");
18
properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000:udp");
16
Ice.Communicator communicator = communicator();
19
17
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
20
Ice.Object object = new ThrowerI(adapter);
18
Ice.Object object = new ThrowerI();
21
19
adapter.add(object, communicator.stringToIdentity("thrower"));
22
20
adapter.activate();
23
communicator.waitForShutdown();
31
Ice.Communicator communicator = null;
36
// For this test, we need a dummy logger, otherwise the
37
// assertion test will print an error message.
39
Ice.InitializationData initData = new Ice.InitializationData();
40
initData.logger = new DummyLogger();
42
communicator = Ice.Util.initialize(args, initData);
43
status = run(args, communicator);
51
if(communicator != null)
55
communicator.destroy();
57
catch(Ice.LocalException ex)
24
protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
26
Ice.InitializationData initData = new Ice.InitializationData();
27
initData.properties = Ice.Util.createProperties(argsH);
28
initData.logger = new DummyLogger();
30
initData.properties.setProperty("Ice.Package.Test", "test.Ice.exceptions");
31
initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
32
// We don't need to disable warnings, because we have a dummy logger.
33
// properties.setProperty("Ice.Warn.Dispatch", "0");
38
public static void main(String[] args)
40
Server app = new Server();
41
int result = app.main("Server", args);