Skip to content

Commit

Permalink
Merge pull request #109 from georgetarazevich/Update-tests-for-pdf/a-…
Browse files Browse the repository at this point in the history
…and-pdf/ua-#221

Update test policy files for pdf/a & pdf/ua #221
  • Loading branch information
MaximPlusov authored Aug 31, 2023
2 parents 0e7ec78 + 10bd412 commit 33b8246
Show file tree
Hide file tree
Showing 19 changed files with 195 additions and 128 deletions.
20 changes: 13 additions & 7 deletions PDF_A-1a/564/resulticbe852e3-c9ed-4668-998b-203d2a354a06.sch
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,30 @@

<sch:pattern name = "Checking the batchSummary">
<sch:rule context="/report/batchSummary">
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '1')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '1'
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '0')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '0'
</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the logs"> <sch:rule context="/report/jobs/job">
<sch:pattern name = "Checking the logs">
<sch:rule context="/report/jobs/job">
<sch:assert test="count(logs) = 1">Failed check, Expected: contains logs</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs">
<sch:assert test="@logsCount = '4'">Failed check, Expected: 4</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Incorrect xref section") and @occurrences = "3" and @level = "WARNING") or
(contains(., ".pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Incorrect xref section' with 3 occurrences, or
'WARNING: resulticbe852e3-c9ed-4668-998b-203d2a354a06.pdf doesn't appear to be a valid PDF.' with 1 occurrences</sch:assert>
<sch:assert test='(contains(., "pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect xref section(offset = 226333)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect xref section(offset = 227776)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect xref section(offset = 228688)") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: resulticbe852e3-c9ed-4668-998b-203d2a354a06.pdf doesn't appear to be a valid PDF.' with 1 occurrences, or
'WARNING: Incorrect xref section(offset = 226333)' with 1 occurrences, or
'WARNING: Incorrect xref section(offset = 227776)' with 1 occurrences, or
'WARNING: Incorrect xref section(offset = 228688)' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
6 changes: 3 additions & 3 deletions PDF_A-1b/1042/hello.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<sch:pattern name = "Checking the taskException">
<sch:rule context="/report/jobs/job/taskException">
<sch:assert test='contains(exceptionMessage, "Exception: Caught unexpected runtime exception during validation caused by exception: Error while parsing object : 5 0 caused by exception: PDFParser::GetDictionary()invalid pdf dictonary")'>
Failed check, Expected Error: Exception: Caught unexpected runtime exception during validation caused by exception: Error while parsing object : 5 0 caused by exception: PDFParser::GetDictionary()invalid pdf dictonary
<sch:assert test='contains(exceptionMessage, "Exception: Caught unexpected runtime exception during validation caused by exception: Error while parsing object : 5 0 caused by exception: invalid pdf dictonary(object key = 5 0 obj, offset = 573)")'>
Failed check, Expected Error: Exception: Caught unexpected runtime exception during validation caused by exception: Error while parsing object : 5 0 caused by exception: invalid pdf dictonary(object key = 5 0 obj, offset = 573)
</sch:assert>
</sch:rule>
</sch:pattern>
Expand All @@ -34,7 +34,7 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Exception caught when validating item") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
<sch:assert test='(contains(., "Exception caught when validating item") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Exception caught when validating item' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>
Expand Down
16 changes: 8 additions & 8 deletions PDF_A-1b/1051/00.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<sch:pattern name = "Checking the taskException">
<sch:rule context="/report/jobs/job/taskException">
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: PDFParser::GetXRefSection(...)can not locate xref table")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: PDFParser::GetXRefSection(...)can not locate xref table
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: can not locate xref table")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: can not locate xref table
</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the batchSummary">
<sch:rule context="/report/batchSummary">
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '1')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '1'
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '0')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '0'
</sch:assert>
</sch:rule>
</sch:pattern>
Expand All @@ -34,10 +34,10 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Stream length is missing") and @occurrences = "1" and @level = "WARNING") or
(contains(., ".pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Stream length is missing' with 1 occurrences, or
'WARNING: 00.pdf doesn't appear to be a valid PDF.' with 1 occurrences</sch:assert>
<sch:assert test='(contains(., "pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Stream length is missing(offset = 40)") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: 00.pdf doesn't appear to be a valid PDF.' with 1 occurrences, or
'WARNING: Stream length is missing(offset = 40)' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
16 changes: 8 additions & 8 deletions PDF_A-1b/1051/10.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<sch:pattern name = "Checking the taskException">
<sch:rule context="/report/jobs/job/taskException">
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: PDFParser::GetXRefSection(...)can not locate xref table")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: PDFParser::GetXRefSection(...)can not locate xref table
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: can not locate xref table")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: can not locate xref table
</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the batchSummary">
<sch:rule context="/report/batchSummary">
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '1')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '1'
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '0')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '0'
</sch:assert>
</sch:rule>
</sch:pattern>
Expand All @@ -34,10 +34,10 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Stream length is missing") and @occurrences = "1" and @level = "WARNING") or
(contains(., ".pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Stream length is missing' with 1 occurrences, or
'WARNING: 10.pdf doesn't appear to be a valid PDF.' with 1 occurrences</sch:assert>
<sch:assert test='(contains(., "pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Stream length is missing(offset = 31)") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: 10.pdf doesn't appear to be a valid PDF.' with 1 occurrences, or
'WARNING: Stream length is missing(offset = 31)' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
20 changes: 12 additions & 8 deletions PDF_A-1b/1051/12.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<sch:pattern name = "Checking the taskException">
<sch:rule context="/report/jobs/job/taskException">
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: Trailer is empty or has invalid type")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: Trailer is empty or has invalid type
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: Trailer is empty or has invalid type(offset = 712)")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: Trailer is empty or has invalid type(offset = 712)
</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the batchSummary">
<sch:rule context="/report/batchSummary">
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '1')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '1'
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '0')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '0'
</sch:assert>
</sch:rule>
</sch:pattern>
Expand All @@ -34,10 +34,14 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Incorrect end of line in cross-reference table.") and @occurrences = "3" and @level = "WARNING") or
(contains(., ".pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Incorrect end of line in cross-reference table.' with 3 occurrences, or
'WARNING: 12.pdf doesn't appear to be a valid PDF.' with 1 occurrences</sch:assert>
<sch:assert test='(contains(., "pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 633)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 668)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 690)") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: 12.pdf doesn't appear to be a valid PDF.' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 633)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 668)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 690)' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
24 changes: 16 additions & 8 deletions PDF_A-1b/1051/14.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<sch:pattern name = "Checking the taskException">
<sch:rule context="/report/jobs/job/taskException">
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: Trailer is empty or has invalid type")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: Trailer is empty or has invalid type
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: Trailer is empty or has invalid type(offset = 686)")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: Trailer is empty or has invalid type(offset = 686)
</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the batchSummary">
<sch:rule context="/report/batchSummary">
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '1')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '1'
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '0')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '0'
</sch:assert>
</sch:rule>
</sch:pattern>
Expand All @@ -34,10 +34,18 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Incorrect end of line in cross-reference table.") and @occurrences = "5" and @level = "WARNING") or
(contains(., ".pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Incorrect end of line in cross-reference table.' with 5 occurrences, or
'WARNING: 14.pdf doesn't appear to be a valid PDF.' with 1 occurrences</sch:assert>
<sch:assert test='(contains(., "pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 591)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 611)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 631)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 651)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 671)") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: 14.pdf doesn't appear to be a valid PDF.' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 591)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 611)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 631)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 651)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 671)' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
22 changes: 14 additions & 8 deletions PDF_A-1b/1051/15.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<sch:pattern name = "Checking the taskException">
<sch:rule context="/report/jobs/job/taskException">
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: Trailer is empty or has invalid type")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: Trailer is empty or has invalid type
<sch:assert test='contains(exceptionMessage, "Exception: Couldn&apos;t parse stream caused by exception: Trailer is empty or has invalid type(offset = 710)")'>
Failed check, Expected Error: Exception: Couldn't parse stream caused by exception: Trailer is empty or has invalid type(offset = 710)
</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the batchSummary">
<sch:rule context="/report/batchSummary">
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '1')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '1'
<sch:assert test="(@totalJobs = '1' and @failedToParse = '1' and @encrypted = '0' and @outOfMemory = '0' and @veraExceptions = '0')">
Failed check, Expected: totalJobs = '1' failedToParse = '1' encrypted = '0' outOfMemory = '0' veraExceptions = '0'
</sch:assert>
</sch:rule>
</sch:pattern>
Expand All @@ -34,10 +34,16 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Incorrect end of line in cross-reference table.") and @occurrences = "4" and @level = "WARNING") or
(contains(., ".pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Incorrect end of line in cross-reference table.' with 4 occurrences, or
'WARNING: 15.pdf doesn't appear to be a valid PDF.' with 1 occurrences</sch:assert>
<sch:assert test='(contains(., "pdf doesn&apos;t appear to be a valid PDF.") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 591)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 611)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 625)") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect end of line in cross-reference table.(offset = 645)") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: 15.pdf doesn't appear to be a valid PDF.' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 591)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 611)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 625)' with 1 occurrences, or
'WARNING: Incorrect end of line in cross-reference table.(offset = 645)' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
Loading

0 comments on commit 33b8246

Please sign in to comment.