-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpManager.test.cpp
More file actions
29 lines (27 loc) · 989 Bytes
/
HttpManager.test.cpp
File metadata and controls
29 lines (27 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "HttpManager.h"
#include "downloader/Downloader.h"
#include "WebResourceInfo.h"
#include "configurators/FileConfigurator.h"
#include <iostream>
using namespace ua::kiev::ukma::downloader;
using namespace ua::kiev::ukma::downloader::configurators;
void main(int argc, char * argv)
{
try {
// get configuration information
IConfigurator *config = new FileConfigurator("config.txt");
string url = config->getValue("URL");
string depthString = config->getValue("DEPTH");
if (depthString.empty()) throw exception("DEPTH is not present in the config file.");
if (url.empty()) throw exception("URL is not present in the config file.");
int depth = atoi(depthString.c_str());
delete config;
// run manager
cout<<"Begin of the test of the HttpManager"<<endl;
HttpManager* manager=new HttpManager(url,depth,"downloads\\");
manager->run();
cout<<"End of the test of the HttpManager"<<endl;
delete manager;
}
catch (exception& ex) {cout<<ex.what()<<endl;}
}