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
.properties
;
12 public class Client
extends test
.Util
.Application
19 throw new RuntimeException();
23 class PropertiesClient
extends Ice
.Application
28 Ice
.Properties properties
= communicator().getProperties();
29 test(properties
.getProperty("Ice.Trace.Network").equals("1"));
30 test(properties
.getProperty("Ice.Trace.Protocol").equals("1"));
31 test(properties
.getProperty("Config.Path").equals(configPath
));
32 test(properties
.getProperty("Ice.ProgramName").equals("PropertiesClient"));
33 test(appName().equals(properties
.getProperty("Ice.ProgramName")));
38 public int run(String
[] args
)
40 System
.out
.print("testing load properties from UTF-8 path... ");
41 Ice
.InitializationData id
= new Ice
.InitializationData();
42 id
.properties
= Ice
.Util
.createProperties();
43 id
.properties
.load(configPath
);
44 test(id
.properties
.getProperty("Ice.Trace.Network").equals("1"));
45 test(id
.properties
.getProperty("Ice.Trace.Protocol").equals("1"));
46 test(id
.properties
.getProperty("Config.Path").equals(configPath
));
47 test(id
.properties
.getProperty("Ice.ProgramName").equals("PropertiesClient"));
48 System
.out
.println("ok");
49 System
.out
.print("testing load properties from UTF-8 path using Ice::Application... ");
50 PropertiesClient c
= new PropertiesClient();
51 c
.main("", args
, configPath
);
52 System
.out
.println("ok");
56 public static void main(String
[] args
)
58 Client c
= new Client();
59 int status
= c
.main("Client", args
);
64 private static String configPath
= "./config/\u4E2D\u56FD_client.config";