Esempio n. 1
0
        public void ValidateDoesNotThrow()
        {
            var isa = new SftpAdapter.Inbound(
                a => {
                a.ServerAddress   = "sftp.server.com";
                a.Port            = 23;
                a.FolderPath      = "/out/to_bts/";
                a.FileMask        = "*.xml";
                a.PollingInterval = TimeSpan.FromMinutes(10);
                a.ConnectionLimit = 6;

                a.ClientAuthenticationMode = ClientAuthenticationMode.MultiFactorAuthentication;
                a.PrivateKeyFile           = @"c:\files\key.ppk";
                a.PrivateKeyPassword       = "******";
                a.UserName = "******";
                a.Password = "******";
                a.SshServerHostKeyFingerPrint = "fingerprint";
                a.EncryptionCipher            = EncryptionCipher.AES;

                a.ProxyAddress  = "proxy.server.com";
                a.ProxyPort     = 1082;
                a.ProxyType     = ProxyType.SOCKS4;
                a.ProxyUserName = "******";
                a.ProxyPassword = "******";
            });

            Assert.That(() => ((ISupportValidation)isa).Validate(), Throws.Nothing);
        }
Esempio n. 2
0
        public void ValidateDoesNotThrow()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var isa = new SftpAdapter.Inbound(
                a => {
                a.ServerAddress   = "sftp.server.com";
                a.Port            = 23;
                a.FolderPath      = "out/to_bts";
                a.FileMask        = "*.xml";
                a.PollingInterval = TimeSpan.FromMinutes(10);
                a.ConnectionLimit = 6;

                a.ClientAuthenticationMode = ClientAuthenticationMode.MultiFactorAuthentication;
                a.PrivateKeyFile           = @"c:\file\key.ppk";
                a.PrivateKeyPassword       = "******";
                a.UserName = "******";
                a.Password = "******";
                a.SshServerHostKeyFingerPrint = "fingerprint";
                a.EncryptionCipher            = EncryptionCipher.AES;

                a.ProxyAddress  = "proxy.server.com";
                a.ProxyPort     = 1082;
                a.ProxyType     = ProxyType.SOCKS4;
                a.ProxyUserName = "******";
                a.ProxyPassword = "******";
            });

            Invoking(() => ((ISupportValidation)isa).Validate()).Should().NotThrow();
        }
Esempio n. 3
0
        public void SerializeToXml()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var isa = new SftpAdapter.Inbound(
                a => {
                a.ServerAddress   = "sftp.server.com";
                a.Port            = 23;
                a.FolderPath      = "/out/to_bts/";
                a.FileMask        = "*.xml";
                a.ConnectionLimit = 6;

                a.ClientAuthenticationMode = ClientAuthenticationMode.MultiFactorAuthentication;
                a.PrivateKeyFile           = @"c:\file\key.ppk";
                a.PrivateKeyPassword       = "******";
                a.UserName = "******";
                a.Password = "******";
                a.SshServerHostKeyFingerPrint = "fingerprint";
                a.EncryptionCipher            = EncryptionCipher.AES;

                a.ProxyAddress  = "proxy.server.com";
                a.ProxyPort     = 1082;
                a.ProxyType     = ProxyType.SOCKS4;
                a.ProxyUserName = "******";
                a.ProxyPassword = "******";
            });
            var xml = isa.GetAdapterBindingInfoSerializer().Serialize();

            xml.Should().Be(
                "<CustomProps>" + (
                    "<ServerAddress vt=\"8\">sftp.server.com</ServerAddress>" +
                    "<Port vt=\"3\">23</Port>" +
                    "<FolderPath vt=\"8\">/out/to_bts/</FolderPath>" +
                    "<FileMask vt=\"8\">*.xml</FileMask>" +
                    "<AccessAnySSHServerHostKey vt=\"11\">0</AccessAnySSHServerHostKey>" +
                    "<SSHServerHostKey vt=\"8\">fingerprint</SSHServerHostKey>" +
                    "<ClientAuthenticationMode vt=\"8\">MultiFactorAuthentication</ClientAuthenticationMode>" +
                    "<PrivateKey vt=\"8\">c:\\file\\key.ppk</PrivateKey>" +
                    "<PrivateKeyPassword vt=\"8\">p@ssw0rd</PrivateKeyPassword>" +
                    "<UserName vt=\"8\">user</UserName>" +
                    "<Password vt=\"8\">p@ssw0rd</Password>" +
                    "<PollingInterval vt=\"3\">5</PollingInterval>" +
                    "<PollingIntervalUnit vt=\"8\">Seconds</PollingIntervalUnit>" +
                    "<RetainAfterDownload vt=\"11\">0</RetainAfterDownload>" +
                    "<EnableTimeComparison vt=\"11\">0</EnableTimeComparison>" +
                    "<RedownloadInterval vt=\"3\">0</RedownloadInterval>" +
                    "<ConnectionLimit vt=\"3\">6</ConnectionLimit>" +
                    "<MaxConnectionReuseTimeInSeconds vt=\"3\">0</MaxConnectionReuseTimeInSeconds>" +
                    "<ErrorThreshold vt=\"3\">0</ErrorThreshold>" +
                    "<ProxyPassword vt=\"8\">p@ssw0rd</ProxyPassword>" +
                    "<ProxyUserName vt=\"8\">proxy-user</ProxyUserName>" +
                    "<ProxyType vt=\"8\">SOCKS4</ProxyType>" +
                    "<ProxyAddress vt=\"8\">proxy.server.com</ProxyAddress>" +
                    "<ProxyPort vt=\"3\">1082</ProxyPort>" +
                    "<EncryptionCipher vt=\"8\">AES</EncryptionCipher>" +
                    "<TransferMode vt=\"8\">Binary</TransferMode>") +
                "</CustomProps>");
        }
