| 46 | |
| 47 | public: |
| 48 | void setUp() |
| 49 | { |
| 50 | option_.reset(new Option()); |
| 51 | authConfigFactory_.reset(new AuthConfigFactory()); |
| 52 | |
| 53 | //_ftpServerSocket.reset(new SocketCore()); |
| 54 | std::shared_ptr<SocketCore> listenSocket(new SocketCore()); |
| 55 | listenSocket->bind(0); |
| 56 | listenSocket->beginListen(); |
| 57 | listenSocket->setBlockingMode(); |
| 58 | listenPort_ = listenSocket->getAddrInfo().port; |
| 59 | |
| 60 | req_.reset(new Request()); |
| 61 | req_->setUri("ftp://localhost/dir%20sp/hello%20world.img"); |
| 62 | |
| 63 | clientSocket_.reset(new SocketCore()); |
| 64 | clientSocket_->establishConnection("localhost", listenPort_); |
| 65 | |
| 66 | while (!clientSocket_->isWritable(0)) |
| 67 | ; |
| 68 | |
| 69 | serverSocket_ = listenSocket->acceptConnection(); |
| 70 | serverSocket_->setBlockingMode(); |
| 71 | ftp_.reset(new FtpConnection( |
| 72 | 1, clientSocket_, req_, |
| 73 | authConfigFactory_->createAuthConfig(req_, option_.get()), |
| 74 | option_.get())); |
| 75 | } |
| 76 | |
| 77 | void tearDown() {} |
| 78 |
nothing calls this directly
no test coverage detected