FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
OneShot-lgpl2.1-T.php
1 <?php
2 
3 
4 /***********************************************************
5  Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License
9  version 2 as published by the Free Software Foundation.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  ***********************************************************/
20 
32 require_once ('../../../tests/fossologyTestCase.php');
33 require_once ('../../../tests/TestEnvironment.php');
34 
35 global $URL;
36 
38 {
39  function setUp()
40  {
41  /* check to see if the user and material exist*/
42  $this->assertTrue(file_exists('/home/fosstester/.bashrc'),
43  "FAILURE! .bashrc not found\n");
44  $this->Login();
45  }
46 
47  function testOneShotTablegplv21()
48  {
49  global $URL;
50 
51  print "starting OneShotgplv21Test-Table\n";
52 
53  $loggedIn = $this->mybrowser->get($URL);
54  $this->assertTrue($this->myassertText($loggedIn, '/Upload/'),
55  "OneShotgplv21Test-Table FAILURE! Did not find Upload Menu\n");
56  $this->assertTrue($this->myassertText($loggedIn, '/One-Shot Analysis/'),
57  "OneShotgplv21Test-Table FAILURE! Did not find One-Shot Analysis Menu\n");
58 
59  $page = $this->mybrowser->get("$URL?mod=agent_license_once");
60  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
61  "OneShotgplv21Test-Table FAILURE! Did not find One-Shot License Analysis Title\n");
62  $this->assertTrue($this->myassertText($page, '/The analysis is done in real-time/'),
63  "OneShotgplv21Test-Table FAILURE! Did not find real-time Text\n");
64  $this->assertTrue($this->mybrowser->setField('licfile', '/home/fosstester/licenses/gplv2.1'));
65  /* select highlights' */
66  $this->assertTrue($this->mybrowser->setField('highlight', 1),
67  "OneShotgplv21Test-Table FAILURE! Could not click highlight\n");
68  $this->assertTrue($this->mybrowser->clickSubmit('Analyze!'),
69  "OneShotgplv21Test-Table FAILURE! Could not click Analyze button\n");
70  /* Check for the correct analysis....it should be 100% match, no partials */
71  //$page = $this->mybrowser->getContentAsText();
72  $page = $this->mybrowser->getContent();
73  //print "************ page a text (after analysis) *************\n$page\n";
74  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
75  "OneShotgplv21Test-Table FAILURE! Did not find One-Shot License Analysis Title\n");
76  $this->assertTrue($this->myassertText($page, '/Match/'),
77  "OneShotgplv21Test-Table FAILURE! Did not find text 'Match' \n");
78  $this->assertTrue($this->myassertText($page, '/100%/'),
79  "OneShotgplv21Test-Table FAILURE! Did not find '100percent\n");
80  $this->assertTrue($this->myassertText($page, '/LGPL v2\.1 Preamble/'),
81  "OneShotgplv21Test-Table FAILURE! Did not find 'LGPL v2.1 Preamble' \n");
82  $this->assertFalse($this->myassertText($page, '/-partial/'),
83  "OneShotgplv21Test-Table FAILURE! Found -partial in a non partial license file\n");
84  }
85 }
86 ?>
Login($User=NULL, $Password=NULL)