Exemplo n.º 1
0
 public static void BeforeClass()
 {
     //設定ファイルの退避と上書き
     _op = new TmpOption("WebServerTest","WebServerTest.ini");
     var _kernel = new Kernel();
     option = _kernel.ListOption.Get("Web-localhost:88");
 }
Exemplo n.º 2
0
 public void SetUp()
 {
     //設定ファイルの退避と上書き
     _op = new TmpOption("BJDTest","MailBoxTest.ini");
     var kernel = new Kernel();
     var oneOption = new OptionMailBox(kernel,"");
     _conf = new Conf(oneOption);
 }
Exemplo n.º 3
0
        public void SetUp()
        {
            //設定ファイルの退避と上書き
            _op = new TmpOption("WebServerTest","WebServerTest.ini");
            Kernel kernel = new Kernel();
            var option = kernel.ListOption.Get("Web-localhost:88");
            Conf conf = new Conf(option);

            _contentType = new ContentType(conf);
        }
Exemplo n.º 4
0
        public static void BeforeClass()
        {
            //設定ファイルの退避と上書き
            _op = new TmpOption("WebServerTest","WebServerTest.ini");
            var kernel = new Kernel();
            var option = kernel.ListOption.Get("Web-localhost:88");
            Conf conf = new Conf(option);

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();

            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();
        }
Exemplo n.º 5
0
        public static void BeforeClass()
        {
            TestUtil.CopyLangTxt();//BJD.Lang.txt

            //設定ファイルの退避と上書き
            _op = new TmpOption("SipServerTest","SipServerTest.ini");
            var kernel = new Kernel();
            var option = kernel.ListOption.Get("Sip");
            var conf = new Conf(option);

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();

            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();
        }
Exemplo n.º 6
0
        public static void BeforeClass()
        {
            //srcDir = string.Format("{0}\\ProxyHttpServerTest", TestUtil.ProhjectDirectory());

            //設定ファイルの退避と上書き
            _op = new TmpOption("ProxyHttpServerTest", "ProxyHttpServerTest.ini");
            Kernel kernel = new Kernel();
            var option = kernel.ListOption.Get("ProxyHttp");
            Conf conf = new Conf(option);

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();

            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();
        }
Exemplo n.º 7
0
        public static void BeforeClass()
        {
            TestUtil.CopyLangTxt();//BJD.Lang.txt

            //named.caのコピー
            var src = string.Format("{0}\\DnsServerTest\\named.ca", TestUtil.ProjectDirectory());
            var dst = string.Format("{0}\\BJD\\out\\named.ca", TestUtil.ProjectDirectory());
            File.Copy(src, dst, true);

            //設定ファイルの退避と上書き
            _op = new TmpOption("DnsServerTest","DnsServerTest.ini");
            OneBind oneBind = new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Udp);
            Kernel kernel = new Kernel();
            var option = kernel.ListOption.Get("Dns");
            Conf conf = new Conf(option);

            //サーバ起動
            _sv = new Server(kernel, conf, oneBind);
            _sv.Start();
        }
Exemplo n.º 8
0
        public static void BeforeClass()
        {
            //設定ファイルの退避と上書き
            _op = new TmpOption("WebApiServerTest", "WebApiServerTest.ini");

            //MailBoxのみ初期化する特別なテスト用Kernelコンストラクタ
            var kernel = new Kernel("MailBox");
            var option = kernel.ListOption.Get("WebApi");
            var conf = new Conf(option);

            //メールボックスの初期化
            MailBoxBackup();
            MailBoxSetup();

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();

            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();
        }
Exemplo n.º 9
0
        private readonly OneServer _v6Sv; //サーバ

        #endregion Fields

        #region Constructors

        public TestServer(TestServerType type,String iniSubDir,String iniFileName)
        {
            var confName = type == TestServerType.Pop ? "Pop3" : "Smtp";

            //設定ファイルの退避と上書き
            _op = new TmpOption(iniSubDir,iniFileName);
            var kernel = new Kernel();
            var option = kernel.ListOption.Get(confName);
            var conf = new Conf(option);

            //サーバ起動
            if (type == TestServerType.Pop){
                _v4Sv = new Pop3Server.Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
                _v6Sv = new Pop3Server.Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            } else {
                _v4Sv = new SmtpServer.Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
                _v6Sv = new SmtpServer.Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            }
            _v4Sv.Start();
            _v6Sv.Start();

            Thread.Sleep(100); //少し余裕がないと多重でテストした場合に、サーバが起動しきらないうちにクライアントからの接続が始まってしまう。
        }
Exemplo n.º 10
0
        public void SetUp()
        {
            //MailBoxは、Pop3ServerTest.iniの中で「c:\tmp2\bjd5\Pop3ServerTest\mailbox」に設定されている
            //また、上記のMaloBoxには、user1=0件 user2=2件 のメールが着信している

            TestUtil.CopyLangTxt();//BJD.Lang.txt

            //設定ファイルの退避と上書き
            _op = new TmpOption("Pop3ServerTest", "Pop3ServerTest.ini");
            var kernel = new Kernel();
            var option = kernel.ListOption.Get("Pop3");
            var conf = new Conf(option);

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();

            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();

            //メールボックスへのデータセット
            var srcDir = @"c:\tmp2\bjd5\Pop3ServerTest\";
            var dstDir = @"c:\tmp2\bjd5\Pop3ServerTest\mailbox\user2\";
            File.Copy(srcDir + "DF_00635026511425888292", dstDir + "DF_00635026511425888292", true);
            File.Copy(srcDir + "DF_00635026511765086924", dstDir + "DF_00635026511765086924", true);
            File.Copy(srcDir + "MF_00635026511425888292", dstDir + "MF_00635026511425888292", true);
            File.Copy(srcDir + "MF_00635026511765086924", dstDir + "MF_00635026511765086924", true);

            Thread.Sleep(100);//少し余裕がないと多重でテストした場合に、サーバが起動しきらないうちにクライアントからの接続が始まってしまう。
        }
Exemplo n.º 11
0
        public void SetUp()
        {
            //MailBoxは、Smtp3ServerTest.iniの中で「c:\tmp2\bjd5\SmtpServerTest\mailbox」に設定されている
            //また、上記のMaloBoxには、user1=0件 user2=2件 のメールが着信している

            //設定ファイルの退避と上書き
            _op = new TmpOption("SmtpServerTest", "EsmtpServerTest.ini");
            var kernel = new Kernel();
            var option = kernel.ListOption.Get("Smtp");
            var conf = new Conf(option);

            //サーバ起動
            _v4Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp));
            _v4Sv.Start();
            _v6Sv = new Server(kernel, conf, new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp));
            _v6Sv.Start();

            Thread.Sleep(100);//少し余裕がないと多重でテストした場合に、サーバが起動しきらないうちにクライアントからの接続が始まってしまう。
        }
Exemplo n.º 12
0
        public void Setup()
        {
            TestUtil.CopyLangTxt();//BJD.Lang.txt

            //設定ファイルの退避と上書き
            _op = new TmpOption("DhcpServerTest","DhcpServerTest.ini");
            OneBind oneBind = new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Udp);
            Kernel kernel = new Kernel();
            var option = kernel.ListOption.Get("Dhcp");
            Conf conf = new Conf(option);

            //サーバ起動
            _sv = new Server(kernel, conf, oneBind);
            _sv.Start();
        }