FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Reuser\Test\SchedulerTest Class Reference

Tests for Reuser agent and scheduler interaction. More...

Inheritance diagram for Fossology\Reuser\Test\SchedulerTest:
Inheritance graph
Collaboration diagram for Fossology\Reuser\Test\SchedulerTest:
Collaboration graph

Public Member Functions

 testReuserMockedScanWithoutAnyUploadToCopyAndNoClearing ()
 Call runnerReuserScanWithoutAnyUploadToCopyAndNoClearing() More...
 
 testReuserRealScanWithoutAnyUploadToCopyAndNoClearing ()
 Call runnerReuserScanWithoutAnyUploadToCopyAndNoClearing() More...
 
 testReuserMockedScanWithoutAnyUploadToCopyAndAClearing ()
 Call runnerReuserScanWithoutAnyUploadToCopyAndAClearing() More...
 
 testReuserRealScanWithoutAnyUploadToCopyAndAClearing ()
 Call runnerReuserScanWithoutAnyUploadToCopyAndAClearing() More...
 
 testReuserMockedScanWithALocalClearing ()
 Call runnerReuserScanWithALocalClearing() More...
 
 testReuserRealScanWithALocalClearing ()
 Call runnerReuserScanWithALocalClearing() More...
 
 testReuserMockedScanWithARepoClearing ()
 Call runnerReuserScanWithARepoClearing() More...
 
 testReuserRealScanWithARepoClearing ()
 Call runnerReuserScanWithARepoClearing() More...
 
 testReuserRealScanWithARepoClearingEnhanced ()
 Call runnerReuserScanWithARepoClearingEnhanced() More...
 

Protected Member Functions

 setUp ()
 Setup test env.
 
 tearDown ()
 Tear down test env.
 
 insertDecisionFromTwoEvents ($scope=DecisionScopes::ITEM, $originallyClearedItemId=23)
 Creates two clearing decisions. More...
 

Private Member Functions

 setUpRepo ()
 Setup test repo.
 
 rmRepo ()
 Tear down test repo.
 
 setUpTables ()
 Setup tables required by the agent.
 
 getHeartCount ($output)
 Get the heart count from agent.
 
 getFilteredClearings ($uploadId, $groupId)
 Get clearings for a given upload id. More...
 
 runnerReuserScanWithoutAnyUploadToCopyAndNoClearing (SchedulerTestRunner $runner)
 Test on an upload with no clearing decisions. More...
 
 runnerReuserScanWithoutAnyUploadToCopyAndAClearing ($runner)
 Run reuser agent with no upload to copy decisions from. More...
 

Private Attributes

 $groupId = 3
 
 $userId = 2
 
 $testDb
 
 $dbManager
 
 $testInstaller
 
 $licenseDao
 
 $clearingDao
 
 $copyrightDao
 
 $clearingDecisionFilter
 
 $uploadDao
 
 $uploadPermDao
 
 $highlightDao
 
 $treeDao
 
 $runnerCli
 
 $runnerMock
 

Detailed Description

Tests for Reuser agent and scheduler interaction.

Definition at line 47 of file schedulerTest.php.

Member Function Documentation

◆ getFilteredClearings()

Fossology\Reuser\Test\SchedulerTest::getFilteredClearings (   $uploadId,
  $groupId 
)
private

Get clearings for a given upload id.

Parameters
int$uploadId
int$groupId
Returns
ClearingDecision[]

Definition at line 224 of file schedulerTest.php.

◆ insertDecisionFromTwoEvents()

Fossology\Reuser\Test\SchedulerTest::insertDecisionFromTwoEvents (   $scope = DecisionScopes::ITEM,
  $originallyClearedItemId = 23 
)
protected

Creates two clearing decisions.

Parameters
int$scope
int$originallyClearedItemId
Returns
ClearingLicense[]

Definition at line 282 of file schedulerTest.php.

