Ejemplo n.º 1
0
 public function testA9()
 {
     $this->logger->info('START test A9: Calculate and check the checksum value of arkivuttrekk.xml against the value specified in info.xml');
     try {
         $checksumValue = $this->infoFileDetails->getChecksumInfo()->getChecksumValue();
         $checksumAlgorithm = $this->infoFileDetails->getChecksumInfo()->getChecksumAlgorithm();
         $testProperty = new TestProperty(Constants::TEST_CHECKSUM);
         $checksumTest = new ChecksumTest(Constants::TEST_CHECKSUM, Constants::NAME_ARKIVUTTREKK_XML, $this->directory, $checksumAlgorithm, $checksumValue, $testProperty);
         $checksumTest->runTest();
         if ($testProperty->getTestResult() == true) {
             $this->logger->info(' RESULT The checksum for arkivuttrekk.xml, specified in info.xml has been checked and found to be correct');
         } else {
             $this->logger->error(' RESULT The checksum for arkivuttrekk.xml, specified in info.xml has been checked and found to be incorrect!. See logfile for details');
         }
         $this->testResultsHandler->addResult($testProperty, Constants::TEST_TYPE_A9);
         $checksumTest = null;
     } catch (Exception $e) {
         $this->logger->error("Error when attempting test " . $testProperty->getDescription() . ". The following exception occured " . $e);
     }
     $this->logger->info('END test A9');
     $this->logger->info('');
 }
Ejemplo n.º 2
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;