コード例 #1
0
        public override async Task RunAsync(string[] args)
        {
            var observer = new CommunicatorObserver();

            Dictionary <string, string> properties = CreateTestProperties(ref args);
            bool ice1 = false;

            if (properties.TryGetValue("Ice.Default.Protocol", out string?value))
            {
                ice1 = value == "ice1";
            }
            properties["Ice.Admin.Endpoints"]     = ice1 ? "tcp -h 127.0.0.1" : "ice+tcp://127.0.0.1:0";
            properties["Ice.Admin.InstanceName"]  = "client";
            properties["Ice.Admin.DelayCreation"] = "1";
            properties["Ice.Warn.Connections"]    = "0";
            properties["Ice.Warn.Dispatch"]       = "0";

            await using Communicator communicator = Initialize(properties, observer: observer);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("metrics", new Metrics());
            //adapter.activate(); // Don't activate OA to ensure collocation is used.

            IMetricsPrx metrics = AllTests.Run(this, observer);
            await metrics.ShutdownAsync();
        }
コード例 #2
0
        public override async Task RunAsync(string[] args)
        {
            await using Ice.Communicator communicator = Initialize(ref args);
            if (args.Length < 1)
            {
                throw new ArgumentException("Usage: client testdir");
            }

            IServerFactoryPrx factory;

            factory = AllTests.Run(this, args[0]);
            await factory.ShutdownAsync();
        }
コード例 #3
0
        public override async Task RunAsync(string[] args)
        {
            var observer = new CommunicatorObserver();

            Dictionary <string, string>?properties = CreateTestProperties(ref args);

            properties["Ice.Admin.Endpoints"]     = "tcp -h 127.0.0.1";
            properties["Ice.Admin.InstanceName"]  = "client";
            properties["Ice.Admin.DelayCreation"] = "1";
            properties["Ice.Warn.Connections"]    = "0";
            properties["Ice.ConnectTimeout"]      = "500ms";

            await using Communicator? communicator = Initialize(properties, observer: observer);
            IMetricsPrx metrics = AllTests.Run(this, observer);
            await metrics.ShutdownAsync();
        }
コード例 #4
0
        public override async Task RunAsync(string[] args)
        {
            var observer = new CommunicatorObserver();

            Dictionary <string, string> properties = CreateTestProperties(ref args);
            bool ice1 = GetTestProtocol(properties) == Protocol.Ice1;

            properties["Ice.Admin.Endpoints"]       = ice1 ? "tcp -h 127.0.0.1" : "ice+tcp://127.0.0.1:0";
            properties["Ice.Admin.InstanceName"]    = "client";
            properties["Ice.Warn.Connections"]      = "0";
            properties["Ice.ConnectTimeout"]        = "3s";
            properties["Ice.InvocationMaxAttempts"] = "2";

            await using Communicator? communicator = Initialize(properties, observer: observer);
            IMetricsPrx metrics = AllTests.Run(this, observer, colocated: false);
            await metrics.ShutdownAsync();
        }
コード例 #5
0
ファイル: Client.cs プロジェクト: cyyever/ice
        public override async Task RunAsync(string[] args)
        {
            Dictionary <string, string> properties = CreateTestProperties(ref args);

            // TODO: remove this when False is the communicator default
            properties["Ice.Default.PreferNonSecure"] = "False";
            await using Ice.Communicator communicator = Initialize(properties);
            if (args.Length < 1)
            {
                throw new ArgumentException("Usage: client testdir");
            }

            IServerFactoryPrx factory;

            factory = AllTests.Run(this, args[0]);
            await factory.ShutdownAsync();
        }
コード例 #6
0
        public override async Task RunAsync(string[] args)
        {
            var observer = new CommunicatorObserver();

            Dictionary <string, string> properties = CreateTestProperties(ref args);
            bool ice1 = GetTestProtocol(properties) == Protocol.Ice1;

            properties["Ice.Admin.Endpoints"]       = ice1 ? "tcp -h 127.0.0.1" : "ice+tcp://127.0.0.1:0";
            properties["Ice.Admin.InstanceName"]    = "colocated";
            properties["Ice.Warn.Connections"]      = "0";
            properties["Ice.Warn.Dispatch"]         = "0";
            properties["Ice.InvocationMaxAttempts"] = "2";

            await using Communicator communicator = Initialize(properties, observer: observer);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("metrics", new Metrics());
            // Don't activate OA to ensure collocation is used.

            IMetricsPrx metrics = AllTests.Run(this, observer, colocated: true);
            await metrics.ShutdownAsync();
        }
コード例 #7
0
ファイル: Client.cs プロジェクト: wubo2018/ice
 public override async Task RunAsync(string[] args)
 {
     await using Communicator communicator = Initialize(ref args);
     await AllTests.Run(this).ShutdownAsync();
 }