◆ runnerReuserScanWithoutAnyUploadToCopyAndAClearing()

Fossology\Reuser\Test\SchedulerTest::runnerReuserScanWithoutAnyUploadToCopyAndAClearing (   $runner)
private

Run reuser agent with no upload to copy decisions from.

Parameters
SchedulerTestRunner$runner

Definition at line 334 of file schedulerTest.php.

◆ runnerReuserScanWithoutAnyUploadToCopyAndNoClearing()

Fossology\Reuser\Test\SchedulerTest::runnerReuserScanWithoutAnyUploadToCopyAndNoClearing ( SchedulerTestRunner  $runner)
private

Test on an upload with no clearing decisions.

Parameters
SchedulerTestRunner$runner

Definition at line 258 of file schedulerTest.php.

◆ testReuserMockedScanWithALocalClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserMockedScanWithALocalClearing ( )

Call runnerReuserScanWithALocalClearing()

Test:
  1. Create an upload with clearing decisions on files
  2. Run reuser on the upload new upload with mock agent
  3. Check if clearing decisions are added
  4. Check if the clearing decisions have new ids
  5. Check the clearing type and scope are retained
  6. Check the upload tree id of the clearing decision

Definition at line 364 of file schedulerTest.php.

◆ testReuserMockedScanWithARepoClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserMockedScanWithARepoClearing ( )

Call runnerReuserScanWithARepoClearing()

Test:
  1. Create an upload with license clearing done
  2. Run reuser with mock agent
  3. Check if new upload has clearings
  4. Reuser should have not created a new clearing decision and reuse them
  5. Decision types and scopes are same
  6. Reuser should have not created a correct local event history

Definition at line 443 of file schedulerTest.php.

◆ testReuserMockedScanWithoutAnyUploadToCopyAndAClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserMockedScanWithoutAnyUploadToCopyAndAClearing ( )

Call runnerReuserScanWithoutAnyUploadToCopyAndAClearing()

Test:
  1. Run reuser on the empty upload with agent mock
  2. Check that no clearing decisions added by reuser

Definition at line 314 of file schedulerTest.php.

◆ testReuserMockedScanWithoutAnyUploadToCopyAndNoClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserMockedScanWithoutAnyUploadToCopyAndNoClearing ( )

Call runnerReuserScanWithoutAnyUploadToCopyAndNoClearing()

Test:
  1. Setup an upload with no clearing decisions
  2. Run reuser on the empty upload with mock agent
  3. Check that no clearing decisions added by reuser

Definition at line 237 of file schedulerTest.php.

◆ testReuserRealScanWithALocalClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserRealScanWithALocalClearing ( )

Call runnerReuserScanWithALocalClearing()

Test:
  1. Create an upload with clearing decisions on files
  2. Run reuser on the upload new upload with scheduler cli
  3. Check if clearing decisions are added
  4. Check if the clearing decisions have new ids
  5. Check the clearing type and scope are retained
  6. Check the upload tree id of the clearing decision

Definition at line 379 of file schedulerTest.php.

◆ testReuserRealScanWithARepoClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserRealScanWithARepoClearing ( )

Call runnerReuserScanWithARepoClearing()

Test:
  1. Create an upload with license clearing done
  2. Run reuser with scheduler cli
  3. Check if new upload has clearings
  4. Reuser should have not created a new clearing decision and reuse them
  5. Decision types and scopes are same
  6. Reuser should have not created a correct local event history

Definition at line 458 of file schedulerTest.php.

◆ testReuserRealScanWithARepoClearingEnhanced()

Fossology\Reuser\Test\SchedulerTest::testReuserRealScanWithARepoClearingEnhanced ( )

Call runnerReuserScanWithARepoClearingEnhanced()

Test:
  1. Create an upload with license clearing done
  2. Create an upload with files with small difference
  3. Run reuser with mock agent
  4. Check if new upload has clearings
  5. Reuser should have not created a new clearing decision and reuse them
  6. Decision types and scopes are same
  7. Reuser should have not created a correct local event history

