@@ -0,0 +1,1230 @@
+/*%0A * Copyright 2017 Datalogics, Inc.%0A */%0A%0Apackage com.datalogics.pdf.samples.manipulation;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport com.adobe.pdfjt.services.pdfa2.PDFA2ConformanceLevel;%0A%0Aimport com.datalogics.pdf.samples.SampleTest;%0A%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.net.URL;%0A%0A/**%0A * Tests the ConvertToPdfA2 sample.%0A */%0Apublic class ConvertToPdfA2Test extends SampleTest %7B%0A%0A    private static final String FILE_NAME = %22ConvertedPdfa-2b.pdf%22;%0A%0A    @Test%0A    public void testConvertToPdfA2B() throws Exception %7B%0A        final URL inputUrl = ConvertToPdfA2.class.getResource(ConvertToPdfA2.INPUT_PDF_PATH);%0A        final File outputFile = newOutputFileWithDelete(FILE_NAME);%0A        final URL outputUrl = outputFile.toURI().toURL();%0A%0A        ConvertToPdfA2.convertToPdfA2(inputUrl, outputUrl, PDFA2ConformanceLevel.Level_2b);%0A        // Make sure the Output file exists.%0A        assertTrue(outputFile.getPath() + %22 must exist after run%22, outputFile.exists());%0A%0A        // Validate the converted document%0A        final boolean validity = ConvertToPdfA2.validate(outputUrl, PDFA2ConformanceLevel.Level_2b);%0A        assertTrue(outputFile.getPath() + %22 must be pdfa2-b compliant%22, validity);%0A    %7D%0A%7D%0A

Test the ConvertToPdfA2 sample