@Test
	public void testRequestRETR() {
		final FTPClient ftpClient = new FTPClientImpl();

		final FTPClientSocketMockup ftpClientSocketMockup = new FTPClientSocketMockup();
		ftpClientSocketMockup
				.addFTPClientSocketListener(new FTPClientSocketListener() {
					@Override
					public void sokcetClosed() {
					}

					@Override
					public void socketOpened() {
					}

					@Override
					public void newWriteMessage(final String message) {
						final int code = parseMessageCode(message);
						if (code == 150) {
							try {
								final FTPTransferSocket transfertServerImpl = new FTPTransferSocketImpl(
										"127.0.0.1", ftpClient
												.getTransferServer()
												.getPublicPort());
								new Thread(new Runnable() {

									@Override
									public void run() {
										try {
											transfertServerImpl
													.readStringData();
											transfertServerImpl.close();
										} catch (final SocketException e) {
											throw new RuntimeException(e);
										}
									}
								}).start();
							} catch (final ServerSocketException e) {
								throw new RuntimeException(e);
							}
						} else {
							assertEquals(226, code);
						}
					}
				});

		final FTPClientSocketMockup ftpClientSocketMockupNewFile = new FTPClientSocketMockup();
		ftpClientSocketMockupNewFile
				.addFTPClientSocketListener(new FTPClientSocketListener() {
					@Override
					public void sokcetClosed() {
					}

					@Override
					public void socketOpened() {
					}

					@Override
					public void newWriteMessage(final String message) {
						final int code = parseMessageCode(message);
						if (code == 150) {
							try {
								final FTPTransferSocket transfertServerImpl = new FTPTransferSocketImpl(
										"127.0.0.1", ftpClient
												.getTransferServer()
												.getPublicPort());
								new Thread(new Runnable() {

									@Override
									public void run() {
										try {
											transfertServerImpl
													.writeData("Test");
											transfertServerImpl.close();
										} catch (final SocketException e) {
											throw new RuntimeException(e);
										}
									}
								}).start();
							} catch (final ServerSocketException e) {
								throw new RuntimeException(e);
							}
						} else if (code == 226) {
							try {
								FTPRequestHandlerImpl.parseStringRequest(
										"PASV", ftpClient,
										new FTPClientSocketMockup()).execute();
								FTPRequestHandlerImpl.parseStringRequest(
										"RETR /tmp/text.txt", ftpClient,
										ftpClientSocketMockup).execute();

								FTPRequestHandlerImpl.parseStringRequest(
										"DELE /tmp/text.txt", ftpClient,
										new FTPClientSocketMockup()).execute();
							} catch (final RequestHandlerException e) {
								fail(e.getMessage());
							}
						}
					}
				});

		try {
			FTPRequestHandlerImpl.parseStringRequest("USER user", ftpClient,
					new FTPClientSocketMockup()).execute();
			FTPRequestHandlerImpl.parseStringRequest("PASS pass", ftpClient,
					new FTPClientSocketMockup()).execute();

			FTPRequestHandlerImpl.parseStringRequest("PASV", ftpClient,
					new FTPClientSocketMockup()).execute();
			FTPRequestHandlerImpl.parseStringRequest("STOR /tmp/text.txt",
					ftpClient, ftpClientSocketMockupNewFile).execute();
		} catch (final RequestHandlerException e) {
			fail(e.getMessage());
		}
	}