FOSSology  3.2.0rc1
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 42 of file schedulerTest.php.

Member Function Documentation

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 200 of file schedulerTest.php.

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

Pull SPDX toolkit from github if not found.

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

Definition at line 263 of file schedulerTest.php.

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 223 of file schedulerTest.php.

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

Run jobs from queue.

Parameters
int$uploadId
int$jobId

Definition at line 185 of file schedulerTest.php.

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

Test SPDX2 agent for RDF.

Calls runAndTestReportRDF()

Definition at line 155 of file schedulerTest.php.

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

Test SPDX2 agent for RDF.

Calls runAndTestReportRDF() with a special uploadtree table

Definition at line 167 of file schedulerTest.php.

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

Use SPDX toolkit to verify RDF file format.

Parameters
string$filepathFile to verify

Definition at line 246 of file schedulerTest.php.

Member Data Documentation

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

DBManager to use

Definition at line 60 of file schedulerTest.php.

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

Group id to be used

Definition at line 51 of file schedulerTest.php.

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

SchedulerTestRunnerCli object

Definition at line 68 of file schedulerTest.php.

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

Test db

Definition at line 56 of file schedulerTest.php.

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

TestInstaller object

Definition at line 64 of file schedulerTest.php.

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

User id to be used

Definition at line 47 of file schedulerTest.php.


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