FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
uploadUnpack.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2010 Hewlett-Packard Development Company, L.P.
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  ***********************************************************/
18 
33 require_once ('fossologyTestCase.php');
34 require_once ('TestEnvironment.php');
35 
36 global $URL;
37 global $PROXY;
38 
40 {
41  public $mybrowser;
42  public $webProxy;
43 
44  function setUp()
45  {
46  global $URL;
47  $this->Login();
48  }
49 
54  {
55  global $URL;
56  print "Creating Code Coveragefolder\n";
57  $page = $this->mybrowser->get($URL);
58  $this->createFolder(null, 'Code Coverage', null);
59  }
60 
61  function testuploadUnpack() {
62 
63  global $URL;
64  global $PROXY;
65 
66  print "starting testuploadUnpack\n";
67  $rootFolder = 1;
68  $upload = NULL;
69  $uploadList = array('TestData/archives/eddyData.tar.bz2',
70  'TestData/archives/foss23D1F1L.tar.bz2',
71  'TestData/licenses/gplv2.1',
72  'TestData/licenses/Affero-v1.0');
73  $urlList = array('http://downloads.sourceforge.net/simpletest/simpletest_1.0.1.tar.gz',
74  'http://www.gnu.org/licenses/gpl-3.0.txt',
75  'http://www.gnu.org/licenses/agpl-3.0.txt',
76  'http://osrb-1.fc.hp.com/~fosstester/fossology_1.1.1~20100622_all.deb');
77 
78  print "Starting file uploads\n";
79  foreach($uploadList as $upload) {
80  $description = "File $upload uploaded by Upload Test Data Test";
81  $this->uploadFile('Testing', $upload, $description, null, NULL);
82  }
83 
84  /* Upload the urls using upload from url. Check if the user specificed a
85  * web proxy for the environment. If so, set the attribute. */
86 
87  if(!(empty($PROXY)))
88  {
89  $this->webProxy = $PROXY;
90  }
91  print "Starting Url uploads\n";
92  foreach($urlList as $url)
93  {
94  $this->uploadUrl($rootFolder, $url, null, null, NULL);
95  }
96  }
97 }
98 ?>
createFolder($parent=null, $name, $description=null)
uploadFile($parentFolder, $uploadFile, $description=null, $uploadName=null, $agents=null)
testCreateTestingFolder()
uploadUrl($parentFolder=1, $url, $description=null, $uploadName=null, $agents=null)
Login($User=NULL, $Password=NULL)