예제 #1
0
        public override async Task RunAsync(string[] args)
        {
            var properties = CreateTestProperties(ref args);

            properties["Ice.Warn.Dispatch"]       = "0";
            await using Communicator communicator = Initialize(properties);
            await communicator.ActivateAsync();

            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("initial", new Initial(adapter));
            adapter.Add("F21", new F2());
            var uoet = new UnexpectedObjectExceptionTest();

            adapter.Add("uoet", uoet);
            AllTests.Run(this);
        }
예제 #2
0
        public override void run(string[] args)
        {
            var properties = createTestProperties(ref args);

            properties["Ice.Warn.Dispatch"] = "0";
            using var communicator          = initialize(properties, typeIdNamespaces: new string[] { "Ice.objects.TypeId" });
            communicator.SetProperty("TestAdapter.Endpoints", getTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add(new Initial(adapter), "initial");
            adapter.Add(new F2(), "F21");
            var uoet = new UnexpectedObjectExceptionTest();

            adapter.Add(uoet.Dispatch, "uoet");
            adapter.Activate();
            serverReady();
            communicator.WaitForShutdown();
        }
예제 #3
0
        public override async Task RunAsync(string[] args)
        {
            await using Communicator communicator = Initialize(ref args,
                                                               new Dictionary <string, string>()
            {
                ["Ice.CompressionMinSize"] = "1K"
            });
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test-1", new Interceptor(new TestIntf(), compressed: true));
            adapter.Add("test-2", new Interceptor(new TestIntf(), compressed: false));

            await adapter.ActivateAsync();

            ServerReady();
            await communicator.WaitForShutdownAsync();
        }
예제 #4
0
파일: Collocated.cs 프로젝트: yuwenyong/ice
        public override void Run(string[] args)
        {
            using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("initial", new InitialI(adapter));
            AllTests.allTests(this);
        }
예제 #5
0
        public override void Run(string[] args)
        {
            using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            var           d       = new D();

            adapter.Add("d", d);
            adapter.Add("d", "facetABCD", d);
            var f = new F();

            adapter.Add("d", "facetEF", f);
            var h = new H(communicator);

            adapter.Add("d", "facetGH", h);
            adapter.Activate();
            ServerReady();
            communicator.WaitForShutdown();
        }
예제 #6
0
        public override void run(string[] args)
        {
            using var communicator = initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", getTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            var           d       = new D();

            adapter.Add(d, "d");
            adapter.Add(d, "d", "facetABCD");
            var f = new F();

            adapter.Add(f, "d", "facetEF");
            var h = new H(communicator);

            adapter.Add(h, "d", "facetGH");
            adapter.Activate();
            serverReady();
            communicator.WaitForShutdown();
        }
예제 #7
0
파일: Collocated.cs 프로젝트: yuweiApp/ice
        public override void Run(string[] args)
        {
            using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new MyClass());
            //adapter.activate(); // Don't activate OA to ensure collocation is used.
            AllTests.allTests(this, true);
        }
예제 #8
0
            public override void run(string[] args)
            {
                var initData = new InitializationData();

                initData.typeIdNamespaces = new string[] { "Ice.scope.TypeId" };
                initData.properties       = createTestProperties(ref args);
                using (var communicator = initialize(initData))
                {
                    communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0));
                    ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
                    adapter.Add(new I1(), "i1");
                    adapter.Add(new I2(), "i2");
                    adapter.Add(new I3(), "i3");
                    adapter.Add(new I4(), "i4");
                    adapter.Activate();
                    serverReady();
                    communicator.waitForShutdown();
                }
            }
예제 #9
0
파일: Server.cs 프로젝트: wubo2018/ice
        public override async Task RunAsync(string[] args)
        {
            await using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new TestIntf());
            await adapter.ActivateAsync();

            await communicator.WaitForShutdownAsync();
        }
예제 #10
0
        public override async Task RunAsync(string[] args)
        {
            await using Communicator communicator = Initialize(ref args);
            await communicator.ActivateAsync();

            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("initial", new InitialI(adapter));
            AllTests.Run(this);
        }
