Question

I'm writing some new code that involves POP3 manipulation. I'm trying to come up with a design that allows me to write tests, so it's fairly decoupled and exercises most of the new code I'm writing.

The problem I'm facing is that I still need to verify that the way I'm using some third party component for email is the right one. This involves testing, for example, strange responses from faulty POP3 servers.

Right now, I'm using a mock POP3 client so I can test the logic around a possible scenario where the client gets either an error or a strange response. However, I still need to check that these assumptions are true and remain true after, for example, an upgrade of the third party components.

Also, there's SMTP. I know in the Java world you have Dumbster.

What are my alternatives in Delphi? Write my own custom mini-servers using the usual suspects?

Was it helpful?

Solution

Well I hate to be the person to confirm what you suspect, but:

(a) you're going to have to build your own (everybody's needs are different, and at least in Delphi there are no standard fixtures for this kind of integration testing equivalent to the Java Dumpster) and...

(b) I don't think you should assume Indy, because ICS and Synapse are great, and using their demos might get you want you want even faster... I would go with ICS, given a choice. But if you know Indy better, then go with it.

(c) I tend to keep around a virtual machine running Linux, because I find it easy to test with the sort of POP3/SMTP servers that get actually used in the real world at ISPs around me, and if I cared about it, I'd probably create a VM for Windows + Exchange server, if I had MSDN licenses, and the ability to do so.

Remember this ain't unit testing no more. This is integration testing. Even if you cram it all in with threads instead of processes, that's no unit test you've got there, it's an integration test.

If you want all your developers to be able to test without setup, then create a QA-TEST-NETWORK BOX which is always available and which has various configurations on various standard ports, then your integration tests can run at any developer PC workstation with zero setup, inside your LAN. Outside your LAN, in a WAN environment this gets a lot hairier.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top