FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
fossologyTestCase Class Reference

Inherits fossologyTest.

Inherited by AddUserTest, BasicFolderTest, browseUPloadedTest, cleanupRF, cleanupTestData, CreateDeleteFldrTest, CreateFolderTest, createSuiUsers, createUIUsers, DeleteFolderTest, DupFolderTest, DupUploadTest, DupUserTest, EditFolderDescriptionOnlyTest, EditFolderNameOnlyTest, EditFolderTest, EmailUserTest, FoldersCreateMenuTest, FoldersDeleteMenuTest, FoldersEditMenuTest, FoldersMoveMenuTest, MoveFolderTest, MoveFolderTest, myFirstTest, noEmailUserTest, OneShotgplv21Test, OneShotTablegplv21Test, rhelTest, runMyTest, SearchMenuTest, someTest, TestAboutMenu, TestRepoLogin, UploadFileMenuTest, UploadFileTest, UploadInstructMenuTest, UploadOneShotMenuTest, UploadsDeleteMenuTest, UploadServerMenuTest, UploadsMoveMenuTest, uploadSrvDirTest, uploadSrvFileTest, UploadSrvTest, uploadTestDataTest, uploadTestDataTest, uploadUnpack, UploadUrlMenuTest, UploadUrlTest, uploadWEMailTest, uploadWoutEMailTest, userEditAnyTest, verify23D1F1L, verify23D1F1L, verify23D1F1L, verifyDirsOnly, verifyDirsOnly, verifyDirsOnly, verifyFossolyTest, verifyFossolyTest, verifyFossolyTest, verifySimpletest, verifySimpletest, and zendTest.

Collaboration diagram for fossologyTestCase:
Collaboration graph

Public Member Functions

 addUser ($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify= 'y')
 
 checkEmailNotification ($number)
 
 createFolder ($parent=null, $name, $description=null)
 
 deleteFolder ($folder)
 
 deleteUpload ($upload)
 
 deleteUser ($User)
 
 editFolder ($folder, $newName, $description=null)
 
 editUser ($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Block=NULL, $Blank=NULL, $Password=NULL, $EmailNotify= 'y')
 
 moveUpload ($oldFolder, $destFolder, $upload)
 
 mvFolder ($folder, $destination)
 
 fillGroupForm ($groupName, $user)
 
 uploadFile ($parentFolder, $uploadFile, $description=null, $uploadName=null, $agents=null)
 
 uploadServer ($parentFolder=1, $uploadPath, $description=null, $uploadName=null, $agents=null)
 
 uploadUrl ($parentFolder=1, $url, $description=null, $uploadName=null, $agents=null)
 
 wait4jobs ()
 
 dbCheck ()
 
 jobsSummary ()
 
 jobsDetail ()
 
 oneShotLicense ()
 
 rmLicAnalysis ()
 
- Public Member Functions inherited from fossologyTest
 getBrowser ()
 
 getCookie ()
 
 getPassword ()
 
 getUser ()
 
 setBrowser ($browser)
 
 setmyCookie ($cookie)
 
 setPassword ($password)
 
 setUser ($user)
 
 pmm ($test)
 
 plt ($test)
 
 createTestFolder ($name, $parent='root')
 
 getFolderId ($folderName, $page, $selectName)
 
 getUploadId ($uploadName, $page, $selectName)
 
 Login ($User=NULL, $Password=NULL)
 
 Logout ($User=NULL)
 
 myassertText ($page, $pattern)
 
 parseSelectStmnt ($page, $selectName, $optionText=NULL)
 
 parseFossjobs ($all=NULL)
 
 setAgents ($agents=NULL)
 

Public Attributes

 $mybrowser
 
 $debug
 
 $webProxy
 
- Public Attributes inherited from fossologyTest
 $mybrowser
 
 $cookie
 
 $debug
 

Protected Member Functions

 setUserFields ($UserName=NULL, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Block=NULL, $Blank=NULL, $Password=NULL, $EmailNotify=NULL, $BucketPool=1, $Ui= 'simple')
 
- Protected Member Functions inherited from fossologyTest
 _browser ()
 
 getSelectAttr ($page, $selectName)
 
 setSelectAttr ($page, $selectName, $attribute, $value=NULL)
 

Additional Inherited Members

- Protected Attributes inherited from fossologyTest
 $User = NULL
 

Detailed Description

fossologyTestCase