예제 #11
0
        public override void Run(string[] args)
        {
            using var communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0) + ":" + GetTestEndpoint(0, "udp"));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new TestIntf());
            adapter.Activate();
            ServerReady();
            communicator.WaitForShutdown();
        }
예제 #12
0
파일: Server.cs 프로젝트: yuwenyong/ice
            public override void Run(string[] args)
            {
                using Communicator communicator = Initialize(ref args);
                communicator.SetProperty("TestAdapter.Endpoints", $"{GetTestEndpoint(0)} -t 10000");
                ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

                adapter.Add("factory", new RemoteCommunicatorFactoryI());
                adapter.Activate();
                ServerReady();
                communicator.WaitForShutdown();
            }
예제 #13
0
        public override void run(string[] args)
        {
            using var communicator = initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", getTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new MyClass());
            adapter.Activate();
            serverReady();
            communicator.WaitForShutdown();
        }
예제 #14
0
파일: Collocated.cs 프로젝트: mreinart/ice
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            Communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new TestIntf());
            adapter.Add("test2", new TestIntf2());
            // Don't activate OA to ensure collocation is used.

            ObjectAdapter adapter2 = Communicator.CreateObjectAdapter("TestAdapter2", serializeDispatch: true);

            adapter2.Add("serialized", new TestIntf());
            // Don't activate OA to ensure collocation is used.

            await AllTests.RunAsync(this);
        }
예제 #15
0
            public override void run(string[] args)
            {
                var initData = new InitializationData();

                initData.typeIdNamespaces = new string[] { "Ice.objects.TypeId" };
                initData.properties       = createTestProperties(ref args);
                initData.properties.setProperty("Ice.Warn.Dispatch", "0");
                using (var communicator = initialize(initData))
                {
                    communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0));
                    ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
                    adapter.Add(new InitialI(adapter), "initial");
                    adapter.Add(new F2I(), "F21");
                    var uoet = new UnexpectedObjectExceptionTestI();
                    adapter.Add((incoming, current) => uoet.Dispatch(incoming, current), "uoet");
                    adapter.Activate();
                    serverReady();
                    communicator.waitForShutdown();
                }
            }
예제 #16
0
 public override void run(string[] args)
 {
     using (var communicator = initialize(ref args))
     {
         communicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0) + " -t 10000");
         ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
         adapter.Add(new RemoteCommunicatorFactoryI(), "factory");
         adapter.Activate();
         serverReady();
         communicator.waitForShutdown();
     }
 }
예제 #17
0
파일: Server.cs 프로젝트: yuweiApp/ice
        public override void Run(string[] args)
        {
            using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            var           blob    = new BlobjectI();

            adapter.AddDefault(blob);
            adapter.Add("__echo", new Echo());
            adapter.Activate();
            communicator.WaitForShutdown();
        }
예제 #18
0
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            Communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new TestIntf());
            adapter.Add("test2", new TestIntf2());
            await adapter.ActivateAsync();

            ObjectAdapter adapter2 = Communicator.CreateObjectAdapter("TestAdapter2", serializeDispatch: true);

            adapter2.Add("serialized", new TestIntf());
            await adapter2.ActivateAsync();

            ServerReady();
            await Communicator.ShutdownComplete;
        }
예제 #19
0
파일: Server.cs 프로젝트: nail-lian/ice
        public override void Run(string[] args)
        {
            using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            var           initial = new InitialI(adapter);

            adapter.Add("initial", initial);
            adapter.Activate();
            ServerReady();
            communicator.WaitForShutdown();
        }
예제 #20
0
파일: Collocated.cs 프로젝트: wubo2018/ice
        public override async Task RunAsync(string[] args)
        {
            await using Communicator? communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.AdapterId", "test");
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");
            var           prx     = adapter.Add("test", new MyDerivedClass(), IMyDerivedClassPrx.Factory);

            // Don't activate OA to ensure collocation is used.

            AllTests.Run(this);
        }
