pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r907868 - in /pdfbox/trunk: ./ src/test/java/org/apache/pdfbox/pdfparser/ src/test/java/org/apache/pdfbox/pdmodel/ src/test/java/org/apache/pdfbox/util/ src/test/resources/input/ src/test/resources/pdfparser/ src/test/resources/pdfreader/ t...
Date Tue, 09 Feb 2010 01:15:00 GMT
Author: jukka
Date: Tue Feb  9 01:15:00 2010
New Revision: 907868

URL: http://svn.apache.org/viewvc?rev=907868&view=rev
Log:
PDFBOX-545: Switch PDFBox build to Maven

Use the Maven directory layout for the test files.

Added:
    pdfbox/trunk/src/test/resources/input/
      - copied from r907855, pdfbox/trunk/test/input/
    pdfbox/trunk/src/test/resources/pdfparser/
      - copied from r907855, pdfbox/trunk/test/pdfparser/
    pdfbox/trunk/src/test/resources/pdfreader/
      - copied from r907855, pdfbox/trunk/test/pdfreader/
Removed:
    pdfbox/trunk/test/
Modified:
    pdfbox/trunk/build.xml
    pdfbox/trunk/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
    pdfbox/trunk/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java
    pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java
    pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
    pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripperPerformance.java

Modified: pdfbox/trunk/build.xml
URL: http://svn.apache.org/viewvc/pdfbox/trunk/build.xml?rev=907868&r1=907867&r2=907868&view=diff
==============================================================================
--- pdfbox/trunk/build.xml (original)
+++ pdfbox/trunk/build.xml Tue Feb  9 01:15:00 2010
@@ -26,7 +26,7 @@
     <property name="target.dir" value="target" />
     <property name="dest.dir" value="${target.dir}/classes" />
     <property name="test.dir" value="src/test/java" />
-    <property name="testfiles.dir" value="test" />
+    <property name="testfiles.dir" value="src/test/resources" />
     <property name="bin.dir" value="bin" />
     <property name="website.dir" value="website" />
     <property name="website.build.dir" value="${website.dir}/build/site" />
@@ -91,8 +91,9 @@
     <property name="antlr.url" value="${maven.repo2}/antlr/antlr/2.7.6/antlr-2.7.6.jar"
/>
     <property name="antlr.jar" value="${tool.dir}/antlr.jar" />
 
-    <property name="testoutput.dir" value="${testfiles.dir}/output"/>
-    <property name="testoutput-ext.dir" value="${testfiles.dir}/output-ext"/>
+    <property name="testoutput.dir" value="${target.dir}/test-output"/>
+    <property name="testoutput-ext.dir" value="${target.dir}/test-output-ext"/>
+    <property name="testinput-ext.dir" value="${target.dir}/test-input-ext"/>
     <property name="jiraattachment.url" value="http://issues.apache.org/jira/secure/attachment"/>
     <property name="testfiles1.url" value="${jiraattachment.url}/12413230/input-ext1.jar"/>
     <property name="testfiles1.jar" value="${download.dir}/input-ext1.jar"/>
@@ -227,13 +228,13 @@
 
     <target name="find.testfiles">
         <available property="testfiles.found"
-                   file="${testfiles.dir}/input-ext"
+                   file="${testinput-ext.dir}"
                    type="dir"/>
     </target>
 
-	<target name="get.testfiles" 
-		unless="testfiles.found" depends="find.testfiles" 
-		description="Download additional testfiles without suitable license to add them to svn">
+    <target name="get.testfiles" 
+            unless="testfiles.found" depends="find.testfiles" 
+            description="Download additional testfiles without suitable license to add them
to svn">
         <antcall target="downloadfile">
             <param name="sourcefile" value="${testfiles1.url}"/>
             <param name="destfile" value="${testfiles1.jar}"/>
@@ -254,14 +255,14 @@
             <param name="sourcefile" value="${testfiles.encryption.url}"/>
             <param name="destfile" value="${testfiles.encryption.jar}"/>
         </antcall>
-		<unjar src="${testfiles1.jar}" dest="${testfiles.dir}/input-ext"/>
-		<unjar src="${testfiles2.jar}" dest="${testfiles.dir}/input-ext"/>
-		<unjar src="${testfiles3.jar}" dest="${testfiles.dir}/input-ext"/>
-		<unjar src="${testfiles.rendering.jar}" dest="${testfiles.dir}/input-ext"/>
-		<unjar src="${testfiles.encryption.jar}" dest="${testfiles.dir}/input-ext"/>
-	</target>
+        <unjar src="${testfiles1.jar}" dest="${testinput-ext.dir}"/>
+        <unjar src="${testfiles2.jar}" dest="${testinput-ext.dir}"/>
+        <unjar src="${testfiles3.jar}" dest="${testinput-ext.dir}"/>
+        <unjar src="${testfiles.rendering.jar}" dest="${testinput-ext.dir}"/>
+        <unjar src="${testfiles.encryption.jar}" dest="${testinput-ext.dir}"/>
+    </target>
 
-	<target name="testextract" depends="clean,compile" description="Test text extraction">
+    <target name="testextract" depends="clean,compile" description="Test text extraction">
         <junit printsummary="off" fork="on" dir=".">
             <jvmarg value="-Xmx1024M"/>
             <jvmarg value="-Xms512M"/>

