rjo1970/dumbster — pull request #14 by julianseeger (2014-03-01 16:30:43+00:00)
Title: Accept timed out

When I start Dumbster, the Server listens for 5 Seconds and then presents a
java.net.SocketTimeoutException: Accept timed out

This is probably related to #13 since when exceptions on accept terminate the whole application.
The ServerSockets timeout is set to 5 Seconds and after that, the accept-call interrupts an this exception terminates the application. It may be acceptable for Unittests, but makes it impossible to run Dumbster longer than 5 Seconds without an acceppted request.

This commit removed the timeout completely so that it can be used as long as it is not stopped or interrupted. The stop-method still works because it calls serverSocker.close() and this will interrupt the serverSocket even if it doesn't time out.

The changes for EMLMailStore and EMLMailStoreTest are not directly related but were neccessary to make the test running stable on my system.
Somehow the method EMLMailStoreTest::givenMailStoreDirectoryIsEmpty doen't remove all files or some files are written by the previous EMLMailStore with deplay, but when running the whole EMLMailStoreTest suite, some tests are always failing because there are files left from another test.
These changes do 2 things:
1. use a differen directory for each test
2. clean the directory on tearDown (mailStore.clearMessages seems to avoid a delayed write)