@@ -0,0 +1,2258 @@
+package org.lockss.plugin.ojs3;%0A%0Aimport org.lockss.test.LockssTestCase;%0Aimport org.lockss.test.MockArchivalUnit;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Apublic class TestOJS3ArchivalUnit extends LockssTestCase %7B%0A%0A    private MockArchivalUnit mau;%0A%0A    private String PDF_PATTERN_STRING = %22%5E(journals/)?(index%5C%5C.php/)?(%25s/)?article/(view(File)?%7Cdownload)/%5B%5E/%5D+/%5B%5E/?#&amp;.%5D+$%22;%0A%0A    public void setUp() throws Exception %7B%0A        super.setUp();%0A        mau = new MockArchivalUnit();%0A    %7D%0A%0A    public void testSubstancePattern() throws Exception %7B%0A%0A        //  https://www.clei.org/cleiej/index.php/cleiej/article/download/437/372/1777%0A        //  https://scholarworks.iu.edu/journals/index.php/psource/issue/view/1257/14%0A        //  https://journals.library.ualberta.ca/jpps/index.php/JPPS/article/download/29659/21487/80185%0A        String pdfString1 = %22cleiej/index.php/cleiej/article/download/437/372/1777%22;%0A        String pdfString3 = %22jpps/index.php/JPPS/article/download/29659/21487/80185%22;%0A        String pdfString2 = %22journals/index.php/psource/issue/view/1257/14%22; // this is a valid pdf%0A%0A        // Good cases%0A        // http://trumpeter.athabascau.ca/index.php/trumpet/article/download/1508/1739%0A        // http://trumpeter.athabascau.ca/index.php/trumpet/article/view/1508/1739%0A        String pdfString4 = %22index.php/trumpet/article/download/1508/1739%22;%0A        String pdfString5 = %22index.php/trumpet/article/view/1508/1739%22;%0A%0A        //testReplacement(pdfString1, %22cleiej%22);%0A        testReplacement(pdfString3, %22jpps%22);%0A        //testReplacement(pdfString2, %22psource%22);%0A%0A        // These should success%0A        testReplacement(pdfString4, %22trumpet%22);%0A        testReplacement(pdfString5, %22trumpet%22);%0A    %7D%0A%0A    public void testReplacement(String pdfUrl, String journalID) %7B%0A%0A        String replacedPDFPattern = PDF_PATTERN_STRING.replaceAll(%22%25s%22, journalID);%0A%0A        //log.info(%22journalID = %22 + journalID + %22, replacedPDFPattern = %22 + replacedPDFPattern + %22, pdfUrl = %22 + pdfUrl);%0A%0A        Pattern PDF_PATTERN = Pattern.compile(replacedPDFPattern, Pattern.CASE_INSENSITIVE);%0A        Matcher mat = PDF_PATTERN.matcher(pdfUrl);%0A        boolean patternMatched = mat.matches();%0A%0A        assertTrue(patternMatched);%0A    %7D%0A%0A%7D%0A%0A

add test cases to test different pattern for OJS3