FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
OneShot-lgpl2.1.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2008 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  ***********************************************************/
28 require_once ('../../../tests/fossologyTestCase.php');
29 require_once ('../../../tests/TestEnvironment.php');
30 
31 global $URL;
32 
34 {
35  public $mybrowser;
36 
37  function setUp()
38  {
39  /* check to see if the user and material exist*/
40  $this->assertTrue(file_exists('/home/fosstester/.bashrc'),
41  "OneShotgplv21Test FAILURE! .bashrc not found\n");
42  $this->Login();
43  }
44 
45  function testOneShotgplv21()
46  {
47  global $URL;
48 
49  print "starting OneShotgplv21Test\n";
50  $loggedIn = $this->mybrowser->get($URL);
51  $this->assertTrue($this->myassertText($loggedIn, '/Upload/'),
52  "OneShotgplv21Test FAILED! Did not find Upload Menu\n");
53  $this->assertTrue($this->myassertText($loggedIn, '/One-Shot Analysis/'),
54  "OneShotgplv21Test FAILED! Did not find One-Shot Analysis Menu\n");
55 
56  $page = $this->mybrowser->get("$URL?mod=agent_nomos_once");
57  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
58  "OneShotgplv21Test FAILED! Did not find One-Shot License Analysis Title\n");
59  $this->assertTrue($this->myassertText($page, '/The analysis is done in real-time/'),
60  "OneShotgplv21Test FAILED! Did not find real-time Text\n");
61 
62  $this->assertTrue($this->mybrowser->setField('licfile', '/home/fosstester/licenses/gplv2.1'));
63  /* we won't select highlights' */
64  $this->assertTrue($this->mybrowser->clickSubmit('Analyze!'),
65  "FAILED! Count not click Analyze button\n");
66  /* Check for the correct analysis.... */
67  $page = $this->mybrowser->getContent();
68  $this->assertTrue($this->myassertText($page, '/LGPL_v2\.1/'),
69  "OneShotgplv21Test FAILED! Did not find exactly 'LGPL_v2.1'\n");
70 
71  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
72  "OneShotgplv21Test FAILED! Did not find One-Shot License Analysis Title\n");
73  // should not see -partial anymore
74  $this->assertFalse($this->myassertText($page, '/-partial/'),
75  "OneShotgplv21Test FAILED! Found -partial in a non partial license file\n");
76  }
77 }
78 ?>
testOneShotgplv21()
Run NOMOS on GPL_v2.1 license.
Run one-shot license analysis on LGPL_v2.1 license.
Login($User=NULL, $Password=NULL)