function testVerifyFossI16L518() { global $URL; global $name; global $safeName; print "starting VerifyFossI16L518 test\n"; $page = $this->mybrowser->clickLink('Browse'); $this->assertTrue($this->myassertText($page, '/Browse/'), "verifyFossI16L518 FAILED! Could not find Browse menu\n"); /* Testing folder */ $page = $this->mybrowser->clickLink('Testing'); //print "************ Page after upload link *************\n$page\n"; $this->assertTrue($this->myassertText($page, "/Browse/"), "verifyFossI16L518 FAILED! Browse Title not found\n"); $this->assertTrue($this->myassertText($page, "/{$safeName}/"), "verifyFossI16L518 FAILED! did not find {$name}\n"); $this->assertTrue($this->myassertText($page, "/>View</"), "verifyFossI16L518 FAILED! >View< not found\n"); $this->assertTrue($this->myassertText($page, "/>Meta</"), "verifyFossI16L518 FAILED! >Meta< not found\n"); $this->assertTrue($this->myassertText($page, "/>Download</"), "verifyFossI16L518 FAILED! >Download< not found\n"); /* Select archive */ $page = $this->mybrowser->clickLink($name); //print "************ Page after select foss archive *************\n$page\n"; $this->assertTrue($this->myassertText($page, "/fossology\\//")); /* Select fossology link */ $page = $this->mybrowser->clickLink('fossology/'); /* need to check that there are 16 items */ /* check that all the [xxx] items add to 519 */ $this->assertTrue($this->myassertText($page, "/Makefile/")); $this->assertTrue($this->myassertText($page, "/mkcheck\\.sh/"), "FAIL! did not find mkcheck.sh\n"); $this->assertTrue($this->myassertText($page, "/>View</"), "FAIL! >View< not found\n"); $this->assertTrue($this->myassertText($page, "/>Meta</"), "FAIL! >Meta< not found\n"); $this->assertTrue($this->myassertText($page, "/>Download</"), "FAIL! >Download< not found\n"); /* Select the License link to View License Historgram */ $browse = new parseBrowseMenu($page); $mini = new parseMiniMenu($page); $miniMenu = $mini->parseMiniMenu(); print "DEBUG: miniMenu is:\n"; print_r($miniMenu) . "\n"; $url = makeUrl($this->host, $miniMenu['License']); if ($url === NULL) { $this->fail("verifyFossI16L518 Failed, host is not set"); } $page = $this->mybrowser->get($url); //print "page after get of $url is:\n$page\n"; $this->assertTrue($this->myassertText($page, '/License Browser/'), "verifyFossI16L518 FAILED! License Browser Title not found\n"); $this->assertTrue($this->myassertText($page, '/Total licenses: 518/'), "verifyFossI16L518 FAILED! Total Licenses does not equal 518\n"); // get the 'Show' links and License color links $licTbl = new parseLicenseTbl($page); $licTable = $licTbl->parseLicenseTbl(); /* FIX THIS Select show 'Public Domain, verify, select 'LGPL v2.1', verify */ $pdURL = makeUrl($this->host, $licTable['Public Domain']); $lgplURL = makeUrl($this->host, $licTable['\'LGPL v2.1\'-style']); $page = $this->mybrowser->get($pdURL); $licFileList = new parseFolderPath($page, $URL); $fileCount = $licFileList->countFiles(); print "Checking the number of files based on Public Domain\n"; $this->assertEqual($fileCount, 4, "verifyFossI16L518 FAILED! Should be 4 files based on Public Domain got:{$fileCount}\n"); $page = $this->mybrowser->get($lgplURL); $licFileList->setPage($page); $flist = $licFileList->countFiles(); print "Checking the number of files based on LGPL v2.1-style\n"; $this->assertEqual($flist, 16, "verifyFossI16L518 FAILED! Should be 16 files based on LGPL v2.1-style got:{$flist}\n"); }
function testVerifyFossology() { global $URL; global $name; global $safeName; print "starting VerifyFoss23D1F1L test\n"; $page = $this->mybrowser->clickLink('Browse'); $this->assertTrue($this->myassertText($page, '/Browse/'), "verify23D1F1L FAILED! Could not find Browse menu\n"); $page = $this->mybrowser->clickLink('Testing'); //print "************ Page after upload link *************\n$page\n"; $this->assertTrue($this->myassertText($page, "/Browse/"), "verify23D1F1L FAILED! Browse Title not found\n"); $this->assertTrue($this->myassertText($page, "/{$safeName}/"), "verify23D1F1L FAILED! did not find {$name}\n"); $this->assertTrue($this->myassertText($page, "/>View</"), "verifyfoss23D1F1L FAILED! >View< not found\n"); $this->assertTrue($this->myassertText($page, "/>Meta</"), "verifyFoss23D1F1L FAILED! >Meta< not found\n"); $this->assertTrue($this->myassertText($page, "/>Download</"), "verifyFoss23D1F1L FAILED! >Download< not found\n"); /* Select archive */ $page = $this->mybrowser->clickLink($name); //print "************ Page after select foss archive *************\n$page\n"; $this->assertTrue($this->myassertText($page, "/foss23Dirs1File1Lic\\//"), "verifyfoss23D1F1L FAILED! 'foss23Dirs1File1Lic/' not found\n"); $this->assertTrue($this->myassertText($page, "/1 item/"), "verifyfoss23D1F1L FAILED! '1 item' not found\n"); /* Select fossology link */ $page = $this->mybrowser->clickLink('foss23Dirs1File1Lic/'); /* need to check that there are 9 items */ $this->assertTrue($this->myassertText($page, "/9 items/"), "verifyfoss23D1F1L FAILED! '9 items' not found\n"); $this->assertTrue($this->myassertText($page, "/agents/"), "verify23D1F1L FAILED! did not find 'agents' directory\n"); $this->assertTrue($this->myassertText($page, "/scheduler/"), "verify23D1F1L FAILED! did not find scheduler directory\n"); /* Select the License link to View License Historgram */ $browse = new parseBrowseMenu($page); $mini = new parseMiniMenu($page); $miniMenu = $mini->parseMiniMenu(); $url = makeUrl($this->host, $miniMenu['License']); if ($url === NULL) { $this->fail("verify23D1F1L Failed, host is not set"); } $page = $this->mybrowser->get($url); //print "page after get of $url is:\n$page\n"; $this->assertTrue($this->myassertText($page, '/License Browser/'), "verify23D1F1L FAILED! License Browser Title not found\n"); $this->assertTrue($this->myassertText($page, '/Total licenses: 2/'), "verify23D1F1L FAILED! Total Licenses does not equal 2\n"); // get the 'Show' links and License color links $licTbl = new parseLicenseTbl($page); $licTable = $licTbl->parseLicenseTbl(); //print "DB: licTable is:\n"; print_r($licTable) . "\n"; /* Select show 'GPL v2-stype', verify */ $gplv2URL = makeUrl($this->host, $licTable['\'GPL v2\'-style']); $page = $this->mybrowser->get($gplv2URL); $licFileList = new parseFolderPath($page, $URL); $tblList = $licFileList->parseFolderPath(); $tableCnt = count($tblList); print "Checking the number of files based on 'GPL v2'-style\n"; $this->assertEqual($tableCnt, 1); }