private function compare($dateId, $includedBW, $usedBW, $overageBW, $includedST, $usedST, $overageST, $includedBWST, $usedBWST, $overageBWST, $includedEntry, $usedEntry, $overageEntry, $includedPlay, $usedPlay, $overagePlay)
 {
     $monthId = intval($dateId / 100);
     $rows = MySQLRunner::execute("CALL kalturadw.calc_partner_overage(?)", array(0 => $monthId));
     $this->assertGreaterThan(0, count($rows));
     for ($i = 0; $i < count($rows); $i++) {
         if ($rows[$i]["publisher_id"] == $this->partnerId) {
             $this->assertEquals($includedBW, $rows[$i]["included_bandwidth_kb"]);
             $this->assertEquals($usedBW, $rows[$i]["actual_bandwidth_kb"]);
             $this->assertEquals($overageBW, $rows[$i]["charge_overage_bandwidth_kb"]);
             $this->assertEquals($includedST, $rows[$i]["included_storage_mb"]);
             $this->assertEquals($usedST, $rows[$i]["actual_storage_mb"]);
             $this->assertEquals($overageST, $rows[$i]["charge_overage_storage_mb"]);
             $this->assertEquals($includedBWST, $rows[$i]["included_total_usage_mb"]);
             $this->assertEquals($usedBWST, $rows[$i]["actual_total_usage_mb"]);
             $this->assertEquals($overageBWST, $rows[$i]["charge_overage_total_usage_mb"]);
             $this->assertEquals($includedEntry, $rows[$i]["included_entries"]);
             $this->assertEquals($usedEntry, $rows[$i]["actual_entries"]);
             $this->assertEquals($overageEntry, $rows[$i]["charge_overage_entries"]);
             $this->assertEquals($includedPlay, $rows[$i]["included_plays"]);
             $this->assertEquals($usedPlay, $rows[$i]["actual_plays"]);
             $this->assertEquals($overagePlay, $rows[$i]["charge_overage_plays"]);
             return;
         }
     }
     #not found partner, fail test
     $this->fail();
 }
 private static function deleteLiveEntries()
 {
     $lines = file('source/delete_live_entries.sql');
     foreach ($lines as $line) {
         MySQLRunner::execute($line);
     }
 }
 public static function register()
 {
     KettleRunner::execute('/common/register_etl_server.ktr');
     MySQLRunner::execute("CALL kalturadw.populate_time_dim('2011-01-01 00:00:00','2011-08-01 00:00:00')");
 }
 public static function dropTablePartitions($tableSchema, $tableName, $initialPartition = 'p_0')
 {
     $sql = "SELECT partition_name FROM information_schema.PARTITIONS WHERE table_schema = '{$tableSchema}' and table_name = '{$tableName}' AND partition_name <> '{$initialPartition}'";
     $rows = MySQLRunner::execute($sql);
     foreach ($rows as $row) {
         $sql = "ALTER TABLE {$tableSchema}.{$tableName} DROP PARTITION " . $row["partition_name"];
         MySQLRunner::execute($sql);
     }
 }
 private function countRows($table_name, $date)
 {
     $rows = MySQLRunner::execute("SELECT * FROM kalturadw." . $table_name . " WHERE date_id = " . $date->format("Ymd"));
     return count($rows);
 }