Definition at line 541 of file schedulerTest.php.

◆ testReuserRealScanWithoutAnyUploadToCopyAndAClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserRealScanWithoutAnyUploadToCopyAndAClearing ( )

Call runnerReuserScanWithoutAnyUploadToCopyAndAClearing()

Test:
  1. Run reuser on the empty upload with scheduler cli
  2. Check that no clearing decisions added by reuser

Definition at line 325 of file schedulerTest.php.

◆ testReuserRealScanWithoutAnyUploadToCopyAndNoClearing()

Fossology\Reuser\Test\SchedulerTest::testReuserRealScanWithoutAnyUploadToCopyAndNoClearing ( )

Call runnerReuserScanWithoutAnyUploadToCopyAndNoClearing()

Test:
  1. Setup an upload with no clearing decisions
  2. Run reuser on the empty upload with scheduler cli
  3. Check that no clearing decisions added by reuser

Definition at line 249 of file schedulerTest.php.

Member Data Documentation

◆ $clearingDao

ClearingDao Fossology\Reuser\Test\SchedulerTest::$clearingDao
private

ClearingDao object

Definition at line 76 of file schedulerTest.php.

◆ $clearingDecisionFilter

ClearingDecisionFilter Fossology\Reuser\Test\SchedulerTest::$clearingDecisionFilter
private

ClearingDecisionFilter object

Definition at line 84 of file schedulerTest.php.

◆ $copyrightDao

CopyrightDao Fossology\Reuser\Test\SchedulerTest::$copyrightDao
private

CopyrightDao object

Definition at line 80 of file schedulerTest.php.

◆ $dbManager

DbManager Fossology\Reuser\Test\SchedulerTest::$dbManager
private

DBManager to use

Definition at line 64 of file schedulerTest.php.

◆ $groupId

int Fossology\Reuser\Test\SchedulerTest::$groupId = 3
private

Group id to use

Definition at line 52 of file schedulerTest.php.

◆ $highlightDao

HighlightDao Fossology\Reuser\Test\SchedulerTest::$highlightDao
private

Highlight Dao

Definition at line 96 of file schedulerTest.php.

◆ $licenseDao

LicenseDao Fossology\Reuser\Test\SchedulerTest::$licenseDao
private

LicenseDao object

Definition at line 72 of file schedulerTest.php.

◆ $runnerCli

SchedulerTestRunnerCli Fossology\Reuser\Test\SchedulerTest::$runnerCli
private

Scheduler interface

Definition at line 105 of file schedulerTest.php.

◆ $runnerMock

SchedulerTestRunnerMock Fossology\Reuser\Test\SchedulerTest::$runnerMock
private

Test runner

Definition at line 110 of file schedulerTest.php.

◆ $testDb

TestPgDb Fossology\Reuser\Test\SchedulerTest::$testDb
private

Test db

Definition at line 60 of file schedulerTest.php.

◆ $testInstaller

TestInstaller Fossology\Reuser\Test\SchedulerTest::$testInstaller
private

TestInstaller object

Definition at line 68 of file schedulerTest.php.

◆ $treeDao

Mock TreeDao Fossology\Reuser\Test\SchedulerTest::$treeDao
private

Tree dao

Definition at line 100 of file schedulerTest.php.

◆ $uploadDao

UploadDao Fossology\Reuser\Test\SchedulerTest::$uploadDao
private

Upload Dao

Definition at line 88 of file schedulerTest.php.

◆ $uploadPermDao

UploadPermissionDao Fossology\Reuser\Test\SchedulerTest::$uploadPermDao
private

Upload permission

Definition at line 92 of file schedulerTest.php.

◆ $userId

int Fossology\Reuser\Test\SchedulerTest::$userId = 2
private

User id to use

Definition at line 56 of file schedulerTest.php.


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