diff --git a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/AbstractTestCorpus.java b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/AbstractTestCorpus.java index 6f2342d..2953787 100644 --- a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/AbstractTestCorpus.java +++ b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/AbstractTestCorpus.java @@ -148,9 +148,9 @@ public boolean equals(Object obj) { public enum Corpus { VERA("veraPDF", EnumSet.of(PDFAFlavour.PDFA_1_A, PDFAFlavour.PDFA_1_B, PDFAFlavour.PDFA_2_A, PDFAFlavour.PDFA_2_B, - PDFAFlavour.PDFA_2_U, - PDFAFlavour.PDFA_3_B, PDFAFlavour.PDFA_4, PDFAFlavour.PDFA_4_F, PDFAFlavour.PDFA_4_E, - PDFAFlavour.PDFUA_1, PDFAFlavour.PDFUA_2), + PDFAFlavour.PDFA_2_U, PDFAFlavour.PDFA_3_B, PDFAFlavour.PDFA_4, PDFAFlavour.PDFA_4_F, + PDFAFlavour.PDFA_4_E, PDFAFlavour.PDFUA_1, PDFAFlavour.PDFUA_2, + PDFAFlavour.WTPDF_1_0_REUSE, PDFAFlavour.WTPDF_1_0_ACCESSIBILITY), URI.create(VERA_URL), "veraCorp-"), ISARTOR("Isartor", EnumSet.of(PDFAFlavour.PDFA_1_B), URI.create(ISARTOR_URL), "isartCorp-"), BFO("BFO", EnumSet.of(PDFAFlavour.PDFA_2_B), URI.create(BFO_URL), "bfoCorp-"), diff --git a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/GitHubBackedProfileDirectory.java b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/GitHubBackedProfileDirectory.java index 15b9694..96fd9c2 100644 --- a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/GitHubBackedProfileDirectory.java +++ b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/GitHubBackedProfileDirectory.java @@ -24,6 +24,7 @@ package org.verapdf.pdfa.qa; import org.verapdf.pdfa.flavours.PDFAFlavour; +import org.verapdf.pdfa.flavours.PDFFlavours; import org.verapdf.pdfa.validation.profiles.ProfileDirectory; import org.verapdf.pdfa.validation.profiles.Profiles; import org.verapdf.pdfa.validation.profiles.ValidationProfile; @@ -111,15 +112,12 @@ public static ProfileDirectory fromBranch(final String branchName) { return new GitHubBackedProfileDirectory(branchName); } private static Set fromGitHubBranch(final String branchName) { - String PDFApathPrefix = GITHUB_ROOT + branchName + PDFA_PROFILE_PATH_PART + PDFA_PROFILE_PREFIX; - String PDFUApathPrefix = GITHUB_ROOT + branchName + PDFUA_PROFILE_PATH_PART + PDFUA_PROFILE_PREFIX; Set profileSet = new HashSet<>(); for (PDFAFlavour flavour : PDFAFlavour.values()) { if (flavour == PDFAFlavour.NO_FLAVOUR || flavour.getPart().getFamily() == PDFAFlavour.SpecificationFamily.WCAG) { continue; } - String profileURLString = (flavour.getPart().getFamily() != PDFAFlavour.SpecificationFamily.PDF_UA ? PDFApathPrefix : PDFUApathPrefix) - + flavour.getPart().getPartNumber() + flavour.getLevel().getCode().toUpperCase() + XML_SUFFIX; + String profileURLString = getProfilePath(flavour, branchName); try { URL profileURL = new URL(profileURLString); ValidationProfile profile = Profiles.profileFromXml(profileURL.openStream()); @@ -137,4 +135,30 @@ private static Set fromGitHubBranch(final String branchName) } return profileSet; } + + private static String getProfilePath(PDFAFlavour flavour, String branchName) { + StringBuilder profilePath = new StringBuilder(); + profilePath.append(GITHUB_ROOT); + profilePath.append(branchName); + if ((PDFFlavours.isWTPDFFlavour(flavour) || PDFFlavours.isPDFUARelatedFlavour(flavour))) { + profilePath.append(PDFUA_PROFILE_PATH_PART); + } else { + profilePath.append(PDFA_PROFILE_PATH_PART); + } + profilePath.append(flavour.getPart().getFamily().getFamily().replace("/", "")); //$NON-NLS-1$ + profilePath.append("-"); //$NON-NLS-1$ + profilePath.append(flavour.getPart().getPartNumber()); + if (flavour.getPart().getSubpartNumber() != null) { + profilePath.append("-"); //$NON-NLS-1$ + profilePath.append(flavour.getPart().getSubpartNumber()); + } + if (PDFFlavours.isWTPDFFlavour(flavour)) { + profilePath.append("-"); //$NON-NLS-1$ + profilePath.append(flavour.getLevel().getCode()); + } else { + profilePath.append(flavour.getLevel().getCode().toUpperCase()); //$NON-NLS-1$ + } + profilePath.append(XML_SUFFIX); + return profilePath.toString(); + } } diff --git a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ResultSetImpl.java b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ResultSetImpl.java index ec4b8ff..a868369 100644 --- a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ResultSetImpl.java +++ b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ResultSetImpl.java @@ -23,6 +23,7 @@ import org.verapdf.pdfa.PDFAParser; import org.verapdf.pdfa.PDFAValidator; import org.verapdf.pdfa.flavours.PDFAFlavour; +import org.verapdf.pdfa.flavours.PDFFlavours; import org.verapdf.pdfa.results.ValidationResult; import org.verapdf.pdfa.validation.profiles.Profiles; import org.verapdf.pdfa.validation.profiles.ValidationProfile; @@ -31,10 +32,7 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.adapters.XmlAdapter; import java.lang.management.ManagementFactory; -import java.util.HashSet; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; +import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; @@ -199,6 +197,10 @@ public String toString() { * @return */ public static ResultSet validateCorpus(final TestCorpus corpus, final PDFAValidator validator, final PDFAFlavour flavour) { + if (Foundries.defaultParserIsPDFBox() && PDFFlavours.isWTPDFFlavour(flavour)) { + return new ResultSetImpl(corpus.getDetails(), corpus.getType().getId(), validator.getProfile(), + Collections.emptySet(), Collections.emptySet(), null, 0); + } Set results = new HashSet<>(); Set exceptions = new HashSet<>(); Components.Timer batchTimer = Components.Timer.start(); diff --git a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ZipBackedTestCorpus.java b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ZipBackedTestCorpus.java index 2464162..80bab71 100644 --- a/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ZipBackedTestCorpus.java +++ b/veraPDF-integration/src/main/java/org/verapdf/pdfa/qa/ZipBackedTestCorpus.java @@ -25,6 +25,7 @@ import org.apache.commons.codec.digest.DigestUtils; import org.verapdf.pdfa.flavours.PDFAFlavour; +import org.verapdf.pdfa.flavours.PDFFlavours; import java.io.File; import java.io.FileInputStream; @@ -118,6 +119,9 @@ public static boolean checkFlavour(final String item, final PDFAFlavour flavour) if (flavour == PDFAFlavour.PDFUA_1) { return item.contains("PDF_UA-1"); } + if (PDFFlavours.isWTPDFFlavour(flavour)) { + return item.contains("PDF_UA-2"); + } if (flavour == PDFAFlavour.PDFUA_2) { return item.contains("PDF_UA-2"); } diff --git a/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-gf.yml b/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-gf.yml index 7ca2798..65b0225 100644 --- a/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-gf.yml +++ b/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-gf.yml @@ -36,6 +36,18 @@ "ua2": [ ] + "wt1r": + [ + "5-t2-pass-a", + "8.2.5.28.2-t1-fail-a", + "8.7-t2-fail-a", + "8.11.2-t1-fail-a", + "8.11.2-t1-fail-b" + ] + "wt1a": + [ + "5-t2-pass-a" + ] "BFO": "2b": [ diff --git a/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-pdfbox.yml b/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-pdfbox.yml index 647a4ba..707f5b9 100644 --- a/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-pdfbox.yml +++ b/veraPDF-integration/src/test/resources/org/verapdf/integration/tests/rules/corpus-pdfbox.yml @@ -296,6 +296,12 @@ "8.11.1-t1-pass-a", "8.11.2-t1-pass-a" ] + "wt1r": + [ + ] + "wt1a": + [ + ] "BFO": "2b": [