示例#1
0
    public static void allTests(Test.TestHelper helper)
    {
        Ice.Communicator communicator = helper.communicator();
        string           sref         = "test:" + helper.getTestEndpoint(0);
        var obj = IObjectPrx.Parse(sref, communicator);

        test(obj != null);

        int proxyPort = communicator.Properties.getPropertyAsInt("Ice.HTTPProxyPort");

        if (proxyPort == 0)
        {
            proxyPort = communicator.Properties.getPropertyAsInt("Ice.SOCKSProxyPort");
        }

        Test.TestIntfPrx testPrx = Test.TestIntfPrx.CheckedCast(obj);
        var output = helper.getWriter();

        output.Write("testing connection... ");
        output.Flush();
        {
            testPrx.IcePing();
        }
        output.WriteLine("ok");

        output.Write("testing connection information... ");
        output.Flush();
        {
            Ice.IPConnectionInfo info = getIPConnectionInfo(testPrx.GetConnection().getInfo());
            test(info.remotePort == proxyPort); // make sure we are connected to the proxy port.
        }
        output.WriteLine("ok");

        output.Write("shutting down server... ");
        output.Flush();
        {
            testPrx.shutdown();
        }
        output.WriteLine("ok");

        output.Write("testing connection failure... ");
        output.Flush();
        {
            try
            {
                testPrx.IcePing();
                test(false);
            }
            catch (Ice.LocalException)
            {
            }
        }
        output.WriteLine("ok");
    }
示例#2
0
文件: AllTests.cs 项目: motuii/ice
 public override void runTestCase(Test.RemoteObjectAdapterPrx adapter, Test.TestIntfPrx proxy)
 {
     proxy.startHeartbeatCount();
     Ice.Connection con = proxy.GetConnection();
     con.heartbeat();
     con.heartbeat();
     con.heartbeat();
     con.heartbeat();
     con.heartbeat();
     proxy.waitForHeartbeatCount(5);
 }