pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1666667 - in /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox: cos/ multipdf/ pdmodel/ pdmodel/common/ rendering/ text/
Date Sat, 14 Mar 2015 12:16:34 GMT
Author: msahyoun
Date: Sat Mar 14 12:16:34 2015
New Revision: 1666667

URL: http://svn.apache.org/r1666667
Log:
PDFBOX-2576 fix source code formatting

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PageExtractorTest.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestRendering.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java?rev=1666667&r1=1666666&r2=1666667&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java Sat Mar 14
12:16:34 2015
@@ -253,7 +253,8 @@ public class TestCOSString extends TestC
         out.reset();
         COSWriter.writeString(string8Bit, out);
         StringBuffer hex = new StringBuffer();
-        for(char c : text8Bit.toCharArray()) {
+        for(char c : text8Bit.toCharArray())
+        {
            hex.append( Integer.toHexString(c).toUpperCase() );
         }
         assertEquals("<"+hex.toString()+">", new String(out.toByteArray(), "ASCII"));
@@ -262,7 +263,8 @@ public class TestCOSString extends TestC
         COSWriter.writeString(stringHighBits, out);
         hex = new StringBuffer();
         hex.append("FEFF"); // Byte Order Mark
-        for(char c : textHighBits.toCharArray()) {
+        for(char c : textHighBits.toCharArray())
+        {
            hex.append( Integer.toHexString(c).toUpperCase() );
         }
         assertEquals("<"+hex.toString()+">", new String(out.toByteArray(), "ASCII"));


Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PageExtractorTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PageExtractorTest.java?rev=1666667&r1=1666666&r2=1666667&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PageExtractorTest.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/multipdf/PageExtractorTest.java Sat
Mar 14 12:16:34 2015
@@ -29,37 +29,48 @@ import org.apache.pdfbox.pdmodel.PDDocum
  *
  * @author Adam Nichols
  */
-public class PageExtractorTest extends TestCase {
+public class PageExtractorTest extends TestCase
+{
     
-    public PageExtractorTest(String testName) {
+    public PageExtractorTest(String testName)
+    {
         super(testName);
     }
 
     @Override
-    protected void setUp() throws Exception {
+    protected void setUp() throws Exception
+    {
     }
 
     @Override
-    protected void tearDown() throws Exception {
+    protected void tearDown() throws Exception
+    {
     }
 
-    private void closeDoc(PDDocument doc) {
-        if(doc != null) {
-            try {
+    private void closeDoc(PDDocument doc)
+    {
+        if(doc != null)
+        {
+            try
+            {
                 doc.close(); 
-            } catch(Exception e) {
+            }
+            catch(Exception e)
+            {
                 /* Can't do much about this... */ 
-            };
+            }
         }
     }
     
     /**
      * Test of extract method, of class org.apache.pdfbox.util.PageExtractor.
      */
-    public void testExtract() throws Exception {
+    public void testExtract() throws Exception
+    {
         PDDocument sourcePdf = null;
         PDDocument result = null;
-        try {
+        try
+        {
             // this should work for most users
             sourcePdf = PDDocument.load(new File("src/test/resources/input/cweb.pdf"));
             PageExtractor instance = new PageExtractor(sourcePdf);
@@ -86,7 +97,9 @@ public class PageExtractorTest extends T
             result = instance.extract();
             assertEquals(0, result.getNumberOfPages());
             closeDoc(result);
-        } finally {
+        }
+        finally
+        {
             closeDoc(sourcePdf);
             closeDoc(result);
         }

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java?rev=1666667&r1=1666666&r2=1666667&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
Sat Mar 14 12:16:34 2015
@@ -27,9 +27,11 @@ import junit.framework.TestCase;
  * @author Neil McErlean
  * @since 1.3.0
  */
-public class TestPDDocumentInformation extends TestCase {
+public class TestPDDocumentInformation extends TestCase
+{
 
-    public void testMetadataExtraction() throws Exception {
+    public void testMetadataExtraction() throws Exception
+    {
         PDDocument doc = null;
         try
         {
@@ -37,27 +39,28 @@ public class TestPDDocumentInformation e
            doc = PDDocument.load( new File("src/test/resources/input/hello3.pdf"));
            PDDocumentInformation info = doc.getDocumentInformation();
            
-           assertEquals("Wrong author",            "Brian Carrier", info.getAuthor());
-           assertNotNull("Wrong creationDate",        info.getCreationDate());
-           assertEquals("Wrong creator",           "Acrobat PDFMaker 8.1 for Word", info.getCreator());
-           assertNull  ("Wrong keywords",             info.getKeywords());
-           assertNotNull("Wrong modificationDate",    info.getModificationDate());
-           assertEquals("Wrong producer",          "Acrobat Distiller 8.1.0 (Windows)", info.getProducer());
-           assertNull  ("Wrong subject",              info.getSubject());
-           assertNull  ("Wrong trapped",              info.getTrapped());
+           assertEquals("Wrong author", "Brian Carrier", info.getAuthor());
+           assertNotNull("Wrong creationDate", info.getCreationDate());
+           assertEquals("Wrong creator", "Acrobat PDFMaker 8.1 for Word", info.getCreator());
+           assertNull("Wrong keywords", info.getKeywords());
+           assertNotNull("Wrong modificationDate", info.getModificationDate());
+           assertEquals("Wrong producer", "Acrobat Distiller 8.1.0 (Windows)", info.getProducer());
+           assertNull("Wrong subject", info.getSubject());
+           assertNull("Wrong trapped", info.getTrapped());
 
            List<String> expectedMetadataKeys = Arrays.asList(new String[] {"CreationDate",
"Author", "Creator",
                                                                            "Producer", "ModDate",
"Company",
                                                                            "SourceModified",
"Title"});
            assertEquals("Wrong metadata key count", expectedMetadataKeys.size(),
                                                     info.getMetadataKeys().size());
-           for (String key : expectedMetadataKeys) {
+           for (String key : expectedMetadataKeys)
+           {
                assertTrue("Missing metadata key:" + key, info.getMetadataKeys().contains(key));
            }
            
            // Custom metadata fields.
-           assertEquals("Wrong company",           "Basis Technology Corp.", info.getCustomMetadataValue("Company"));
-           assertEquals("Wrong sourceModified",    "D:20080819181502", info.getCustomMetadataValue("SourceModified"));
+           assertEquals("Wrong company", "Basis Technology Corp.", info.getCustomMetadataValue("Company"));
+           assertEquals("Wrong sourceModified", "D:20080819181502", info.getCustomMetadataValue("SourceModified"));
         }
         finally
         {

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java?rev=1666667&r1=1666666&r2=1666667&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
Sat Mar 14 12:16:34 2015
@@ -41,14 +41,17 @@ public class TestPDNumberTreeNode extend
     private PDNumberTreeNode node5;
     private PDNumberTreeNode node24;
     
-    public static class PDTest implements COSObjectable {
+    public static class PDTest implements COSObjectable
+    {
         private final int value;
 
-        public PDTest(int value) {
+        public PDTest(int value)
+        {
             this.value = value;
         }
         
-        public PDTest(COSInteger cosInt) {
+        public PDTest(COSInteger cosInt)
+        {
             this.value = cosInt.intValue();
         }
 
@@ -71,11 +74,17 @@ public class TestPDNumberTreeNode extend
         public boolean equals( Object obj )
         {
             if ( this == obj)
+            {
                 return true;
+            }
             if ( obj == null)
+            {
                 return false;
+            }
             if ( getClass() != obj.getClass())
+            {
                 return false;
+            }
             PDTest other = (PDTest) obj;
             return value == other.value;
         }
@@ -133,7 +142,8 @@ public class TestPDNumberTreeNode extend
         this.node1.setKids( kids );
     }
     
-    public void testGetValue() throws IOException {
+    public void testGetValue() throws IOException
+    {
         Assert.assertEquals(new PDTest( 51 ), this.node5.getValue( 4 ));
         Assert.assertEquals(new PDTest(70), this.node1.getValue( 9 ));
         

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestRendering.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestRendering.java?rev=1666667&r1=1666666&r2=1666667&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestRendering.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestRendering.java Sat Mar
14 12:16:34 2015
@@ -44,7 +44,8 @@ public class TestRendering
     private static final String INPUT_DIR = "src/test/resources/input/rendering";
 
     @Parameters(name = "{0}")
-    public static Collection<Object[]> data() {
+    public static Collection<Object[]> data()
+    {
         File[] testFiles = new File(INPUT_DIR).listFiles(new FilenameFilter()
         {
             @Override
@@ -64,7 +65,8 @@ public class TestRendering
 
     private final String fileName;
 
-    public TestRendering(String fileName) {
+    public TestRendering(String fileName)
+    {
         this.fileName = fileName;
     }
 

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java?rev=1666667&r1=1666666&r2=1666667&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java Sat Mar
14 12:16:34 2015
@@ -247,20 +247,26 @@ public class TestTextStripper extends Te
             }
 
             OutputStream os = new FileOutputStream(outFile);
-            try {
+            try
+            {
                 os.write( 0xFF );
                 os.write( 0xFE );
 
                 Writer writer = new OutputStreamWriter(os, encoding);
-                try {
+                try
+                {
                     //Allows for sorted tests 
                     stripper.setSortByPosition(bSort);
                     stripper.writeText(document, writer);
-                } finally {
+                }
+                finally
+                {
                     // close the written file before reading it again
                     writer.close();
                 }
-            } finally {
+            }
+            finally
+            {
                 os.close();
             }
 



Mime
View raw message