public TestingFramework() throws Exception {
		readConfig();
		System.out.println("-----------------------------------------------------");
		System.out.println("Generating test file");
		System.out.println("-----------------------------------------------------");
		generateTestFile();
		System.out.println("Component startup");
		System.out.println("-----------------------------------------------------");
		proxy = componentFactory.startProxy(new Config("proxy"), new Shell(
				"proxy", new TestOutputStream(System.out),
				new TestInputStream()));
		Thread.sleep(Util.WAIT_FOR_COMPONENT_STARTUP);

		server = componentFactory.startFileServer(new Config("fs1"), new Shell(
				"fs1", new TestOutputStream(System.out),
				new TestInputStream()));
		Thread.sleep(Util.WAIT_FOR_COMPONENT_STARTUP);

		subscribeClient = componentFactory.startClient(new Config("client"), new Shell(
				"client", new TestOutputStream(System.out),
				new TestInputStream()));
		Thread.sleep(Util.WAIT_FOR_COMPONENT_STARTUP);

		downloadClients = new ArrayList<IClientCli>();
		for(int i=0; i<clients; i++) {
			downloadClients.add(componentFactory.startClient(new Config("client"), new Shell(
				"client", new TestOutputStream(System.out),
				new TestInputStream())));
		}
		Thread.sleep(Util.WAIT_FOR_COMPONENT_STARTUP*3);
		System.out.println("Starting test");
		System.out.println("-----------------------------------------------------");
		subscribeClient.login("alice", "12345");
		subscribeClient.upload("testFile.txt");
		subscribeClient.subscribe("testFile.txt", 100);
		
		for(IClientCli client : downloadClients) {
			client.login("bill", "23456");
			client.buy(10000000);
		}
		
		testTimer = new Timer();
		testTimer.schedule(new EndTestTask(), testDurationSec*1000, testDurationSec*1000);
		
		downloadTimer = new Timer();
		for(IClientCli client : downloadClients) {
			if(downloadsPerMin>0)
				downloadTimer.schedule(new DownloadTask(client,false), 0l, (long) 60000 / downloadsPerMin);
			if(uploadsPerMin>0)
				downloadTimer.schedule(new UploadTask(client,true), 0l, (long) 60000 / uploadsPerMin);
		}	
	}