Modified: pdfbox/trunk/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java?rev=907868&r1=907867&r2=907868&view=diff
==============================================================================
--- pdfbox/trunk/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java (original)
+++ pdfbox/trunk/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java Tue Feb  9 01:15:00
2010
@@ -92,7 +92,7 @@
         PDDocument doc = null;
         try
         {
-           doc = PDDocument.load( "test/pdfparser/genko_oc_shiryo1.pdf");
+           doc = PDDocument.load( "src/test/resources/pdfparser/genko_oc_shiryo1.pdf");
         }
         finally
         {

Modified: pdfbox/trunk/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java?rev=907868&r1=907867&r2=907868&view=diff
==============================================================================
--- pdfbox/trunk/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java (original)
+++ pdfbox/trunk/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java Tue Feb  9 01:15:00
2010
@@ -45,12 +45,12 @@
  */
 public class TestFDF extends TestCase
 {
-    
-    private static final String PDF_FDEB = "test/input-ext/fdeb.pdf";
-    private static final String PDF_LOTSOFFIELDS = "test/input-ext/pdf_with_lots_of_fields.pdf";
-    private static final String PDF_FREEDOM = "test/input-ext/FreedomExpressions.pdf";
-    private static final String FDF_FREEDOM = "test/input-ext/FreedomExpressions.fdf";
-    
+
+    private static final String PDF_FDEB = "target/test-input-ext/fdeb.pdf";
+    private static final String PDF_LOTSOFFIELDS = "target/test-input-ext/pdf_with_lots_of_fields.pdf";
+    private static final String PDF_FREEDOM = "target/test-input-ext/FreedomExpressions.pdf";
+    private static final String FDF_FREEDOM = "target/test-input-ext/FreedomExpressions.fdf";
+
     /**
      * Constructor.
      *

Modified: pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java?rev=907868&r1=907867&r2=907868&view=diff
==============================================================================
--- pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java (original)
+++ pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java Tue Feb  9 01:15:00
2010
@@ -160,10 +160,10 @@
         throws Exception
     {
         String filename = System.getProperty("org.apache.pdfbox.util.TextStripper.file");
-        String inDir = new String("test/input/rendering/");
-        String outDir = new String("test/output/rendering/");
-        String inDirExt = new String("test/input-ext/rendering/");
-        String outDirExt = new String("test/output-ext/rendering/");
+        String inDir = "src/test/resources/input/rendering";
+        String outDir = "target/test-output/rendering";
+        String inDirExt = "target/test-input-ext/rendering";
+        String outDirExt = "target/test-output-ext/rendering";
 
             if ((filename == null) || (filename.length() == 0))
             {

Modified: pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripper.java?rev=907868&r1=907867&r2=907868&view=diff
==============================================================================
--- pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripper.java (original)
+++ pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripper.java Tue Feb  9 01:15:00
2010
@@ -43,9 +43,9 @@
  *
  * This test suite is designed to test PDFTextStripper using a set of PDF
  * files and known good output for each.  The default mode of testAll()
- * is to process each *.pdf file in "test/input".  An output file is
- * created in "test/output" with the same name as the PDF file, plus an
- * additional ".txt" suffix.  
+ * is to process each *.pdf file in "src/test/resources/input".  An output
+ * file is created in "target/test-output" with the same name as the PDF file,
+ * plus an additional ".txt" suffix.  
  *
  * The output file is then tested against a known good result file from
  * the input directory (again, with the same name as the tested PDF file,
@@ -53,12 +53,14 @@
  * with and without sorting enabled.  The sorted files have a "-sorted.txt" 
  * suffix. 
  *
- * So for the file "test/input/hello.pdf", an output file will be generated
- * named "test/output/hello.pdf.txt".  Then that file will be compared to
- * the known good file "test/input/hello.pdf.txt", if it exists.
+ * So for the file "src/test/resources/input/hello.pdf", an output file will
+ * be generated named "target/test-output/hello.pdf.txt".  Then that file
+ * will be compared to the known good file
+ * "src/test/resources/input/hello.pdf.txt", if it exists.
  * 
  * To support testing with files that are not officially distributed 
- * with PDFBox, this test will also look in the "test/input-ext" directory. 
+ * with PDFBox, this test will also look in the "target/test-input-ext"
+ * directory.
  *
  * Any errors are logged, and at the end of processing all *.pdf files, if
  * there were any errors, the test fails.  The logging is at INFO, as the
@@ -374,10 +376,10 @@
     throws Exception
     {
         String filename = System.getProperty("org.apache.pdfbox.util.TextStripper.file");
-        File inDir = new File("test/input");
-        File outDir = new File("test/output");
-        File inDirExt = new File("test/input-ext");
-        File outDirExt = new File("test/output-ext");
+        File inDir = new File("src/test/resources/input");
+        File outDir = new File("target/test-output");
+        File inDirExt = new File("target/test-input-ext");
+        File outDirExt = new File("target/test-output-ext");
 
             if ((filename == null) || (filename.length() == 0)) 
             {

Modified: pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripperPerformance.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripperPerformance.java?rev=907868&r1=907867&r2=907868&view=diff
==============================================================================
--- pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripperPerformance.java (original)
+++ pdfbox/trunk/src/test/java/org/apache/pdfbox/util/TestTextStripperPerformance.java Tue
Feb  9 01:15:00 2010
@@ -107,7 +107,7 @@
         throws Exception
     {
         String filename = System.getProperty("org.apache.pdfbox.util.TextStripper.file");
-        File testDir = new File("test/input");
+        File testDir = new File("src/test/resources/input");
 
         if ((filename == null) || (filename.length() == 0))
         {



Mime
View raw message