diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-10-21 15:47:07 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-10-21 15:47:07 -0700 |
commit | 439bbccae66fc9e41f10c8c73971abdf6821086f (patch) | |
tree | a5a338b49cb01820ac59dd6b30ee6ade8d74f557 /java | |
parent | Fixed Windows compile error (diff) | |
download | ice-439bbccae66fc9e41f10c8c73971abdf6821086f.tar.bz2 ice-439bbccae66fc9e41f10c8c73971abdf6821086f.tar.xz ice-439bbccae66fc9e41f10c8c73971abdf6821086f.zip |
- Implementing ConnectionInfo/EndpointInfo in PHP
- Changing test/Ice/info to use separate client & server
- Updating release notes for IceSSL ConnectionInfo
Diffstat (limited to 'java')
-rw-r--r-- | java/test/Ice/info/AllTests.java | 25 | ||||
-rw-r--r-- | java/test/Ice/info/Server.java | 40 | ||||
-rwxr-xr-x | java/test/Ice/info/run.py | 6 |
3 files changed, 52 insertions, 19 deletions
diff --git a/java/test/Ice/info/AllTests.java b/java/test/Ice/info/AllTests.java index 6b26d81abf2..e5750cf3b62 100644 --- a/java/test/Ice/info/AllTests.java +++ b/java/test/Ice/info/AllTests.java @@ -59,7 +59,7 @@ public class AllTests test(!udpEndpoint.compress); test(!udpEndpoint.secure()); test(udpEndpoint.datagram()); - test(udpEndpoint.type() == 3); + test(udpEndpoint.type() == Ice.UDPEndpointType.value); Ice.OpaqueEndpointInfo opaqueEndpoint = (Ice.OpaqueEndpointInfo)endps[2].getInfo(); } @@ -90,8 +90,8 @@ public class AllTests adapter.destroy(); - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -h * -p 12010"); - communicator.getProperties().setProperty("TestAdapter.PublishedEndpoints", "default -h 127.0.0.1 -p 12010"); + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -h * -p 12020"); + communicator.getProperties().setProperty("TestAdapter.PublishedEndpoints", "default -h 127.0.0.1 -p 12020"); adapter = communicator.createObjectAdapter("TestAdapter"); endpoints = adapter.getEndpoints(); @@ -102,24 +102,19 @@ public class AllTests for(Ice.Endpoint endpoint : endpoints) { ipEndpoint = (Ice.IPEndpointInfo)endpoint.getInfo(); - test(ipEndpoint.port == 12010); + test(ipEndpoint.port == 12020); } ipEndpoint = (Ice.IPEndpointInfo)publishedEndpoints[0].getInfo(); test(ipEndpoint.host.equals("127.0.0.1")); - test(ipEndpoint.port == 12010); + test(ipEndpoint.port == 12020); adapter.destroy(); } out.println("ok"); - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010"); - communicator.getProperties().setProperty("TestAdapter.PublishedEndpoints", ""); - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); - Ice.ObjectPrx base = adapter.addWithUUID(new TestI()).ice_collocationOptimized(false); - adapter.activate(); - - TestIntfPrx test = TestIntfPrxHelper.uncheckedCast(base); + Ice.ObjectPrx base = communicator.stringToProxy("test:default -p 12010:udp -p 12010"); + TestIntfPrx testIntf = TestIntfPrxHelper.checkedCast(base); out.print("test connection endpoint information... "); out.flush(); @@ -130,7 +125,7 @@ public class AllTests test(!ipinfo.compress); test(ipinfo.host.equals(defaultHost)); - java.util.Map<String, String> ctx = test.getEndpointInfoAsContext(); + java.util.Map<String, String> ctx = testIntf.getEndpointInfoAsContext(); test(ctx.get("host").equals(ipinfo.host)); test(ctx.get("compress").equals("false")); int port = Integer.parseInt(ctx.get("port")); @@ -153,7 +148,7 @@ public class AllTests test(info.remoteAddress.equals(defaultHost)); test(info.localAddress.equals(defaultHost)); - java.util.Map<String, String> ctx = test.getConnectionInfoAsContext(); + java.util.Map<String, String> ctx = testIntf.getConnectionInfoAsContext(); test(ctx.get("incoming").equals("true")); test(ctx.get("adapterName").equals("TestAdapter")); test(ctx.get("remoteAddress").equals(info.localAddress)); @@ -163,6 +158,8 @@ public class AllTests } out.println("ok"); + testIntf.shutdown(); + communicator.shutdown(); communicator.waitForShutdown(); } diff --git a/java/test/Ice/info/Server.java b/java/test/Ice/info/Server.java new file mode 100644 index 00000000000..e3403f951da --- /dev/null +++ b/java/test/Ice/info/Server.java @@ -0,0 +1,40 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 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. +// +// ********************************************************************** + +package test.Ice.info; + +public class Server extends test.Util.Application +{ + public int run(String[] args) + { + Ice.Communicator communicator = communicator(); + Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); + adapter.add(new TestI(), communicator.stringToIdentity("test")); + adapter.activate(); + return WAIT; + } + + protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH) + { + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(argsH); + initData.properties.setProperty("Ice.Package.Test", "test.Ice.proxy"); + initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010"); + initData.properties.setProperty("TestAdapter.PublishedEndpoints", ""); + return initData; + } + + public static void main(String[] args) + { + Server app = new Server(); + int result = app.main("Server", args); + System.gc(); + System.exit(result); + } +} diff --git a/java/test/Ice/info/run.py b/java/test/Ice/info/run.py index 4ebbde42d9a..56d48e628de 100755 --- a/java/test/Ice/info/run.py +++ b/java/test/Ice/info/run.py @@ -20,10 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0])) from scripts import * -print "starting client...", -clientProc = TestUtil.startClient("test.Ice.info.Client") -print "ok" - -clientProc.waitTestSuccess() +TestUtil.clientServerTest() TestUtil.cleanup() |