예제 #21
0
파일: Collocated.cs 프로젝트: mreinart/ice
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("thrower", new Thrower());

            await AllTests.RunAsync(this);
        }
예제 #22
0
파일: Server.cs 프로젝트: mreinart/ice
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add(Communicator.GetProperty("Identity") ?? "test", new TestIntf());
            await adapter.ActivateAsync();

            ServerReady();
            await Communicator.ShutdownComplete;
        }
예제 #23
0
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("CallbackAdapter.Endpoints", GetTestEndpoint(0));

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("CallbackAdapter");

            // The test allows "c1" as category.
            adapter.Add("c1/callback", new Callback());
            // The test allows "c2" as category.
            adapter.Add("c2/callback", new Callback());
            // The test rejects "c3" as category.
            adapter.Add("c3/callback", new Callback());
            // The test allows the prefixed userid.
            adapter.Add("_userid/callback", new Callback());
            await adapter.ActivateAsync();

            ServerReady();
            await Communicator.ShutdownComplete;
        }
예제 #24
0
파일: ServerAMD.cs 프로젝트: mreinart/ice
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new AsyncMyObject());
            await DispatchInterceptors.ActivateAsync(adapter);

            ServerReady();
            await Communicator.ShutdownComplete;
        }
예제 #25
0
 public override void run(string[] args)
 {
     using (var communicator = initialize(ref args))
     {
         communicator.SetProperty("TestAdapter.Endpoints",
                                  getTestEndpoint(0) + ":" + getTestEndpoint(0, "udp"));
         ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
         adapter.Add(new TestI(), "test");
         adapter.Activate();
         serverReady();
         communicator.waitForShutdown();
     }
 }
예제 #26
0
        public override async Task RunAsync(string[] args)
        {
            await using Communicator communicator = Initialize(ref args);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("communicator", new RemoteCommunicator());
            await adapter.ActivateAsync();

            ServerReady();
            communicator.SetProperty("Ice.PrintAdapterReady", "0");
            await communicator.WaitForShutdownAsync();
        }
예제 #27
0
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

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

            await AllTests.RunAsync(this, true);
        }
예제 #28
0
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));

            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");
            var           d       = new D();

            adapter.Add("d", d);
            adapter.Add("d#facetABCD", d);
            var f = new F();

            adapter.Add("d#facetEF", f);
            var h = new H(Communicator);

            adapter.Add("d#facetGH", h);
            await adapter.ActivateAsync();

            ServerReady();
            await Communicator.ShutdownComplete;
        }
예제 #29
0
        public override void Run(string[] args)
        {
            System.Collections.Generic.Dictionary <string, string> properties = CreateTestProperties(ref args);

            //
            // Disable collocation optimization to test async/await dispatch.
            //
            properties["Ice.Default.CollocationOptimized"] = "0";

            //
            // This test kills connections, so we don't want warnings.
            //
            properties["Ice.Warn.Connections"] = "0";

            //
            // Limit the recv buffer size, this test relies on the socket
            // send() blocking after sending a given amount of data.
            //
            properties["Ice.TCP.RcvSize"] = "50000";

            using Communicator communicator = Initialize(properties);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));

            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new TestIntf());
            adapter.Add("test2", new TestIntf2());
            adapter.Activate();

            ObjectAdapter adapter2 = communicator.CreateObjectAdapter("TestAdapter2", serializeDispatch: true);

            adapter2.Add("serialized", new TestIntf());
            adapter2.Activate();

            ServerReady();
            communicator.WaitForShutdown();
        }
예제 #30
0
        public override async Task RunAsync(string[] args)
        {
            Dictionary <string, string>?properties = CreateTestProperties(ref args);

            properties["Ice.Warn.Dispatch"] = "0";

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

            adapter.Add("test", new MyDerivedClass());
            //adapter.activate(); // Don't activate OA to ensure collocation is used.
            AllTests.Run(this);
        }