Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit/Integration testing FTP access

Tags:

c#

testing

ftp

A member of my Team is writing an application that accesses an external FTP site to download files. Having written the code we would like to be able to do integration testing without using a physical ftp server as it is an external site.

We have done similar things in the past using nDumpster for simulating an smtp server in code and we are wondering if there are any equilivent compliant ftp servers that can be used?

Edit:

I should add that these are not for true unit tests, we have those and mock our ftp implementation.

However we are using WebFtpRequest.Create() in the actual implementation of the interface. So testing this code requires an actual server (unless we register our own protocol in the tests) eventually we will have to test against an actual server!.

We want to be able to start and stop the ftp server in code (much like you can nDumpster) and examine that our calls are correct.

like image 890
Ash Avatar asked Jun 10 '11 08:06

Ash


People also ask

How unit testing and integration testing is performed?

Unit Testing is a kind of white box testing, whereas Integration Testing is a kind of black-box testing. For Unit Testing, accessibility of code is required, as it tests the written code, while for Integration Testing, access to code is not required, since it tests the interactions and interfaces between modules.

Which is better unit test or integration test?

While unit tests always take results from a single unit, such as a function call, integration tests may aggregate results from various parts and sources. In an integration test, there is no need to mock away parts of the application. You can replace external systems, but the application works in an integrated way.

Can we do integration testing using JUnit?

Definitely! We use a combination of JUnit, ANT tasks to run them, and Hudson for continues integration tests.


1 Answers

I just needed something similar and ended up with solution based on small FTPDMIN command-line FTP server. You can find my solution here: https://github.com/Buthrakaur/FtpIntegrationTesting

like image 50
Buthrakaur Avatar answered Oct 12 '22 23:10

Buthrakaur