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

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

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

Public Member Functions

 testSpdxForNormalUploadtreeTable ()
 Test SPDX2 agent for RDF. More...
 
 testSpdxForSpecialUploadtreeTable ()
 Test SPDX2 agent for RDF. More...
 
 runJobFromJobque ($uploadId, $jobId)
 Run jobs from queue. More...
 
 getReportFilepathFromJob ($uploadId, $jobId)
 Get the file path for report from DB. More...
 
 runAndTestReportRDF ($uploadId=1)
 Create RDF report and check it. More...
 

Protected Member Functions

 setUp ()
 Setup test db.
 
 tearDown ()
 Teardown test db.
 
 verifyRdf ($filepath)
 Use SPDX toolkit to verify RDF file format. More...
 
 pullSpdxTools ()
 Pull SPDX toolkit from github if not found. More...
 
 verifyJavaIsInstalled ()
 Verify if java is intalled on the system.
 

Private Member Functions

 setUpRepo ()
 Setup test repo.
 
 rmRepo ()
 Teardown test repo.
 
 setUpTables ()
 Setup tables required for test.
 
 getHeartCount ($output)
 Get the heart count from agent.
 

Private Attributes

 $userId = 2
 
 $groupId = 2
 
 $testDb
 
 $dbManager
 
 $testInstaller
 
 $runnerCli
 

Detailed Description

Tests for SPDX2 agent and scheduler interaction.

Definition at line 32 of file schedulerTest.php.

Member Function Documentation

◆ getReportFilepathFromJob()

Fossology\SpdxTwo\Test\SchedulerTest::getReportFilepathFromJob (   $uploadId,
  $jobId 
)

Get the file path for report from DB.

Parameters
int$uploadId
int$jobId
Returns
string

Definition at line 190 of file schedulerTest.php.

◆ pullSpdxTools()

Fossology\SpdxTwo\Test\SchedulerTest::pullSpdxTools ( )
protected

Pull SPDX toolkit from github if not found.

  1. Verify if Java is installed
  2. Pull version 1.1.4
  3. Store only tools-java-1.1.4-jar-with-dependencies.jar
    Returns
    string Jar file path

Definition at line 253 of file schedulerTest.php.

◆ runAndTestReportRDF()

Fossology\SpdxTwo\Test\SchedulerTest::runAndTestReportRDF (   $uploadId = 1)

Create RDF report and check it.

Parameters
int$uploadIdDefault 1
Test:
  1. Run job from queue runJobFromJobque()
  2. Get the report path
  3. Check if report contains a known string
  4. Check if report does not contain emails
  5. Verify RDF format

Definition at line 213 of file schedulerTest.php.

◆ runJobFromJobque()

Fossology\SpdxTwo\Test\SchedulerTest::runJobFromJobque (   $uploadId,
  $jobId 
)

Run jobs from queue.

Parameters
int$uploadId
int$jobId

Definition at line 175 of file schedulerTest.php.

◆ testSpdxForNormalUploadtreeTable()

Fossology\SpdxTwo\Test\SchedulerTest::testSpdxForNormalUploadtreeTable ( )

Test SPDX2 agent for RDF.

Calls runAndTestReportRDF()

Definition at line 145 of file schedulerTest.php.

◆ testSpdxForSpecialUploadtreeTable()

Fossology\SpdxTwo\Test\SchedulerTest::testSpdxForSpecialUploadtreeTable ( )

Test SPDX2 agent for RDF.

Calls runAndTestReportRDF() with a special uploadtree table

Definition at line 157 of file schedulerTest.php.

◆ verifyRdf()

Fossology\SpdxTwo\Test\SchedulerTest::verifyRdf (   $filepath)
protected

Use SPDX toolkit to verify RDF file format.

Parameters
string$filepathFile to verify

Definition at line 236 of file schedulerTest.php.

Member Data Documentation

◆ $dbManager

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

DBManager to use

Definition at line 50 of file schedulerTest.php.

◆ $groupId

int Fossology\SpdxTwo\Test\SchedulerTest::$groupId = 2
private

Group id to be used

Definition at line 41 of file schedulerTest.php.

◆ $runnerCli

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

SchedulerTestRunnerCli object

Definition at line 58 of file schedulerTest.php.

◆ $testDb

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

Test db

Definition at line 46 of file schedulerTest.php.

◆ $testInstaller

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

TestInstaller object

Definition at line 54 of file schedulerTest.php.

◆ $userId

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

User id to be used

Definition at line 37 of file schedulerTest.php.


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