FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
tfmrdf.php
1 #!/usr/bin/php
2 <?php
3 
4 
5 /***********************************************************
6  Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  version 2 as published by the Free Software Foundation.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  ***********************************************************/
21 
29 require_once ('../../../tests/fossologyUnitTestCase.php');
30 require_once ('../Classes/FreshmeatRdfs.php');
31 require_once ('../Classes/GetFreshmeatRdf.php');
32 
33 class TestFreshmeatRdfs extends fossologyUnitTestCase
34 {
35 
36  function TestFMRdfs()
37  {
38  print "Starting TestFMRdfs\n";
39  // Get a rdf file from FM.
40  $Gfm = new GetFreshmeatRdf();
41  if($Gfm->get_rdf($Gfm->rdf_name))
42  {
43  print "wget failed, error code was:$Gfm->error_code\n";
44  print "Error message was:\n$Gfm->error_code\n";
45  }
46 
47  print "rdf name is:$Gfm->rdf_name\n";
48 
49  $Rdf = new FreshmeatRdfs($Gfm->rdf_name);
50 
51  echo "uncompressing\n";
52  if(!$Rdf->Uncompress($Gfm->rdf_name))
53  {
54  print "Uncompress return non zero status\n";
55  print "Error code was:$Rdf->error_code\n";
56  print "Error message was:\n$Rdf->error_out\n";
57  }
58 
59  echo "extracting\n";
60  $info = $Rdf->XtractProjInfo($Rdf->uncompressed_file);
61 
62  echo "info is:\n";
63  print_r($info);
64  }
65 }
66 ?>