Esempio n. 1
0
 public function testCSVProxy()
 {
     $dao = new CSVAdapter(__DIR__ . '/test_multipleentries.csv');
     $scheduler = new ProxyScheduler($dao);
     $proxy = $scheduler->getNext();
     //$this->assertEquals($proxy->getID(), 'http://207.91.10.234:8080');
 }
 public function testRoundRobinScheduling()
 {
     $dao = new CSVAdapter(__DIR__ . '/test_multipleentries.csv');
     $this->assertEquals($dao->count(), 5);
     $scheduler = new ProxyScheduler($dao, new RoundRobinScheduling(), false);
     $this->assertEquals('http://201.91.10.234:8080', $scheduler->getNext()->getID());
     $this->assertEquals('http://202.91.10.234:8080', $scheduler->getNext()->getID());
     $this->assertEquals('http://203.91.10.234:8080', $scheduler->getNext()->getID());
     $this->assertEquals('http://204.91.10.234:8080', $scheduler->getNext()->getID());
     $this->assertEquals('http://205.91.10.234:8080', $scheduler->getNext()->getID());
     $this->assertEquals('http://201.91.10.234:8080', $scheduler->getNext()->getID());
 }