From a8359d2bed9213298b84fc2e7691ac426d6ef7a9 Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Tue, 17 Sep 2024 10:45:19 +0000 Subject: [PATCH] PDFBOX-5879: respect code conventions git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1920743 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/pdfbox/tools/TestExtractText.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/src/test/java/org/apache/pdfbox/tools/TestExtractText.java b/tools/src/test/java/org/apache/pdfbox/tools/TestExtractText.java index 9d8a82d6987..470e607c1da 100644 --- a/tools/src/test/java/org/apache/pdfbox/tools/TestExtractText.java +++ b/tools/src/test/java/org/apache/pdfbox/tools/TestExtractText.java @@ -47,9 +47,9 @@ class TestExtractText final PrintStream originalOut = System.out; final ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintStream printStream = null; - static final String testfile1 = "src/test/resources/org/apache/pdfbox/testPDFPackage.pdf"; - static final String testfile2 = "src/test/resources/org/apache/pdfbox/hello3.pdf"; - static final String testfile3 = "src/test/resources/org/apache/pdfbox/AngledExample.pdf"; + static final String TESTFILE1 = "src/test/resources/org/apache/pdfbox/testPDFPackage.pdf"; + static final String TESTFILE2 = "src/test/resources/org/apache/pdfbox/hello3.pdf"; + static final String TESTFILE3 = "src/test/resources/org/apache/pdfbox/AngledExample.pdf"; static String filename1 = null; static String filename2 = null; @@ -57,8 +57,8 @@ class TestExtractText public static void setupFilenames() { // the filename representation is platform dependent - filename1 = Paths.get(testfile1).toString(); - filename2 = Paths.get(testfile2).toString(); + filename1 = Paths.get(TESTFILE1).toString(); + filename2 = Paths.get(TESTFILE2).toString(); } @BeforeEach @@ -97,7 +97,7 @@ void testEmbeddedPDFs() throws Exception { ExtractText app = new ExtractText(); CommandLine cmd = new CommandLine(app); - int exitCode = cmd.execute("-i", testfile1, "-console"); + int exitCode = cmd.execute("-i", TESTFILE1, "-console"); assertEquals(0, exitCode); String result = out.toString("UTF-8"); @@ -119,7 +119,7 @@ void testAddFileName() throws Exception { ExtractText app = new ExtractText(); CommandLine cmd = new CommandLine(app); - int exitCode = cmd.execute("-i", testfile1, "-console", "-addFileName"); + int exitCode = cmd.execute("-i", TESTFILE1, "-console", "-addFileName"); assertEquals(0, exitCode); String result = out.toString("UTF-8"); @@ -139,8 +139,8 @@ void testAddFileName() throws Exception @Test void testPDFBoxRepeatableSubcommand() throws Exception { - PDFBox.main(new String[] { "export:text", "-i", testfile1, "-console", // - "export:text", "-i", testfile2, "-console" }); + PDFBox.main(new String[] { "export:text", "-i", TESTFILE1, "-console", // + "export:text", "-i", TESTFILE2, "-console" }); String result = out.toString("UTF-8"); assertTrue(result.contains("PDF1")); @@ -159,8 +159,8 @@ void testPDFBoxRepeatableSubcommand() throws Exception @Test void testPDFBoxRepeatableSubcommandAddFileName() throws Exception { - PDFBox.main(new String[] { "export:text", "-i", testfile1, "-console", "-addFileName", - "export:text", "-i", testfile2, "-console", "-addFileName" }); + PDFBox.main(new String[] { "export:text", "-i", TESTFILE1, "-console", "-addFileName", + "export:text", "-i", TESTFILE2, "-console", "-addFileName" }); String result = out.toString("UTF-8"); assertTrue(result.contains("PDF1")); @@ -193,9 +193,9 @@ void testPDFBoxRepeatableSubcommandAddFileNameOutfile(@TempDir Path tempDir) thr } assertNotNull(path); - PDFBox.main(new String[] { "export:text", "-i", testfile1, "-encoding", "UTF-8", + PDFBox.main(new String[] { "export:text", "-i", TESTFILE1, "-encoding", "UTF-8", "-addFileName", "-o", path.toString(), // - "export:text", "-i", testfile2, "-encoding", "UTF-8", // + "export:text", "-i", TESTFILE2, "-encoding", "UTF-8", // "-addFileName", "-o", path.toString() }); String result = new String(Files.readAllBytes(path), "UTF-8"); @@ -230,9 +230,9 @@ void testPDFBoxRepeatableSubcommandAddFileNameOutfileAppend(@TempDir Path tempDi } assertNotNull(path); - PDFBox.main(new String[] { "export:text", "-i", testfile1, "-encoding", "UTF-8", + PDFBox.main(new String[] { "export:text", "-i", TESTFILE1, "-encoding", "UTF-8", "-addFileName", "-o", path.toString(), // - "export:text", "-i", testfile2, "-encoding", "UTF-8", + "export:text", "-i", TESTFILE2, "-encoding", "UTF-8", "-addFileName", "-o", path.toString(), "-append" }); String result = new String(Files.readAllBytes(path), "UTF-8"); @@ -267,7 +267,7 @@ void testRotationMagic(@TempDir Path tempDir) throws Exception } assertNotNull(path); - PDFBox.main(new String[] { "export:text", "-rotationMagic", "-i", testfile3, + PDFBox.main(new String[] { "export:text", "-rotationMagic", "-i", TESTFILE3, "-o", path.toString() }); String result = new String(Files.readAllBytes(path), "UTF-8");