summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/proxy
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2018-01-31 17:21:12 +0100
committerBenoit Foucher <benoit@zeroc.com>2018-01-31 17:21:12 +0100
commitc3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f (patch)
treea02e199af243136b4dc4a83929e8c9a185c9dcd8 /csharp/test/Ice/proxy
parentUpdated AutoStart description (diff)
downloadice-c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f.tar.bz2
ice-c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f.tar.xz
ice-c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f.zip
Added support for ice_fixed, ice_getTimeout, ice_getCompress methods (ICE-7996 & ICE-7976)
Diffstat (limited to 'csharp/test/Ice/proxy')
-rw-r--r--csharp/test/Ice/proxy/AllTests.cs50
1 files changed, 47 insertions, 3 deletions
diff --git a/csharp/test/Ice/proxy/AllTests.cs b/csharp/test/Ice/proxy/AllTests.cs
index 07b38a31b9c..b06ef372225 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,37 @@ 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)
+ {
+ cl.ice_fixed(connection).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());
+ 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);
+ Ice.Connection fixedConnection = cl.ice_connectionId("ice_fixed").ice_getConnection();
+ test(cl.ice_fixed(connection).ice_fixed(fixedConnection).ice_getConnection() == fixedConnection);
+ }
+ 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);