socket/serversocket/thread test refactoring