Esempio n. 4
0
        public void SerializeToXml()
        {
            var isa = new SftpAdapter.Inbound(
                a => {
                a.ServerAddress   = "sftp.server.com";
                a.Port            = 23;
                a.FolderPath      = "/out/to_bts/";
                a.FileMask        = "*.xml";
                a.PollingInterval = TimeSpan.FromMinutes(10);
                a.ConnectionLimit = 6;

                a.ClientAuthenticationMode = ClientAuthenticationMode.MultiFactorAuthentication;
                a.PrivateKeyFile           = @"c:\files\key.ppk";
                a.PrivateKeyPassword       = "******";
                a.UserName = "******";
                a.Password = "******";
                a.SshServerHostKeyFingerPrint = "fingerprint";
                a.EncryptionCipher            = EncryptionCipher.AES;

                a.ProxyAddress  = "proxy.server.com";
                a.ProxyPort     = 1082;
                a.ProxyType     = ProxyType.SOCKS4;
                a.ProxyUserName = "******";
                a.ProxyPassword = "******";
            });
            var xml = ((IAdapterBindingSerializerFactory)isa).GetAdapterBindingSerializer().Serialize();

            Assert.That(
                xml,
                Is.EqualTo(
                    "<CustomProps>" +
                    "<ServerAddress vt=\"8\">sftp.server.com</ServerAddress>" +
                    "<Port vt=\"3\">23</Port>" +
                    "<FolderPath vt=\"8\">/out/to_bts/</FolderPath>" +
                    "<FileMask vt=\"8\">*.xml</FileMask>" +
                    "<AccessAnySSHServerHostKey vt=\"11\">0</AccessAnySSHServerHostKey>" +
                    "<SSHServerHostKey vt=\"8\">fingerprint</SSHServerHostKey>" +
                    "<ClientAuthenticationMode vt=\"8\">MultiFactorAuthentication</ClientAuthenticationMode>" +
                    "<PrivateKey vt=\"8\">c:\\files\\key.ppk</PrivateKey>" +
                    "<PrivateKeyPassword vt=\"8\">p@ssw0rd</PrivateKeyPassword>" +
                    "<UserName vt=\"8\">user</UserName>" +
                    "<Password vt=\"8\">p@ssw0rd</Password>" +
                    "<PollingInterval vt=\"3\">10</PollingInterval>" +
                    "<PollingIntervalUnit vt=\"8\">Minutes</PollingIntervalUnit>" +
                    "<ConnectionLimit vt=\"3\">6</ConnectionLimit>" +
                    "<ProxyPassword vt=\"8\">p@ssw0rd</ProxyPassword>" +
                    "<ProxyUserName vt=\"8\">proxyuser</ProxyUserName>" +
                    "<ProxyType vt=\"8\">SOCKS4</ProxyType>" +
                    "<ProxyAddress vt=\"8\">proxy.server.com</ProxyAddress>" +
                    "<ProxyPort vt=\"3\">1082</ProxyPort>" +
                    "<EncryptionCipher vt=\"8\">AES</EncryptionCipher>" +
                    "</CustomProps>"));
        }