Base class for all fossology tests. All fossology tests should extend this class. This class contains methods to interact with the fossology UI menus and forms.

Definition at line 43 of file fossologyTestCase.php.

Member Function Documentation

fossologyTestCase::addUser (   $UserName,
  $Description = NULL,
  $Email = NULL,
  $Access = 1,
  $Folder = 1,
  $Password = NULL,
  $EmailNotify = 'y' 
)

addUser

Create a Fossology user

Parameters
string$UserNamethe user name
string$Descriptiona description of the user
string$Emailthe email address for the user
int$Access,theaccess level for the user, valid values are: 0,1,2,3,4,5,6,7,10.
string$Folder,thefolder for the user....can be a 'number'
string$Passwordthe password for the user
string$EmailNotifyeither null or 'y'. Default is 'y'.
Returns
null on success, prints error on fail.

Definition at line 65 of file fossologyTestCase.php.

fossologyTestCase::checkEmailNotification (   $number)

checkEmailNotification

Verify that the user got the email they were supposed to and that it said all the jobs finished without errors.

Parameters
int$numberis the number of emails that should have been received actually write code that uses the number!
Returns
NULL on success, array on failure: The array will with contain an error message starting with the string ERROR! or it will contain a list of non compliant email headers.

NOTE: this test uses the function getMailSubjects, which will fail:

  • if the user running this test is not the same user as the mail file being checked, /var/mail/<user-name> is only readable by that user-name.

use exceptions here, so you can indicated the correct item.

Definition at line 118 of file fossologyTestCase.php.

fossologyTestCase::createFolder (   $parent = null,
  $name,
  $description = null 
)

createFolder Uses the UI 'Create' menu to create a folder. Always creates a default description. To change the default descritpion, pass a description in.

Assumes the caller is already logged into the Repository

Parameters
string$parentthe parent folder name the folder will be created as a child of the parent folder. If no name is supplied the root folder will be used for the parent folder.
string$namethe name of the folder to be created
string$descriptionOptional user defined description, a default description is always created.
Returns
exists with failure or returns folder id.

Definition at line 188 of file fossologyTestCase.php.

fossologyTestCase::deleteFolder (   $folder)

deleteFolder

Remove a folder and all it's contents. This is a very dangerous method. It does not check who the parent is... so don't have duplicate folder names. This method works for testing as we don't have duplicate folder names (yet). When we do, this routine will have to talk to the db.

Parameters
$string$folder the name of the folder to remove. Only leaf folder names.
Returns
boolean

Definition at line 254 of file fossologyTestCase.php.

fossologyTestCase::deleteUpload (   $upload)

deleteUpload

delete an uploaded file under the root folder.

This method can only remove uploads under the root folder. It does not talk to the db (yet) so can only 'see' the root folder. All other uploads stored in subfolders have their pages dyamically generated by javascript.

Parameters
$string$upload the upload name to delete.
Returns
boolean

Definition at line 286 of file fossologyTestCase.php.

fossologyTestCase::deleteUser (   $User)

Delete a fossology user

Parameters
string$User,theuser name to remove

Definition at line 310 of file fossologyTestCase.php.

fossologyTestCase::editFolder (   $folder,
  $newName,
  $description = null 
)

editFolder

Parameters
string$folderthe folder to edit
string$newNamethe new name for the folder
string$descriptionOptional description, default description is always created, to overide the default, supply a descrtion.

Assumes that the caller has already logged in.

Definition at line 350 of file fossologyTestCase.php.

fossologyTestCase::editUser (   $UserName,
  $Description = NULL,
  $Email = NULL,
  $Access = 1,
  $Folder = 1,
  $Block = NULL,
  $Blank = NULL,
  $Password = NULL,
  $EmailNotify = 'y' 
)

addUser

Edit a Fossology user

Parameters
string$UserNamethe user name
string$Descriptiona description of the user
string$Emailthe email address for the user
int$Access,theaccess level for the user, valid values are: 0,1,2,3,4,5,6,7,10.
string$Folder,thefolder for the user....can be a 'number'
string$Block,checkbox for blocking user, default is NULL
string$Blankcheck box for blanking the users account, default is NULL
string$Passwordthe password for the user
string$EmailNotifyeither null or 'y'. Default is 'y'.
Returns
null on success, prints error on fail.

Definition at line 395 of file fossologyTestCase.php.

