Ejemplo n.º 1
0
 /// <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();
 }
Ejemplo n.º 2
0
 public virtual void TearDown()
 {
     if (proxy != null)
     {
         RPC.StopProxy(proxy.GetProxy());
         proxy = null;
     }
     if (server != null)
     {
         server.Stop();
         server = null;
     }
 }
Ejemplo n.º 3
0
 public virtual void TestVersion0ClientVersion1Server()
 {
     // old client vs new server
     // create a server with two handlers
     TestRPCCompatibility.TestImpl1 impl = new TestRPCCompatibility.TestImpl1();
     server = new RPC.Builder(conf).SetProtocol(typeof(TestRPCCompatibility.TestProtocol1
                                                       )).SetInstance(impl).SetBindAddress(Address).SetPort(0).SetNumHandlers(2).SetVerbose
                  (false).Build();
     server.AddProtocol(RPC.RpcKind.RpcWritable, typeof(TestRPCCompatibility.TestProtocol0
                                                        ), impl);
     server.Start();
     addr  = NetUtils.GetConnectAddress(server);
     proxy = RPC.GetProtocolProxy <TestRPCCompatibility.TestProtocol0>(TestRPCCompatibility.TestProtocol0
                                                                       .versionID, addr, conf);
     TestRPCCompatibility.TestProtocol0 proxy0 = (TestRPCCompatibility.TestProtocol0)proxy
                                                 .GetProxy();
     proxy0.Ping();
 }
Ejemplo n.º 4
0
 public virtual void TestVersion1ClientVersion0Server()
 {
     // old client vs new server
     // create a server with two handlers
     server = new RPC.Builder(conf).SetProtocol(typeof(TestRPCCompatibility.TestProtocol0
                                                       )).SetInstance(new TestRPCCompatibility.TestImpl0()).SetBindAddress(Address).SetPort
                  (0).SetNumHandlers(2).SetVerbose(false).Build();
     server.Start();
     addr  = NetUtils.GetConnectAddress(server);
     proxy = RPC.GetProtocolProxy <TestRPCCompatibility.TestProtocol1>(TestRPCCompatibility.TestProtocol1
                                                                       .versionID, addr, conf);
     TestRPCCompatibility.TestProtocol1 proxy1 = (TestRPCCompatibility.TestProtocol1)proxy
                                                 .GetProxy();
     proxy1.Ping();
     try
     {
         proxy1.Echo("hello");
         NUnit.Framework.Assert.Fail("Echo should fail");
     }
     catch (IOException)
     {
     }
 }