/// <exception cref="System.IO.IOException"/> private Version2Client(TestRPCCompatibility _enclosing) { this._enclosing = _enclosing; this.serverInfo = RPC.GetProtocolProxy <TestRPCCompatibility.TestProtocol2>(TestRPCCompatibility.TestProtocol2 .versionID, TestRPCCompatibility.addr, TestRPCCompatibility.conf); this.proxy2 = this.serverInfo.GetProxy(); }
public virtual void TestIsMethodSupported() { server = new RPC.Builder(conf).SetProtocol(typeof(TestRPCCompatibility.TestProtocol2 )).SetInstance(new TestRPCCompatibility.TestImpl2()).SetBindAddress(Address).SetPort (0).SetNumHandlers(2).SetVerbose(false).Build(); server.Start(); addr = NetUtils.GetConnectAddress(server); TestRPCCompatibility.TestProtocol2 proxy = RPC.GetProxy <TestRPCCompatibility.TestProtocol2 >(TestRPCCompatibility.TestProtocol2.versionID, addr, conf); bool supported = RpcClientUtil.IsMethodSupported(proxy, typeof(TestRPCCompatibility.TestProtocol2 ), RPC.RpcKind.RpcWritable, RPC.GetProtocolVersion(typeof(TestRPCCompatibility.TestProtocol2 )), "echo"); Assert.True(supported); supported = RpcClientUtil.IsMethodSupported(proxy, typeof(TestRPCCompatibility.TestProtocol2 ), RPC.RpcKind.RpcProtocolBuffer, RPC.GetProtocolVersion(typeof(TestRPCCompatibility.TestProtocol2 )), "echo"); NUnit.Framework.Assert.IsFalse(supported); }