fossologyTestCase::fillGroupForm (   $groupName,
  $user 
)

fillGroupForm($groupName, $user) fill in the manage group fields

Parameters
string$groupNamethe name of the group to create
string$userthe user who will admin the group.
Returns
NULL on success, string on error

Definition at line 521 of file fossologyTestCase.php.

fossologyTestCase::moveUpload (   $oldFolder,
  $destFolder,
  $upload 
)

moveUpload($oldfFolder, $destFolder, $upload)

NOTE: this routine was never finished, the screen uses java script. SO only items in the root folder can be moved....

fix so it only does thnigs with the root folder :)

Moves an upload from one folder to another. Assumes the caller has logged in.

Parameters
string$oldFolderthe folder name where the upload currently is stored.
string$destFolderthe folder where the updload will be moved to. If no folder specified, then the root folder will be used.
string$uploadThe upload to move

Definition at line 438 of file fossologyTestCase.php.

fossologyTestCase::mvFolder (   $folder,
  $destination 
)

mvFolder

Move a folder via the UI

Parameters
string$folderthe folder name to move.
string$destinationthe destination folder to move the folder to. Default is the root folder.

Definition at line 485 of file fossologyTestCase.php.

fossologyTestCase::setUserFields (   $UserName = NULL,
  $Description = NULL,
  $Email = NULL,
  $Access = 1,
  $Folder = 1,
  $Block = NULL,
  $Blank = NULL,
  $Password = NULL,
  $EmailNotify = NULL,
  $BucketPool = 1,
  $Ui = 'simple' 
)
protected

setUserFields

utility function for the user methods.

Parameters
string$UserName

Definition at line 572 of file fossologyTestCase.php.

fossologyTestCase::uploadFile (   $parentFolder,
  $uploadFile,
  $description = null,
  $uploadName = null,
  $agents = null 
)

uploadFile ($parentFolder,$uploadFile,$description=null,$uploadName=null,$agents=null)

Upload a file and optionally schedule the agents.

Parameters
string$parentFolderthe parent folder name, default is root folder (1)
string$uploadFilethe path to the file to upload
string$description,=nulloptonal description
string$uploadName,=nulloptional upload name
Todo:
add ability to specify uploadName
Returns
pass or fail

Definition at line 726 of file fossologyTestCase.php.

fossologyTestCase::uploadServer (   $parentFolder = 1,
  $uploadPath,
  $description = null,
  $uploadName = null,
  $agents = null 
)

uploadServer ($parentFolder,$uploadPath,$description=null,$uploadName=null,$agents=null)

Upload a file and optionally schedule the agents. The web-site must already be logged into before using this method.

Parameters
string$parentFolderthe parent folder name, default is root folder (1)
string$uploadPaththe path to upload data, can be a file or directory
string$descriptiona default description is always used. It can be overridden by supplying a description.
string$uploadName,=nulloptional upload name
string$agents,=nullagents to schedule
Returns
pass or fail

determine if setting alpha folders is worth it. Right now this routine does not use them.....

Definition at line 802 of file fossologyTestCase.php.

fossologyTestCase::uploadUrl (   $parentFolder = 1,
  $url,
  $description = null,
  $uploadName = null,
  $agents = null 
)

function uploadUrl ($parentFolder,$uploadFile,$description=null,$uploadName=null,$agents=null)

Upload a file and optionally schedule the agents. The web-site must already be logged into before using this method.

Parameters
string$parentFolderthe parent folder name, default is root folder (1)
string$urlthe url of the file to upload, no url sanity checking is done.
string$descriptiona default description is always used. It can be overridden by supplying a description.
string$uploadName,=nulloptional upload name
string$agents,=nullagents to schedule, the default is to schedule license, pkgettametta, and mime.
Returns
pass or fail

Definition at line 877 of file fossologyTestCase.php.

fossologyTestCase::wait4jobs ( )

wait4jobs

Are there any jobs running?

Wait for 2 hours for the test jobs to finish, check every 5 minutes to see if they are done.

Returns
boolean TRUE/FALSE
Version
"$Id: fossologyTestCase.php 4020 2011-03-31 21:30:29Z rrando $"

: make a general program that can wait an arbitrary time, should also allow for an interval, e.g. check for 2 hours every 7 min.

Created on Jan. 15, 2009

Definition at line 952 of file fossologyTestCase.php.


The documentation for this class was generated from the following file: