summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/proxy
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-02-05 08:34:31 +0100
committerJose <jose@zeroc.com>2018-02-05 08:34:31 +0100
commit5b1531275cc5553cc728eecbfa91a89fcd9305b3 (patch)
tree2f98bbd478344806766d1322155ee5a4f5e2794b /csharp/test/Ice/proxy
parentFixes to support zeroc.icebuilder.msbuild tasks (diff)
parentFixed PHP array initialization in test proxy client (diff)
downloadice-5b1531275cc5553cc728eecbfa91a89fcd9305b3.tar.bz2
ice-5b1531275cc5553cc728eecbfa91a89fcd9305b3.tar.xz
ice-5b1531275cc5553cc728eecbfa91a89fcd9305b3.zip
Merge remote-tracking branch 'origin/3.7' into netcore
Diffstat (limited to 'csharp/test/Ice/proxy')
-rw-r--r--csharp/test/Ice/proxy/AllTests.cs73
1 files changed, 70 insertions, 3 deletions
diff --git a/csharp/test/Ice/proxy/AllTests.cs b/csharp/test/Ice/proxy/AllTests.cs
index 07b38a31b9c..456004f8f6a 100644
--- a/csharp/test/Ice/proxy/AllTests.cs
+++ b/csharp/test/Ice/proxy/AllTests.cs
@@ -711,9 +711,17 @@ public class AllTests : TestCommon.AllTests
test(compObj.ice_compress(true).Equals(compObj.ice_compress(true)));
test(!compObj.ice_compress(false).Equals(compObj.ice_compress(true)));
+ test(!compObj.ice_getCompress().HasValue);
+ test(compObj.ice_compress(true).ice_getCompress().Value == true);
+ test(compObj.ice_compress(false).ice_getCompress().Value == false);
+
test(compObj.ice_timeout(20).Equals(compObj.ice_timeout(20)));
test(!compObj.ice_timeout(10).Equals(compObj.ice_timeout(20)));
+ test(!compObj.ice_getTimeout().HasValue);
+ test(compObj.ice_timeout(10).ice_getTimeout().Value == 10);
+ test(compObj.ice_timeout(20).ice_getTimeout().Value == 20);
+
Ice.LocatorPrx loc1 = Ice.LocatorPrxHelper.uncheckedCast(communicator.stringToProxy("loc1:default -p 10000"));
Ice.LocatorPrx loc2 = Ice.LocatorPrxHelper.uncheckedCast(communicator.stringToProxy("loc2:default -p 10000"));
test(compObj.ice_locator(null).Equals(compObj.ice_locator(null)));
@@ -766,9 +774,14 @@ public class AllTests : TestCommon.AllTests
test(!endpts1[0].Equals(endpts2[0]));
test(endpts1[0].Equals(communicator.stringToProxy("foo:tcp -h 127.0.0.1 -p 10000").ice_getEndpoints()[0]));
- //
- // TODO: Ideally we should also test comparison of fixed proxies.
- //
+ Ice.Connection baseConnection = baseProxy.ice_getConnection();
+ if(baseConnection != null)
+ {
+ Ice.Connection baseConnection2 = baseProxy.ice_connectionId("base2").ice_getConnection();
+ compObj1 = compObj1.ice_fixed(baseConnection);
+ compObj2 = compObj2.ice_fixed(baseConnection2);
+ test(!compObj1.Equals(compObj2));
+ }
WriteLine("ok");
Write("testing checked cast... ");
@@ -796,6 +809,60 @@ public class AllTests : TestCommon.AllTests
test(Ice.CollectionComparer.Equals(c, c2));
WriteLine("ok");
+ Write("testing ice_fixed... ");
+ Flush();
+ {
+ Ice.Connection connection = cl.ice_getConnection();
+ if(connection != null)
+ {
+ Test.MyClassPrx prx = (Test.MyClassPrx)cl.ice_fixed(connection);
+ prx.ice_ping();
+ test(cl.ice_secure(true).ice_fixed(connection).ice_isSecure());
+ test(cl.ice_facet("facet").ice_fixed(connection).ice_getFacet().Equals("facet"));
+ test(cl.ice_oneway().ice_fixed(connection).ice_isOneway());
+ Dictionary<string, string> ctx = new Dictionary<string, string>();
+ ctx["one"] = "hello";
+ ctx["two"] = "world";
+ test(cl.ice_fixed(connection).ice_getContext().Count == 0);
+ test(cl.ice_context(ctx).ice_fixed(connection).ice_getContext().Count == 2);
+ test(cl.ice_fixed(connection).ice_getInvocationTimeout() == -1);
+ test(cl.ice_invocationTimeout(10).ice_fixed(connection).ice_getInvocationTimeout() == 10);
+ test(cl.ice_fixed(connection).ice_getConnection() == connection);
+ test(cl.ice_fixed(connection).ice_fixed(connection).ice_getConnection() == connection);
+ test(!cl.ice_fixed(connection).ice_getTimeout().HasValue);
+ test(cl.ice_compress(true).ice_fixed(connection).ice_getCompress().Value);
+ Ice.Connection fixedConnection = cl.ice_connectionId("ice_fixed").ice_getConnection();
+ test(cl.ice_fixed(connection).ice_fixed(fixedConnection).ice_getConnection() == fixedConnection);
+ try
+ {
+ cl.ice_secure(!connection.getEndpoint().getInfo().secure()).ice_fixed(connection).ice_ping();
+ }
+ catch(Ice.NoEndpointException)
+ {
+ }
+ try
+ {
+ cl.ice_datagram().ice_fixed(connection).ice_ping();
+ }
+ catch(Ice.NoEndpointException)
+ {
+ }
+ }
+ else
+ {
+ try
+ {
+ cl.ice_fixed(connection);
+ test(false);
+ }
+ catch(ArgumentException)
+ {
+ // Expected with null connection.
+ }
+ }
+ }
+ WriteLine("ok");
+
Write("testing encoding versioning... ");
Flush();
string ref20 = "test -e 2.0:" + app.getTestEndpoint(0);