@Test public void testIncludingPageAfterOn() throws IOException { ExtractByOutlineParameters parameters = setUpParameters(1, "pdf/payslip_with_bookmarks.pdf", null); parameters.setIncludePageAfter(true); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertOutputContainsFilenames("1_Employee One.pdf", "3_Employee Three.pdf", "2_Employee Two.pdf"); testContext.assertOutputSize(3); testContext.assertPages("1_Employee One.pdf", 2); }
@Test public void testWithMatchingText() throws IOException { ExtractByOutlineParameters parameters = setUpParameters(3, "(Using)+.+"); parameters.setIncludePageAfter(true); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertOutputSize(3).assertPages("1_Using Profiles.pdf", 2) .assertPages("2_Using Profiles by OS.pdf", 2).assertPages("3_Using internal Repositories.pdf", 2); }
@Test public void testSplitAtTopLevel() throws IOException { ExtractByOutlineParameters parameters = setUpParameters(2); parameters.setIncludePageAfter(true); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertOutputContainsFilenames("1_Invoking Maven.pdf", "2_Creating a new Project jar.pdf", "3_Creating a new Project war.pdf", "4_Standard Project Structure.pdf", "5_Compiling.pdf", "6_Running Unit Tests Code Coverage.pdf", "7_Packaging jar war.pdf", "8_Installing Artifact in Local Repository.pdf", "9_Installing 3rdParty jar in local Repository.pdf", "10_Cleaning Up.pdf", "11_Creating Eclipse Project Structure.pdf", "12_Maven Project file pomxml.pdf", "13_Adding Dependencies.pdf", "14_Adding Developers.pdf", "15_Setting Compiler Version.pdf", "16_Assemblies and Profiles.pdf", "17_Versioning Repositories and Releases.pdf", "18_WebDevelopment.pdf" ).assertOutputSize(18).assertPages("17_Versioning Repositories and Releases.pdf", 2); }
@Test public void testWithMatchingTextAndOptimization() throws IOException { ExtractByOutlineParameters parameters = setUpParameters(3, "(Using)+.+"); parameters.setOptimizationPolicy(OptimizationPolicy.YES); parameters.setIncludePageAfter(true); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertOutputSize(3).assertPages("1_Using Profiles.pdf", 2) .assertPages("2_Using Profiles by OS.pdf", 2).assertPages("3_Using internal Repositories.pdf", 2); }