summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/retry/Client.cs
blob: f8e8de97a1b8ea679702194157ef656af2f51cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

using Test;

namespace Ice
{
    namespace retry
    {
        public class Client : TestHelper
        {
            public override void run(string[] args)
            {
                var initData = new Ice.InitializationData();
                initData.observer = Instrumentation.getObserver();

                initData.properties = createTestProperties(ref args);
                initData.properties.setProperty("Ice.RetryIntervals", "0 1 10 1");

                //
                // This test kills connections, so we don't want warnings.
                //
                initData.properties.setProperty("Ice.Warn.Connections", "0");
                using(var communicator = initialize(initData))
                {
                    //
                    // Configure a second communicator for the invocation timeout
                    // + retry test, we need to configure a large retry interval
                    // to avoid time-sensitive failures.
                    //
                    initData.properties.setProperty("Ice.RetryIntervals", "0 1 10000");
                    initData.observer = Instrumentation.getObserver();
                    using(var communicator2 = initialize(initData))
                    {
                        var retry = AllTests.allTests(this, communicator, communicator2, "retry:" + getTestEndpoint(0));
                        retry.shutdown();
                    }
                }
            }

            public static int Main(string[] args)
            {
                return TestDriver.runTest<Client>(args);
            }
        }
    }
}