function __construct($testDescription)
 {
     parent::__construct($testDescription);
 }
 public function testC1()
 {
     $this->logger->info('START test C1  :');
     $testProperty = new TestProperty(Constants::TEST_INCOMING_REGISTRYENTRY_SIGNEDOFF);
     try {
         $allDocumentChecksumTest = new Test(Constants::TEST_INCOMING_REGISTRYENTRY_SIGNEDOFF, $testProperty);
         // We don't call $allDocumentChecksumTest->runTest because the test is handled
         // in ArkivstrukturDocumentChecksumTest durnig parsing of the file
         $akivstrukturParser = new AllIncomingRegistryEntrySignedOff();
         $this->parseFile($akivstrukturParser, $this->arkivstrukturFilename);
         $akivstrukturParser->testOver();
         $numberIncomingRegistryEntryfound = $akivstrukturParser->getNumberIncomingRegistryEntryfound();
         if ($akivstrukturParser->getErrorsEncountered() == true) {
             $numberRegistryEntryWithError = $akivstrukturParser->getNumberErrorsEncountered();
             $this->logger->error(' RESULT (' . $numberIncomingRegistryEntryfound . ') incoming registryentry processed. (' . $numberRegistryEntryWithError . ') missing a signoff/avskrivning');
             $testProperty->addTestResultReportDescription('Det var funnet feil med sjeksumm av filer i dokument mappen. Antall feil funnet er ' . $akivstrukturParser->getNumberErrorsEncountered() . ' logfilen inneholder en liste av filer som ble sjekket');
             $this->testProperty->setTestResult(false);
         } else {
             $this->logger->info(' RESULT All incoming registryentry, count (' . $numberIncomingRegistryEntryfound . ') are processed without error');
         }
         $this->testResultsHandler->addResult($testProperty, Constants::TEST_TYPE_C1);
     } catch (Exception $e) {
         $this->logger->error("Error when attempting test " . $testProperty->getDescription() . ". The following exception occured " . $e);
     }
     $this->logger->info('END test C1');
     $this->logger->info('');
 }
 public function test6()
 {
     $testProperty = new TestProperty(Constants::TEST_COUNT_DOCUMENTS);
     $extractionInfo = $this->arkivUtrekk->getExtractionInfo();
     if ($this->numberOfDocumentsInDirectory != -1 && $this->numberOfDocumentsInDirectory == $extractionInfo->getAntallDokumentfiler()) {
         $testProperty->addTestResult(true);
         $testProperty->addTestResultDescription('Number of documents identified in ' . Constants::NAME_ARKIVUTTREKK_XML . 'is correct. Number identified is ' . $extractionInfo->getAntallDokumentfiler());
     } else {
         $this->testProperty->addTestResult(false);
         $this->testProperty->addTestResultDescription('Number of documents identified in ' . Constants::NAME_ARKIVUTTREKK_XML . 'is in correct. Number identified is ' . $extractionInfo->getAntallDokumentfiler() . ' while number of documents found is ' . $this->numberOfDocumentsInDirectory);
     }
     $this->testResultsHandler->addResult($testProperty, Constants::TEST_TYPE_A6);
     print $testProperty . PHP_EOL;
 }
Example #4
0
$defaultMemoryLimit = '1024M';
if (isset($options["m"]) == true) {
    $defaultMemoryLimit = $options["m"];
}
$logger->info('Starting up ' . Constants::TOOL_NAME);
$logger->info('Setting memory_limit to ' . $defaultMemoryLimit);
ini_set('memory_limit', $defaultMemoryLimit);
$directory = $options["d"];
$testType = $options["t"];
$testTypeVersion = $options["v"];
$infoFile = $options["i"];
$testResultsHandler = new TestResultsHandler();
if (strcasecmp($testType, Constants::TEST_TYPE_NOARK5) == 0 && strcasecmp($testTypeVersion, Constants::TEST_TYPE_NOARK5_VERSION_31) == 0) {
    $logger->trace('Before starting the amount of memory used is ' . memory_get_usage(false));
    $logger->trace('Before starting the amount of real memory used is ' . memory_get_usage(true));
    $testProperty = new TestProperty(Constants::TEST_STANDARD_NOARK5_TEST);
    $testProperty->setTestResult(true);
    // Assume test will be true until otherwise proven wrong
    $standardTest = new StandardTest(Constants::TEST_STANDARD_NOARK5_TEST, $directory, $testResultsHandler, $infoFile, $noark5StructureFile, null, $testProperty);
    $standardTest->runTest();
    if ($testProperty->getTestResult() == true) {
        $logger->info('Standardtest completed without any errors');
    } else {
        $logger->info('Standardtest completed with errors. ' . $testProperty->getDescription());
    }
    $logger->trace('After standardTest, the amount of memory used is ' . memory_get_usage(false));
    $logger->trace('After standardTest, the amount of real memory used is ' . memory_get_usage(true));
}
$reportBuilder = new ReportBuilder($testResultsHandler);
$reportBuilder->createDocument();
exit;