1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
10 package test
.Ice
.objects
;
12 import test
.Ice
.objects
.Test
.InitialPrx
;
14 public class Client
extends test
.Util
.Application
16 private static class MyObjectFactory
implements Ice
.ObjectFactory
18 public Ice
.Object
create(String type
)
20 if(type
.equals("::Test::B"))
24 else if(type
.equals("::Test::C"))
28 else if(type
.equals("::Test::D"))
32 else if(type
.equals("::Test::E"))
36 else if(type
.equals("::Test::F"))
40 else if(type
.equals("::Test::I"))
44 else if(type
.equals("::Test::J"))
48 else if(type
.equals("::Test::H"))
53 assert (false); // Should never be reached
63 public int run(String
[] args
)
65 Ice
.Communicator communicator
= communicator();
66 Ice
.ObjectFactory factory
= new MyObjectFactory();
67 communicator
.addObjectFactory(factory
, "::Test::B");
68 communicator
.addObjectFactory(factory
, "::Test::C");
69 communicator
.addObjectFactory(factory
, "::Test::D");
70 communicator
.addObjectFactory(factory
, "::Test::E");
71 communicator
.addObjectFactory(factory
, "::Test::F");
72 communicator
.addObjectFactory(factory
, "::Test::I");
73 communicator
.addObjectFactory(factory
, "::Test::J");
74 communicator
.addObjectFactory(factory
, "::Test::H");
76 InitialPrx initial
= AllTests
.allTests(communicator
, false, getWriter());
81 protected Ice
.InitializationData
getInitData(Ice
.StringSeqHolder argsH
)
83 Ice
.InitializationData initData
= new Ice
.InitializationData();
84 initData
.properties
= Ice
.Util
.createProperties(argsH
);
85 initData
.properties
.setProperty("Ice.Package.Test", "test.Ice.objects");
89 public static void main(String
[] args
)
91 Client app
= new Client();
92 int result
= app
.main("Client", args
);