简体   繁体   English

通过任何在线服务器测试FTPS和SFTP

[英]Testing FTPS and SFTP through any online server

I am working on a module which provides FTPS and SFTP service. 我正在开发一个提供FTPS和SFTP服务的模块。

To verify the working of my service, i need online server(s) which serves FTPS and/or SFTP requests. 为了验证我的服务的工作,我需要服务于FTPS和/或SFTP请求的在线服务器。

Is there any good service as such. 有这么好的服务吗?

Thanks, Vijay Bhore 谢谢,Vijay Bhore

Install your own. 安装自己的。

For FTP/FTPS you can use FileZilla server . 对于FTP / FTPS,您可以使用FileZilla服务器

For SFTP, see Is IIS SFTP natively supported by Windows Server 2012 R2? 对于SFTP,请参阅Windows Server 2012 R2是否本机支持IIS SFTP? .

Once I had a similiar problem and therefore wrote a JUnit 4 rule that runs an SFTP server during your test. 一旦我遇到类似的问题,因此编写了一个在测试期间运行SFTP服务器的JUnit 4规则。 It is called Fake SFTP Server Rule . 它被称为假SFTP服务器规则 Here is an example of a test using that rule: 以下是使用该规则的测试示例:

public class SomeTest {
    @Rule
    public final FakeSftpServerRule sftpServer = new FakeSftpServerRule();

    @Test
    public void testTextFile() {
        //code that uploads the file

        String fileContent = sftpServer.getFileContent("/directory/file.txt", UTF_8);

        //verify content
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM