Пример #1
0
        static void Main(string[] argv)
        {
            // setup the clients
            string        dirname = new FileInfo(Assembly.GetEntryAssembly().Location).DirectoryName;
            string        server  = Path.Combine(dirname, "testserver.exe");
            List <String> LIST    = new List <String>()
            {
                "--name", "c1", "--srvname", "s1"
            };

            LIST.AddRange(argv);
            // create the object
            testclient c0   = new testclient();
            testclient c00  = new testclient();
            testclient c01  = new testclient();
            testclient c000 = new testclient();
            testclient c1   = new testclient();
            testclient c10  = new testclient();
            testclient c100 = new testclient();
            testclient c101 = new testclient();

            try {
                // create the link
                if (Type.GetType("Mono.Runtime") != null)
                {
                    c0.LinkCreate("--name", "c0", "--debug", System.Environment.GetEnvironmentVariable("TS_DEBUG"),
                                  "@", "mono", server, "--name", "s0");
                }
                else
                {
                    c0.LinkCreate("--name", "c0", "--debug", System.Environment.GetEnvironmentVariable("TS_DEBUG"),
                                  "@", server, "--name", "s0");
                }

                c00.LinkCreateChild(c0, "--name", "c00", "--srvname", "s00");
                c01.LinkCreateChild(c0, "--name", "c01", "--srvname", "s01");
                c000.LinkCreateChild(c00, "--name", "c000", "--srvname", "s000");
                c1.LinkCreate(LIST.ToArray());
                c10.LinkCreateChild(c1, "--name", "c10", "--srvname", "s10");
                c100.LinkCreateChild(c10, "--name", "c100", "--srvname", "s100");
                c101.LinkCreateChild(c10, "--name", "c101", "--srvname", "s101");
                // do the tests
                Console.WriteLine(c0.Get());
                Console.WriteLine(c00.Get());
                Console.WriteLine(c01.Get());
                Console.WriteLine(c000.Get());
                Console.WriteLine(c1.Get());
                Console.WriteLine(c10.Get());
                Console.WriteLine(c100.Get());
                Console.WriteLine(c101.Get());
            } catch (Exception ex) {
                c0.ErrorSet(ex);
            } finally {
                // do the cleanup
                c1.LinkDelete();
                c0.Exit();
            }
        }
Пример #2
0
        static void Main(string[] argv)
        {
            // setup the clients
              string dirname = new FileInfo(Assembly.GetEntryAssembly().Location).DirectoryName;
              string server = Path.Combine(dirname, "testserver.exe");
              List<String> LIST = new List<String>() {"--name", "c1", "--srvname", "s1"};
              LIST.AddRange(argv);
              // create the object
              testclient c0 = new testclient();
              testclient c00 = new testclient();
              testclient c01 = new testclient();
              testclient c000 = new testclient();
              testclient c1 = new testclient();
              testclient c10 = new testclient();
              testclient c100 = new testclient();
              testclient c101 = new testclient();
              try {
            // create the link
            if(Type.GetType ("Mono.Runtime") != null)
              c0.LinkCreate("--name", "c0", "--debug", System.Environment.GetEnvironmentVariable("TS_DEBUG"),
                        "@", "mono", server, "--name", "s0");
            else
              c0.LinkCreate("--name", "c0", "--debug", System.Environment.GetEnvironmentVariable("TS_DEBUG"),
                        "@", server, "--name", "s0");

            c00.LinkCreateChild(c0, "--name", "c00", "--srvname", "s00");
            c01.LinkCreateChild(c0, "--name", "c01", "--srvname", "s01");
            c000.LinkCreateChild(c00, "--name", "c000", "--srvname", "s000");
            c1.LinkCreate(LIST.ToArray());
            c10.LinkCreateChild(c1, "--name", "c10", "--srvname", "s10");
            c100.LinkCreateChild(c10, "--name", "c100", "--srvname", "s100");
            c101.LinkCreateChild(c10, "--name", "c101", "--srvname", "s101");
            // do the tests
            Console.WriteLine(c0.Get());
            Console.WriteLine(c00.Get());
            Console.WriteLine(c01.Get());
            Console.WriteLine(c000.Get());
            Console.WriteLine(c1.Get());
            Console.WriteLine(c10.Get());
            Console.WriteLine(c100.Get());
            Console.WriteLine(c101.Get());
              } catch (Exception ex) {
            c0.ErrorSet(ex);
              } finally {
            // do the cleanup
            c1.LinkDelete();
            c0.Exit();
              }
        }