You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2016/10/25 10:23:16 UTC

svn commit: r1766501 - /poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java

Author: nick
Date: Tue Oct 25 10:23:15 2016
New Revision: 1766501

URL: http://svn.apache.org/viewvc?rev=1766501&view=rev
Log:
Whitespace

Modified:
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java?rev=1766501&r1=1766500&r2=1766501&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java Tue Oct 25 10:23:15 2016
@@ -17,80 +17,80 @@
 
 package org.apache.poi.hdgf;
 
+import junit.framework.TestCase;
+
+import org.apache.poi.POIDataSamples;
 import org.apache.poi.hdgf.extractor.VisioTextExtractor;
 import org.apache.poi.hdgf.streams.PointerContainingStream;
 import org.apache.poi.hdgf.streams.TrailerStream;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-import org.apache.poi.POIDataSamples;
-import org.junit.Ignore;
-
-import junit.framework.TestCase;
 
 public final class TestHDGFCore extends TestCase {
     private static POIDataSamples _dgTests = POIDataSamples.getDiagramInstance();
 
-	private POIFSFileSystem fs;
+    private POIFSFileSystem fs;
 
-	@Override
+    @Override
     protected void setUp() throws Exception {
-		fs = new POIFSFileSystem(_dgTests.openResourceAsStream("Test_Visio-Some_Random_Text.vsd"));
-	}
+        fs = new POIFSFileSystem(_dgTests.openResourceAsStream("Test_Visio-Some_Random_Text.vsd"));
+    }
+    
+
+    public void testCreate() throws Exception {
+        new HDGFDiagram(fs);
+    }
+
+    public void testTrailer() throws Exception {
+        HDGFDiagram hdgf = new HDGFDiagram(fs);
+        assertNotNull(hdgf);
+        assertNotNull(hdgf.getTrailerStream());
 
-	public void testCreate() throws Exception {
-		new HDGFDiagram(fs);
-	}
-
-	public void testTrailer() throws Exception {
-		HDGFDiagram hdgf = new HDGFDiagram(fs);
-		assertNotNull(hdgf);
-		assertNotNull(hdgf.getTrailerStream());
-
-		// Check it has what we'd expect
-		TrailerStream trailer = hdgf.getTrailerStream();
-		assertEquals(0x8a94, trailer.getPointer().getOffset());
-
-		assertNotNull(trailer.getPointedToStreams());
-		assertEquals(20, trailer.getPointedToStreams().length);
-
-		assertEquals(20, hdgf.getTopLevelStreams().length);
-
-		// 9th one should have children
-		assertNotNull(trailer.getPointedToStreams()[8]);
-		assertNotNull(trailer.getPointedToStreams()[8].getPointer());
-		PointerContainingStream ps8 = (PointerContainingStream)
-			trailer.getPointedToStreams()[8];
-		assertNotNull(ps8.getPointedToStreams());
-		assertEquals(8, ps8.getPointedToStreams().length);
-	}
-
-	/**
-	 * Tests that we can open a problematic file, that used to
-	 *  break with a negative chunk length
-	 */
-	public void testNegativeChunkLength() throws Exception {
-		fs = new POIFSFileSystem(_dgTests.openResourceAsStream("NegativeChunkLength.vsd"));
-
-		HDGFDiagram hdgf = new HDGFDiagram(fs);
-		assertNotNull(hdgf);
-		
-		// And another file
-		fs = new POIFSFileSystem(_dgTests.openResourceAsStream("NegativeChunkLength2.vsd"));
-		hdgf = new HDGFDiagram(fs);
-		assertNotNull(hdgf);
-	}
-	
-	/**
-	 * Tests that we can open a problematic file that triggers
-	 *  an ArrayIndexOutOfBoundsException when processing the
-	 *  chunk commands.
-	 * @throws Exception
-	 */
-	public void DISABLEDtestAIOOB() throws Exception {
-      fs = new POIFSFileSystem(_dgTests.openResourceAsStream("44501.vsd"));
-
-      HDGFDiagram hdgf = new HDGFDiagram(fs);
-      assertNotNull(hdgf);
-	}
+        // Check it has what we'd expect
+        TrailerStream trailer = hdgf.getTrailerStream();
+        assertEquals(0x8a94, trailer.getPointer().getOffset());
+
+        assertNotNull(trailer.getPointedToStreams());
+        assertEquals(20, trailer.getPointedToStreams().length);
+
+        assertEquals(20, hdgf.getTopLevelStreams().length);
+
+        // 9th one should have children
+        assertNotNull(trailer.getPointedToStreams()[8]);
+        assertNotNull(trailer.getPointedToStreams()[8].getPointer());
+        PointerContainingStream ps8 = (PointerContainingStream)
+                trailer.getPointedToStreams()[8];
+        assertNotNull(ps8.getPointedToStreams());
+        assertEquals(8, ps8.getPointedToStreams().length);
+    }
+
+    /**
+     * Tests that we can open a problematic file, that used to
+     *  break with a negative chunk length
+     */
+    public void testNegativeChunkLength() throws Exception {
+        fs = new POIFSFileSystem(_dgTests.openResourceAsStream("NegativeChunkLength.vsd"));
+
+        HDGFDiagram hdgf = new HDGFDiagram(fs);
+        assertNotNull(hdgf);
+
+        // And another file
+        fs = new POIFSFileSystem(_dgTests.openResourceAsStream("NegativeChunkLength2.vsd"));
+        hdgf = new HDGFDiagram(fs);
+        assertNotNull(hdgf);
+    }
+
+    /**
+     * Tests that we can open a problematic file that triggers
+     *  an ArrayIndexOutOfBoundsException when processing the
+     *  chunk commands.
+     * @throws Exception
+     */
+    public void DISABLEDtestAIOOB() throws Exception {
+        fs = new POIFSFileSystem(_dgTests.openResourceAsStream("44501.vsd"));
+
+        HDGFDiagram hdgf = new HDGFDiagram(fs);
+        assertNotNull(hdgf);
+    }
 
     public void testV5() throws Exception {
         fs = new POIFSFileSystem(_dgTests.openResourceAsStream("v5_Connection_Types.vsd"));
@@ -105,26 +105,26 @@ public final class TestHDGFCore extends
     }
 
     public void testV6NonUtf16LE() throws Exception {
-   		fs = new POIFSFileSystem(_dgTests.openResourceAsStream("v6-non-utf16le.vsd"));
+        fs = new POIFSFileSystem(_dgTests.openResourceAsStream("v6-non-utf16le.vsd"));
 
-   		HDGFDiagram hdgf = new HDGFDiagram(fs);
-   		assertNotNull(hdgf);
+        HDGFDiagram hdgf = new HDGFDiagram(fs);
+        assertNotNull(hdgf);
 
         VisioTextExtractor textExtractor = new VisioTextExtractor(hdgf);
         String text = textExtractor.getText().replace("\u0000", "").trim();
 
         assertEquals("Table\n\n\nPropertySheet\n\n\n\nPropertySheetField", text);
-   	}
+    }
 
     public void testUtf16LE() throws Exception {
-   		fs = new POIFSFileSystem(_dgTests.openResourceAsStream("Test_Visio-Some_Random_Text.vsd"));
+        fs = new POIFSFileSystem(_dgTests.openResourceAsStream("Test_Visio-Some_Random_Text.vsd"));
 
-   		HDGFDiagram hdgf = new HDGFDiagram(fs);
-   		assertNotNull(hdgf);
+        HDGFDiagram hdgf = new HDGFDiagram(fs);
+        assertNotNull(hdgf);
 
         VisioTextExtractor textExtractor = new VisioTextExtractor(hdgf);
         String text = textExtractor.getText().trim();
 
         assertEquals("text\nView\nTest View\nI am a test view\nSome random text, on a page", text);
-   	}
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org