use of com.baidu.disconf.core.common.restful.core.RemoteUrl in project disconf by knightliao.
the class RestfulMgrTestCase method tetDownloadFromServer.
/**
*
*/
@Test
public void tetDownloadFromServer() {
try {
RemoteUrl remoteUrl = new RemoteUrl(RemoteMockServer.FILE_URL, RemoteMockServer.LOCAL_HOST_LIST);
String downloadFilePath = restfulMgr.downloadFromServer(remoteUrl, RemoteMockServer.FILE_NAME, RemoteMockServer.LOCAL_DOWNLOAD_DIR, RemoteMockServer.LOCAL_DOWNLOAD_DIR_TEMP, RemoteMockServer.LOCAL_TARGET_DOWNLOAD_DIR, true, 3, 3);
File file = new File(downloadFilePath);
String content = FileUtils.readFileToString(file);
Assert.assertEquals(RemoteMockServer.FILE_CONTENT, content);
} catch (Exception e) {
e.printStackTrace();
Assert.assertTrue(false);
}
}