@@ -0,0 +1,2870 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.pdfbox.examples.pdmodel;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport org.apache.pdfbox.Loader;%0Aimport org.apache.pdfbox.pdmodel.PDDocument;%0Aimport org.apache.pdfbox.text.PDFTextStripper;%0Aimport org.junit.jupiter.api.Assertions;%0A%0Aimport org.junit.jupiter.api.BeforeAll;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.parallel.Execution;%0Aimport org.junit.jupiter.api.parallel.ExecutionMode;%0A%0A/**%0A *%0A * @author Tilman Hausherr%0A */%0A@Execution(ExecutionMode.CONCURRENT)%0Aclass TestHelloWorld%0A%7B%0A    private static final String OUTPUT_DIR = %22target/test-output%22;%0A%0A    @BeforeAll%0A    public static void init() throws Exception%0A    %7B%0A        new File(OUTPUT_DIR).mkdirs();%0A    %7D%0A%0A    @Test%0A    void testHelloWorldTTF() throws IOException%0A    %7B%0A        String outputFile = OUTPUT_DIR + %22/HelloWorldTTF.pdf%22;%0A        String message = %22HelloWorldTTF.pdf%22;%0A        String fontFile = %22../pdfbox/src/main/resources/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf%22;%0A%0A        new File(outputFile).delete();%0A%0A        String%5B%5D args = new String%5B%5D %7B outputFile, message, fontFile %7D;%0A        HelloWorldTTF.main(args);%0A%0A        checkOutputFile(outputFile, message);%0A%0A        new File(outputFile).delete();%0A    %7D%0A%0A    @Test%0A    void testHelloWorld() throws IOException%0A    %7B%0A        String outputDir = %22target/test-output%22;%0A        String outputFile = outputDir + %22/HelloWorld.pdf%22;%0A        String message = %22HelloWorld.pdf%22;%0A%0A        new File(outputFile).delete();%0A%0A        String%5B%5D args = new String%5B%5D %7B outputFile, message %7D;%0A        HelloWorld.main(args);%0A%0A        checkOutputFile(outputFile, message);%0A%0A        new File(outputFile).delete();%0A    %7D%0A%0A    private void checkOutputFile(String outputFile, String message) throws IOException%0A    %7B%0A        try (PDDocument doc = Loader.loadPDF(new File(outputFile)))%0A        %7B%0A            PDFTextStripper stripper = new PDFTextStripper();%0A            String extractedText = stripper.getText(doc).trim();%0A            Assertions.assertEquals(message, extractedText);%0A        %7D%0A    %7D%0A%7D%0A

add tests for two HelloWorld examples