Skip to content

Commit

Permalink
PDFBOX-5879: respect code conventions
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1920743 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Sep 17, 2024
1 parent 0b2939f commit a8359d2
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tools/src/test/java/org/apache/pdfbox/tools/TestExtractText.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ 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;

@BeforeAll
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
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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"));
Expand All @@ -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"));
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit a8359d2

Please sign in to comment.