poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r805552 [3/4] - in /poi/trunk/src: java/org/apache/poi/hpsf/extractor/ java/org/apache/poi/poifs/filesystem/ java/org/apache/poi/poifs/storage/ java/org/apache/poi/util/ ooxml/java/org/apache/poi/openxml4j/opc/ ooxml/java/org/apache/poi/ope...
Date Tue, 18 Aug 2009 19:49:31 GMT
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java Tue Aug 18 19:49:28 2009
@@ -33,11 +33,11 @@
 		0, 0, 0, 0, 0x0F, 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80-256,
 		0, 1, 0, 0, 7, 0, 0x0C, 0x30 };
 
-    public void testRecordType() throws Exception {
+    public void testRecordType() {
 		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
 		assertEquals(1007l, sa.getRecordType());
 	}
-	public void testFlags() throws Exception {
+	public void testFlags() {
 		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
 
 		// First 12 bytes are a SSlideLayoutAtom, checked elsewhere
@@ -51,7 +51,7 @@
 		assertEquals(true, sa.getFollowMasterScheme());
 		assertEquals(true, sa.getFollowMasterBackground());
 	}
-	public void testSSlideLayoutAtom() throws Exception {
+	public void testSSlideLayoutAtom() {
 		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
 		SSlideLayoutAtom ssla = sa.getSSlideLayoutAtom();
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java Tue Aug 18 19:49:28 2009
@@ -32,11 +32,11 @@
 		4, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0,
 		1, 0, 0, 0, 0, 0, 0 };
 
-    public void testRecordType() throws Exception {
+	public void testRecordType() {
 		SlidePersistAtom spa = new SlidePersistAtom(data_a, 0, data_a.length);
 		assertEquals(1011l, spa.getRecordType());
 	}
-	public void testFlags() throws Exception {
+	public void testFlags() {
 		SlidePersistAtom spa = new SlidePersistAtom(data_a, 0, data_a.length);
 		assertEquals(4, spa.getRefID() );
 		assertEquals(true, spa.getHasShapesOtherThanPlaceholders() );

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java Tue Aug 18 19:49:28 2009
@@ -36,7 +36,7 @@
  */
 public final class TestStyleTextPropAtom extends TestCase {
     /** From a real file: a paragraph with 4 different styles */
-    private byte[] data_a = new byte[] {
+    private static final byte[] data_a = new byte[] {
       0, 0, 0xA1-256, 0x0F, 0x2A, 0, 0, 0,
       0x36, 00, 00, 00, // paragraph is 54 long
       00, 00,           // (paragraph reserved field)
@@ -50,7 +50,7 @@
       00, 00, 0x04, 00, // font.color only
       0xFF-256, 0x33, 00, 0xFE-256 // red
     };
-    private int data_a_text_len = 0x36-1;
+    private static final int data_a_text_len = 0x36-1;
 
     /**
      * From a real file: 4 paragraphs with text in 4 different styles:
@@ -60,7 +60,7 @@
      * left aligned+underlined+larger font size (96)
      * left aligned+underlined+larger font size+red (1)
      */
-    private byte[] data_b = new byte[] {
+    private static final byte[] data_b = new byte[] {
         0, 0, 0xA1-256, 0x0F, 0x80-256, 0, 0, 0,
         0x1E, 00, 00, 00,     // paragraph is 30 long
         00, 00,               // paragraph reserved field
@@ -108,14 +108,14 @@
         0x18, 00,             // font size 24
         0xFF-256, 0x33, 00, 0xFE-256 // colour red
     };
-    private int data_b_text_len = 0xB3;
+    private static final int data_b_text_len = 0xB3;
 
     /**
      * From a real file. Has a mask with more bits
      *  set than it actually has data for. Shouldn't do,
      *  but some real files do :(
      */
-    private byte[] data_c = new byte[] {
+    private static final byte[] data_c = new byte[] {
         0, 0, -95, 15, 62, 0, 0, 0,
         123, 0, 0, 0, 0, 0, 48, 8,
         10, 0, 1, 0, 0, 0, 0, 0,
@@ -131,15 +131,15 @@
     /**
      * From a real file supplied for Bug 40143 by tales@great.ufc.br
      */
-    private byte[] data_d = {
+    private static final byte[] data_d = {
         0x00, 0x00, 0xA1-256, 0x0F, 0x1E, 0x00, 0x00, 0x00, //header
         (byte)0xA0, 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x08 , 0x00 , 0x00 ,
         0x01 , 0x00, (byte)0xA0 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x63 , 0x00 ,
         0x01 , 0x00, 0x01 , 0x00 , 0x00, 0x00 , 0x01 , 0x00 , 0x14 , 0x00
     };
-    private int data_d_text_len = 0xA0-1;
+    private static final int data_d_text_len = 0xA0-1;
 
-    public void testRecordType() throws Exception {
+    public void testRecordType() {
         StyleTextPropAtom stpa = new StyleTextPropAtom(data_a,0,data_a.length);
         StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
         StyleTextPropAtom stpc = new StyleTextPropAtom(data_c,0,data_c.length);
@@ -149,7 +149,7 @@
     }
 
 
-    public void testCharacterStyleCounts() throws Exception {
+    public void testCharacterStyleCounts() {
         StyleTextPropAtom stpa = new StyleTextPropAtom(data_a,0,data_a.length);
         StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
 
@@ -223,7 +223,6 @@
         TextProp tp_1_1 = (TextProp)b_ch_1.getTextPropList().get(0);
         TextProp tp_1_2 = (TextProp)b_ch_1.getTextPropList().get(1);
         assertEquals(true, tp_1_1 instanceof CharFlagsTextProp);
-        assertEquals(true, tp_1_2 instanceof TextProp);
         assertEquals("font.size", tp_1_2.getName());
         assertEquals(20, tp_1_2.getValue());
 
@@ -233,8 +232,6 @@
         TextProp tp_2_2 = (TextProp)b_ch_2.getTextPropList().get(1);
         TextProp tp_2_3 = (TextProp)b_ch_2.getTextPropList().get(2);
         assertEquals(true, tp_2_1 instanceof CharFlagsTextProp);
-        assertEquals(true, tp_2_2 instanceof TextProp);
-        assertEquals(true, tp_2_3 instanceof TextProp);
         assertEquals("font.size", tp_2_2.getName());
         assertEquals("font.color", tp_2_3.getName());
         assertEquals(20, tp_2_2.getValue());
@@ -243,8 +240,6 @@
         assertEquals(2,b_ch_3.getTextPropList().size());
         TextProp tp_3_1 = (TextProp)b_ch_3.getTextPropList().get(0);
         TextProp tp_3_2 = (TextProp)b_ch_3.getTextPropList().get(1);
-        assertEquals(true, tp_3_1 instanceof TextProp);
-        assertEquals(true, tp_3_2 instanceof TextProp);
         assertEquals("font.size", tp_3_1.getName());
         assertEquals("font.color", tp_3_2.getName());
         assertEquals(20, tp_3_1.getValue());
@@ -255,8 +250,6 @@
         TextProp tp_4_2 = (TextProp)b_ch_4.getTextPropList().get(1);
         TextProp tp_4_3 = (TextProp)b_ch_4.getTextPropList().get(2);
         assertEquals(true, tp_4_1 instanceof CharFlagsTextProp);
-        assertEquals(true, tp_4_2 instanceof TextProp);
-        assertEquals(true, tp_4_3 instanceof TextProp);
         assertEquals("font.index", tp_4_2.getName());
         assertEquals("font.size", tp_4_3.getName());
         assertEquals(24, tp_4_3.getValue());
@@ -276,8 +269,6 @@
         assertEquals(2,b_p_1.getTextPropList().size());
         TextProp tp_1_1 = (TextProp)b_p_1.getTextPropList().get(0);
         TextProp tp_1_2 = (TextProp)b_p_1.getTextPropList().get(1);
-        assertEquals(true, tp_1_1 instanceof TextProp);
-        assertEquals(true, tp_1_2 instanceof TextProp);
         assertEquals("alignment", tp_1_1.getName());
         assertEquals("linespacing", tp_1_2.getName());
         assertEquals(0, tp_1_1.getValue());
@@ -286,8 +277,6 @@
         // 2nd is centre aligned (default) + normal line spacing
         assertEquals(1,b_p_2.getTextPropList().size());
         TextProp tp_2_1 = (TextProp)b_p_2.getTextPropList().get(0);
-        assertEquals(true, tp_2_1 instanceof TextProp);
-        assertEquals(true, tp_1_2 instanceof TextProp);
         assertEquals("linespacing", tp_2_1.getName());
         assertEquals(80, tp_2_1.getValue());
 
@@ -295,8 +284,6 @@
         assertEquals(2,b_p_3.getTextPropList().size());
         TextProp tp_3_1 = (TextProp)b_p_3.getTextPropList().get(0);
         TextProp tp_3_2 = (TextProp)b_p_3.getTextPropList().get(1);
-        assertEquals(true, tp_3_1 instanceof TextProp);
-        assertEquals(true, tp_3_2 instanceof TextProp);
         assertEquals("alignment", tp_3_1.getName());
         assertEquals("linespacing", tp_3_2.getName());
         assertEquals(2, tp_3_1.getValue());
@@ -306,8 +293,6 @@
         assertEquals(2,b_p_4.getTextPropList().size());
         TextProp tp_4_1 = (TextProp)b_p_4.getTextPropList().get(0);
         TextProp tp_4_2 = (TextProp)b_p_4.getTextPropList().get(1);
-        assertEquals(true, tp_4_1 instanceof TextProp);
-        assertEquals(true, tp_4_2 instanceof TextProp);
         assertEquals("alignment", tp_4_1.getName());
         assertEquals("linespacing", tp_4_2.getName());
         assertEquals(0, tp_4_1.getValue());

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java Tue Aug 18 19:49:28 2009
@@ -38,16 +38,16 @@
 		0x74, 0x65, 0x73, 0x74, 0x20, 0x74, 0x69, 0x74, 0x6C, 0x65 };
 	private String alt_text = "This is a test title";
 
-    public void testRecordType() throws Exception {
+    public void testRecordType() {
 		TextBytesAtom tba = new TextBytesAtom(data,0,data.length);
 		assertEquals(4008l, tba.getRecordType());
 	}
 
-	public void testTextA() throws Exception {
+	public void testTextA() {
 		TextBytesAtom tba = new TextBytesAtom(data,0,data.length);
 		assertEquals(data_text, tba.getText());
 	}
-	public void testTextB() throws Exception {
+	public void testTextB() {
 		TextBytesAtom tba = new TextBytesAtom(alt_data,0,alt_data.length);
 		assertEquals(alt_text, tba.getText());
 	}

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java Tue Aug 18 19:49:28 2009
@@ -35,16 +35,16 @@
 		0x54, 0x00, 0x68, 0x00, 0x69, 0x00, 0x73, 0x00, 0xa3-256, 0x01 };
 	private String alt_text = "This\u01A3";
 
-    public void testRecordType() throws Exception {
+    public void testRecordType() {
 		TextCharsAtom tca = new TextCharsAtom(data,0,data.length);
 		assertEquals(4000l, tca.getRecordType());
 	}
 
-	public void testTextA() throws Exception {
+	public void testTextA() {
 		TextCharsAtom tca = new TextCharsAtom(data,0,data.length);
 		assertEquals(data_text, tca.getText());
 	}
-	public void testTextB() throws Exception {
+	public void testTextB() {
 		TextCharsAtom tca = new TextCharsAtom(alt_data,0,alt_data.length);
 		assertEquals(alt_text, tca.getText());
 	}

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java Tue Aug 18 19:49:28 2009
@@ -32,11 +32,11 @@
 	private byte[] title_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 0, 0, 0, 0 };
 	private byte[] body_data = new byte[]  { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 1, 0, 0, 0 };
 
-    public void testRecordType() throws Exception {
+	public void testRecordType() {
 		TextHeaderAtom tha = new TextHeaderAtom(notes_data,0,12);
 		assertEquals(3999l, tha.getRecordType());
 	}
-	public void testTypes() throws Exception {
+	public void testTypes() {
 		TextHeaderAtom n_tha = new TextHeaderAtom(notes_data,0,12);
 		TextHeaderAtom t_tha = new TextHeaderAtom(title_data,0,12);
 		TextHeaderAtom b_tha = new TextHeaderAtom(body_data,0,12);

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java Tue Aug 18 19:49:28 2009
@@ -33,11 +33,11 @@
 		00, 00, 00, 00, 00, 0x18, 00, 00, 01, 00, 00, 00,
 		05, 00, 00, 00, 01, 00, 0xF6-256, 77 };
 
-    public void testRecordType() throws Exception {
+	public void testRecordType() {
 		UserEditAtom uea = new UserEditAtom(data_a, 0, data_a.length);
 		assertEquals(4085l, uea.getRecordType());
 	}
-	public void testFlags() throws Exception {
+	public void testFlags() {
 		UserEditAtom uea = new UserEditAtom(data_a, 0, data_a.length);
 
 		assertEquals(256, uea.getLastViewedSlideID() );

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java Tue Aug 18 19:49:28 2009
@@ -31,16 +31,16 @@
 	// SlideShow primed on the test data
 	private SlideShow ss;
 
-    public TestCounts() throws Exception {
+	public TestCounts() throws Exception {
 		String dirname = System.getProperty("HSLF.testdata.path");
 		String filename = dirname + "/basic_test_ppt_file.ppt";
 		HSLFSlideShow hss = new HSLFSlideShow(filename);
 		ss = new SlideShow(hss);
-    }
+	}
 
-    public void testSheetsCount() throws Exception {
+	public void testSheetsCount() {
 		Slide[] slides = ss.getSlides();
-		// Two sheets - master sheet is seperate
+		// Two sheets - master sheet is separate
 		assertEquals(2, slides.length);
 
 		// They are slides 1+2
@@ -56,7 +56,7 @@
 		assertEquals(257, slides[1]._getSheetNumber());
 	}
 
-    public void testNotesCount() throws Exception {
+	public void testNotesCount() {
 		Notes[] notes = ss.getNotes();
 		// Two sheets -> two notes
 		// Note: there are also notes on the slide master

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java Tue Aug 18 19:49:28 2009
@@ -33,14 +33,14 @@
 	// SlideShow primed on the test data
 	private SlideShow ss;
 
-    public TestMostRecentRecords() throws Exception {
+	public TestMostRecentRecords() throws Exception {
 		String dirname = System.getProperty("HSLF.testdata.path");
 		String filename = dirname + "/basic_test_ppt_file.ppt";
 		hss = new HSLFSlideShow(filename);
 		ss = new SlideShow(hss);
-    }
+	}
 
-    public void testCount() throws Exception {
+	public void testCount() {
 		// Most recent core records
 		Record[] mrcr = ss.getMostRecentCoreRecords();
 
@@ -48,7 +48,7 @@
 		assertEquals(7, mrcr.length);
 	}
 
-    public void testRightRecordTypes() throws Exception {
+	public void testRightRecordTypes() {
 		// Most recent core records
 		Record[] mrcr = ss.getMostRecentCoreRecords();
 
@@ -69,7 +69,7 @@
 		assertEquals(1008, mrcr[6].getRecordType());
 	}
 
-    public void testCorrectRecords() throws Exception {
+	public void testCorrectRecords() {
 		// Most recent core records
 		Record[] mrcr = ss.getMostRecentCoreRecords();
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java Tue Aug 18 19:49:28 2009
@@ -31,14 +31,14 @@
 	// SlideShow primed on the test data
 	private SlideShow ss;
 
-    public TestNotesText() throws Exception {
+	public TestNotesText() throws Exception {
 		String dirname = System.getProperty("HSLF.testdata.path");
 		String filename = dirname + "/basic_test_ppt_file.ppt";
 		HSLFSlideShow hss = new HSLFSlideShow(filename);
 		ss = new SlideShow(hss);
-    }
+	}
 
-    public void testNotesOne() throws Exception {
+	public void testNotesOne() {
 		Notes notes = ss.getNotes()[0];
 
 		String[] expectText = new String[] {"These are the notes for page 1"};
@@ -46,9 +46,9 @@
 		for(int i=0; i<expectText.length; i++) {
 			assertEquals(expectText[i], notes.getTextRuns()[i].getText());
 		}
-    }
+	}
 
-	public void testNotesTwo() throws Exception {
+	public void testNotesTwo() {
 		Notes notes = ss.getNotes()[1];
 		String[] expectText = new String[] {"These are the notes on page two, again lacking formatting"};
 		assertEquals(expectText.length, notes.getTextRuns().length);

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java Tue Aug 18 19:49:28 2009
@@ -34,7 +34,7 @@
 
     protected File cwd;
 
-    public void setUp() throws Exception {
+    public void setUp() {
         cwd = new File(System.getProperty("HSLF.testdata.path"));
     }
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestRecordSetup.java Tue Aug 18 19:49:28 2009
@@ -36,30 +36,30 @@
 	private SlideShow ss;
 	private HSLFSlideShow hss;
 
-    public TestRecordSetup() throws Exception {
+	public TestRecordSetup() throws Exception {
 		String dirname = System.getProperty("HSLF.testdata.path");
 		String filename = dirname + "/basic_test_ppt_file.ppt";
 		hss = new HSLFSlideShow(filename);
 		ss = new SlideShow(hss);
-    }
+	}
 
-    public void testHandleParentAwareRecords() throws Exception {
-    	Record[] records = hss.getRecords();
-    	for(int i=0; i<records.length; i++) {
-    		ensureParentAware(records[i],null);
-    	}
+	public void testHandleParentAwareRecords() {
+		Record[] records = hss.getRecords();
+		for(int i=0; i<records.length; i++) {
+			ensureParentAware(records[i],null);
+		}
+	}
+	private void ensureParentAware(Record r,RecordContainer parent) {
+		if(r instanceof ParentAwareRecord) {
+			ParentAwareRecord pr = (ParentAwareRecord)r;
+			assertEquals(parent, pr.getParentRecord());
+		}
+		if(r instanceof RecordContainer) {
+			RecordContainer rc = (RecordContainer)r;
+			Record[] children = rc.getChildRecords();
+			for(int i=0; i<children.length; i++) {
+				ensureParentAware(children[i], rc);
+			}
+		}
 	}
-    private void ensureParentAware(Record r,RecordContainer parent) {
-    	if(r instanceof ParentAwareRecord) {
-    		ParentAwareRecord pr = (ParentAwareRecord)r;
-    		assertEquals(parent, pr.getParentRecord());
-    	}
-    	if(r instanceof RecordContainer) {
-    		RecordContainer rc = (RecordContainer)r;
-    		Record[] children = rc.getChildRecords();
-    		for(int i=0; i<children.length; i++) {
-    			ensureParentAware(children[i], rc);
-    		}
-    	}
-    }
 }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSheetText.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSheetText.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSheetText.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSheetText.java Tue Aug 18 19:49:28 2009
@@ -31,14 +31,14 @@
 	// SlideShow primed on the test data
 	private SlideShow ss;
 
-    public TestSheetText() throws Exception {
+	public TestSheetText() throws Exception {
 		String dirname = System.getProperty("HSLF.testdata.path");
 		String filename = dirname + "/basic_test_ppt_file.ppt";
 		HSLFSlideShow hss = new HSLFSlideShow(filename);
 		ss = new SlideShow(hss);
-    }
+	}
 
-    public void testSheetOne() throws Exception {
+	public void testSheetOne() {
 		Sheet slideOne = ss.getSlides()[0];
 
 		String[] expectText = new String[] {"This is a test title","This is a test subtitle\nThis is on page 1"};
@@ -46,9 +46,9 @@
 		for(int i=0; i<expectText.length; i++) {
 			assertEquals(expectText[i], slideOne.getTextRuns()[i].getText());
 		}
-    }
+	}
 
-	public void testSheetTwo() throws Exception {
+	public void testSheetTwo() {
 		Sheet slideTwo = ss.getSlides()[1];
 		String[] expectText = new String[] {"This is the title on page 2","This is page two\nIt has several blocks of text\nNone of them have formatting"};
 		assertEquals(expectText.length, slideTwo.getTextRuns().length);
@@ -80,7 +80,7 @@
 			"Can they co-exist?\n\n" +
 			"Gay Harley\n" +
 			"Clean Development Alliance\n" +
-			"COP 11 \u2013 MOP 1\n" + // special long hyphon
+			"COP 11 \u2013 MOP 1\n" + // special long hyphen
 			"December 5, 2005\n";
 
 		assertEquals(1, s.getTextRuns().length);

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSlideOrdering.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSlideOrdering.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSlideOrdering.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestSlideOrdering.java Tue Aug 18 19:49:28 2009
@@ -17,7 +17,6 @@
 
 package org.apache.poi.hslf.usermodel;
 
-
 import junit.framework.TestCase;
 import org.apache.poi.hslf.*;
 import org.apache.poi.hslf.model.*;
@@ -33,7 +32,7 @@
 	// Complex slideshow, record order doesn't match slide order
 	private SlideShow ssB;
 
-    public TestSlideOrdering() throws Exception {
+	public TestSlideOrdering() throws Exception {
 		String dirname = System.getProperty("HSLF.testdata.path");
 
 		String filenameA = dirname + "/basic_test_ppt_file.ppt";
@@ -43,112 +42,93 @@
 		String filenameB = dirname + "/incorrect_slide_order.ppt";
 		HSLFSlideShow hssB = new HSLFSlideShow(filenameB);
 		ssB = new SlideShow(hssB);
-    }
+	}
+
+	/**
+	 * Test the simple case - record order matches slide order
+	 */
+	public void testSimpleCase() {
+		assertEquals(2, ssA.getSlides().length);
+
+		Slide s1 = ssA.getSlides()[0];
+		Slide s2 = ssA.getSlides()[1];
+
+		String[] firstTRs = new String[] { "This is a test title", "This is the title on page 2" };
+
+		assertEquals(firstTRs[0], s1.getTextRuns()[0].getText());
+		assertEquals(firstTRs[1], s2.getTextRuns()[0].getText());
+	}
+
+	/**
+	 * Test the complex case - record order differs from slide order
+	 */
+	public void testComplexCase() {
+		assertEquals(3, ssB.getSlides().length);
+
+		Slide s1 = ssB.getSlides()[0];
+		Slide s2 = ssB.getSlides()[1];
+		Slide s3 = ssB.getSlides()[2];
+
+		String[] firstTRs = new String[] { "Slide 1", "Slide 2", "Slide 3" };
+
+		assertEquals(firstTRs[0], s1.getTextRuns()[0].getText());
+		assertEquals(firstTRs[1], s2.getTextRuns()[0].getText());
+		assertEquals(firstTRs[2], s3.getTextRuns()[0].getText());
+	}
+
+	/**
+	 * Assert that the order of slides is correct.
+	 *
+	 * @param filename
+	 *            file name of the slide show to assert
+	 * @param titles
+	 *            array of reference slide titles
+	 */
+	protected void assertSlideOrdering(String filename, String[] titles) throws Exception {
+		SlideShow ppt = new SlideShow(new HSLFSlideShow(filename));
+		Slide[] slide = ppt.getSlides();
+
+		assertEquals(titles.length, slide.length);
+		for (int i = 0; i < slide.length; i++) {
+			String title = slide[i].getTitle();
+			assertEquals("Wrong slide title in " + filename, titles[i], title);
+		}
+	}
+
+	public void testTitles() throws Exception {
+		String dirname = System.getProperty("HSLF.testdata.path");
+
+		assertSlideOrdering(dirname + "/basic_test_ppt_file.ppt", new String[] {
+				"This is a test title", "This is the title on page 2" });
+
+		assertSlideOrdering(dirname + "/incorrect_slide_order.ppt", new String[] { "Slide 1",
+				"Slide 2", "Slide 3" });
+
+		assertSlideOrdering(dirname + "/next_test_ppt_file.ppt", new String[] {
+				"This is a test title", "This is the title on page 2" });
 
-    /**
-     * Test the simple case - record order matches slide order
-     */
-    public void testSimpleCase() throws Exception {
-    	assertEquals(2, ssA.getSlides().length);
-
-    	Slide s1 = ssA.getSlides()[0];
-    	Slide s2 = ssA.getSlides()[1];
-
-    	String[] firstTRs = new String[] {
-    			"This is a test title",
-    			"This is the title on page 2"
-    	};
-
-    	assertEquals(firstTRs[0], s1.getTextRuns()[0].getText());
-    	assertEquals(firstTRs[1], s2.getTextRuns()[0].getText());
-    }
-
-    /**
-     * Test the complex case - record order differs from slide order
-     */
-    public void testComplexCase() throws Exception {
-    	assertEquals(3, ssB.getSlides().length);
-
-    	Slide s1 = ssB.getSlides()[0];
-    	Slide s2 = ssB.getSlides()[1];
-    	Slide s3 = ssB.getSlides()[2];
-
-    	String[] firstTRs = new String[] {
-    			"Slide 1",
-    			"Slide 2",
-    			"Slide 3"
-    	};
-
-    	assertEquals(firstTRs[0], s1.getTextRuns()[0].getText());
-    	assertEquals(firstTRs[1], s2.getTextRuns()[0].getText());
-    	assertEquals(firstTRs[2], s3.getTextRuns()[0].getText());
-    }
-
-    /**
-     * Assert that the order of slides is correct.
-     *
-     * @param filename  file name of the slide show to assert
-     * @param titles    array of reference slide titles
-     */
-    protected void assertSlideOrdering(String filename, String[] titles) throws Exception {
-        SlideShow ppt = new SlideShow(new HSLFSlideShow(filename));
-        Slide[] slide = ppt.getSlides();
-
-        assertEquals(titles.length, slide.length);
-        for (int i = 0; i < slide.length; i++) {
-            String title = slide[i].getTitle();
-            assertEquals("Wrong slide title in " + filename, titles[i], title);
-        }
-    }
-
-    public void testTitles() throws Exception{
-        String dirname = System.getProperty("HSLF.testdata.path");
-
-        assertSlideOrdering(dirname + "/basic_test_ppt_file.ppt",
-                new String[]{
-                    "This is a test title",
-                    "This is the title on page 2"
-                });
-
-        assertSlideOrdering(dirname + "/incorrect_slide_order.ppt",
-                new String[]{
-                    "Slide 1",
-                    "Slide 2",
-                    "Slide 3"
-                });
-
-        assertSlideOrdering(dirname + "/next_test_ppt_file.ppt",
-                new String[]{
-                    "This is a test title",
-                    "This is the title on page 2"
-                });
-
-        assertSlideOrdering(dirname + "/Single_Coloured_Page.ppt",
-                new String[]{
-                    "This is a title, it" + (char)0x2019 +"s in black"
-                });
-
-        assertSlideOrdering(dirname + "/Single_Coloured_Page_With_Fonts_and_Alignments.ppt",
-                new String[]{
-                    "This is a title, it"+ (char)0x2019 +"s in black"
-                });
-
-        assertSlideOrdering(dirname + "/ParagraphStylesShorterThanCharStyles.ppt",
-                new String[]{
-                    "ROMANCE: AN ANALYSIS",
-                    "AGENDA",
-                    "You are an important supplier of various items that I need",
-                    '\n' + "Although The Psycho set back my relationship process, recovery is luckily enough under way",
-                    "Since the time that we seriously go out together, you rank highly among existing relationships",
-                    "Although our personal interests are mostly compatible, the greatest gap exists in Sex and Shopping",
-                    "Your physical characteristics are strong when compared with your competition",
-                    "The combination of your high physical appearance and personality rank you highly, although your sister is also a top prospect",
-                    "When people found out that we were going out, their responses have been mixed",
-                    "The benchmark of relationship lifecycles, suggests that we are on schedule",
-                    "In summary we can say that we are on the right track, but we must remain aware of possible roadblocks ",
-                    "THE ANSWER",
-                    "Unfortunately a huge disconnect exists between my needs and your existing service",
-                    "SUMMARY",
-                });
-    }
+		assertSlideOrdering(dirname + "/Single_Coloured_Page.ppt",
+				new String[] { "This is a title, it" + (char) 0x2019 + "s in black" });
+
+		assertSlideOrdering(dirname + "/Single_Coloured_Page_With_Fonts_and_Alignments.ppt",
+				new String[] { "This is a title, it" + (char) 0x2019 + "s in black" });
+
+		assertSlideOrdering(
+				dirname + "/ParagraphStylesShorterThanCharStyles.ppt",
+				new String[] {
+						"ROMANCE: AN ANALYSIS",
+						"AGENDA",
+						"You are an important supplier of various items that I need",
+						'\n' + "Although The Psycho set back my relationship process, recovery is luckily enough under way",
+						"Since the time that we seriously go out together, you rank highly among existing relationships",
+						"Although our personal interests are mostly compatible, the greatest gap exists in Sex and Shopping",
+						"Your physical characteristics are strong when compared with your competition",
+						"The combination of your high physical appearance and personality rank you highly, although your sister is also a top prospect",
+						"When people found out that we were going out, their responses have been mixed",
+						"The benchmark of relationship lifecycles, suggests that we are on schedule",
+						"In summary we can say that we are on the right track, but we must remain aware of possible roadblocks ",
+						"THE ANSWER",
+						"Unfortunately a huge disconnect exists between my needs and your existing service",
+						"SUMMARY", });
+	}
 }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/model/TestBlankFileRead.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/model/TestBlankFileRead.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/model/TestBlankFileRead.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/model/TestBlankFileRead.java Tue Aug 18 19:49:28 2009
@@ -27,107 +27,96 @@
 
 /**
  * Tests to verify that the library can read blank msg files.
- * 
+ *
  * @author Travis Ferguson
  *
  */
-public class TestBlankFileRead extends TestCase {
+public final class TestBlankFileRead extends TestCase {
 	private MAPIMessage mapiMessage;
-	
+
 	/**
 	 * Initialize this test, load up the blank.msg mapi message.
-	 * @throws IOException 
 	 */
 	public TestBlankFileRead() throws IOException {
 		String dirname = System.getProperty("HSMF.testdata.path");
 		this.mapiMessage = new MAPIMessage(dirname + "/blank.msg");
 	}
-	
-	/** 
+
+	/**
 	 * Check if we can read the body of the blank message, we expect "".
-	 * 
-	 * @throws Exception
 	 */
 	public void testReadBody() throws Exception {
 		try {
-			mapiMessage.getTextBody();		
+			mapiMessage.getTextBody();
 		} catch(ChunkNotFoundException exp) {
 			return;
 		}
-		
+
 		TestCase.fail("Should have thrown a ChunkNotFoundException but didn't");
 	}
-	
+
 
 	/**
 	 * Test to see if we can read the CC Chunk.
-	 * @throws ChunkNotFoundException 
-	 * 
 	 */
 	public void testReadDisplayCC() throws ChunkNotFoundException {
 		String obtained = mapiMessage.getDisplayCC();
 		String expected = "";
-		
+
 		TestCase.assertEquals(expected, obtained);
 	}
-	
+
 	/**
 	 * Test to see if we can read the CC Chunk.
-	 * @throws ChunkNotFoundException 
-	 * 
 	 */
 	public void testReadDisplayTo() throws ChunkNotFoundException {
 		String obtained = mapiMessage.getDisplayTo();
 		String expected = "";
-		
+
 		TestCase.assertEquals(expected, obtained);
 	}
-	
+
 	/**
 	 * Test to see if we can read the FROM Chunk.
-	 * @throws ChunkNotFoundException 
-	 * 
 	 */
-	public void testReadDisplayFrom() throws ChunkNotFoundException {
+	public void testReadDisplayFrom() {
 		try {
-			mapiMessage.getDisplayFrom();		
+			mapiMessage.getDisplayFrom();
 		} catch(ChunkNotFoundException exp) {
 			return;
 		}
-		
+
 		TestCase.fail("Should have thrown a ChunkNotFoundException but didn't");
 	}
-	
+
 	/**
 	 * Test to see if we can read the CC Chunk.
-	 * @throws ChunkNotFoundException 
-	 * 
 	 */
 	public void testReadDisplayBCC() throws ChunkNotFoundException {
 		String obtained = mapiMessage.getDisplayBCC();
 		String expected = "";
-		
+
 		TestCase.assertEquals(expected, obtained);
 	}
-	
-	
+
+
 	/**
 	 * Check if we can read the subject line of the blank message, we expect ""
-	 * 
+	 *
 	 * @throws Exception
 	 */
 	public void testReadSubject() throws Exception {
 		String obtained = mapiMessage.getSubject();
 		TestCase.assertEquals("", obtained);
 	}
-	
-	
+
+
 	/**
 	 * Check if we can read the subject line of the blank message, we expect ""
-	 * 
+	 *
 	 * @throws Exception
 	 */
-	public void testReadConversationTopic() throws Exception {
+	public void testReadConversationTopic() {
 		try {
 			mapiMessage.getConversationTopic();
 		} catch(ChunkNotFoundException exp) {
@@ -135,6 +124,6 @@
 		}
 		TestCase.fail("We shouldn't have a ConversationTopic node on the blank.msg file.");
 	}
-	
-	
+
+
 }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFPictures.java Tue Aug 18 19:49:28 2009
@@ -19,13 +19,14 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.util.List;
 
+import junit.framework.TestCase;
+
 import org.apache.poi.hwpf.model.PicturesTable;
 import org.apache.poi.hwpf.usermodel.Picture;
 
-import junit.framework.TestCase;
-
 /**
  * Test picture support in HWPF
  * @author nick
@@ -34,25 +35,25 @@
 	private String docAFile;
 	private String docBFile;
 	private String docCFile;
-    private String docDFile;
+	private String docDFile;
 
 	private String imgAFile;
 	private String imgBFile;
 	private String imgCFile;
-    private String imgDFile;
+	private String imgDFile;
 
-	protected void setUp() throws Exception {
+	protected void setUp() {
 		String dirname = System.getProperty("HWPF.testdata.path");
 
 		docAFile = dirname + "/testPictures.doc";
 		docBFile = dirname + "/two_images.doc";
 		docCFile = dirname + "/vector_image.doc";
-        docDFile = dirname + "/GaiaTest.doc";
+		docDFile = dirname + "/GaiaTest.doc";
 
 		imgAFile = dirname + "/simple_image.jpg";
 		imgBFile = dirname + "/simple_image.png";
 		imgCFile = dirname + "/vector_image.emf";
-        imgDFile = dirname + "/GaiaTestImg.png";
+		imgDFile = dirname + "/GaiaTestImg.png";
 	}
 
 	/**
@@ -134,21 +135,20 @@
 	 * Pending the missing files being uploaded to
 	 *  bug #44937
 	 */
-    public void BROKENtestEscherDrawing() throws Exception
-    {
-        HWPFDocument docD = new HWPFDocument(new FileInputStream(docDFile));
-        List allPictures = docD.getPicturesTable().getAllPictures();
+	public void BROKENtestEscherDrawing() throws Exception {
+		HWPFDocument docD = new HWPFDocument(new FileInputStream(docDFile));
+		List allPictures = docD.getPicturesTable().getAllPictures();
 
-        assertEquals(1, allPictures.size());
+		assertEquals(1, allPictures.size());
 
-        Picture pic = (Picture) allPictures.get(0);
-        assertNotNull(pic);
-        byte[] picD = readFile(imgDFile);
+		Picture pic = (Picture) allPictures.get(0);
+		assertNotNull(pic);
+		byte[] picD = readFile(imgDFile);
 
-        assertEquals(picD.length, pic.getContent().length);
+		assertEquals(picD.length, pic.getContent().length);
 
-        assertBytesSame(picD, pic.getContent());
-    }
+		assertBytesSame(picD, pic.getContent());
+	}
 
 	private void assertBytesSame(byte[] a, byte[] b) {
 		assertEquals(a.length, b.length);
@@ -157,17 +157,22 @@
 		}
 	}
 
-	private byte[] readFile(String file) throws Exception {
+	private static byte[] readFile(String file) {
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		FileInputStream fis = new FileInputStream(file);
-		byte[] buffer = new byte[1024];
-
-		int read = 0;
-		while(read > -1) {
-			read = fis.read(buffer);
-			if(read > 0) {
-				baos.write(buffer,0,read);
+		try {
+			FileInputStream fis = new FileInputStream(file);
+			byte[] buffer = new byte[1024];
+
+			int read = 0;
+			while(read > -1) {
+				read = fis.read(buffer);
+				if(read > 0) {
+					baos.write(buffer,0,read);
+				}
 			}
+			fis.close();
+		} catch (IOException e) {
+			throw new RuntimeException(e);
 		}
 
 		return baos.toByteArray();

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFRangeParts.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFRangeParts.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFRangeParts.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestHWPFRangeParts.java Tue Aug 18 19:49:28 2009
@@ -65,12 +65,12 @@
 		"The trick with this one is that it contains some Unicode based strings in it.\r" +
 		"Firstly, some currency symbols:\r" +
 		"\tGBP - \u00a3\r" +
-        "\tEUR - \u20ac\r" +
-        "Now, we\u2019ll have some French text, in bold and big:\r" +
-        "\tMoli\u00e8re\r" +
-        "And some normal French text:\r" +
-        "\tL'Avare ou l'\u00c9cole du mensonge\r" +
-        "That\u2019s it for page one\r"
+		"\tEUR - \u20ac\r" +
+		"Now, we\u2019ll have some French text, in bold and big:\r" +
+		"\tMoli\u00e8re\r" +
+		"And some normal French text:\r" +
+		"\tL'Avare ou l'\u00c9cole du mensonge\r" +
+		"That\u2019s it for page one\r"
 	;
 	private static final String u_page_2 =
 		"This is page two. Les Pr\u00e9cieuses ridicules. The end.\r"
@@ -109,7 +109,7 @@
 		);
 	}
 
-	public void testBasics() throws Exception {
+	public void testBasics() {
 		// First check the start and end bits
 		assertEquals(
 				0,
@@ -142,7 +142,7 @@
 		);
 	}
 
-	public void testContents() throws Exception {
+	public void testContents() {
 		Range r;
 
 		// Now check the real ranges
@@ -179,7 +179,7 @@
 		);
 	}
 
-	public void testBasicsUnicode() throws Exception {
+	public void testBasicsUnicode() {
 		// First check the start and end bits
 		assertEquals(
 				0,
@@ -213,7 +213,7 @@
 		);
 	}
 
-	public void testContentsUnicode() throws Exception {
+	public void testContentsUnicode() {
 		Range r;
 
 		// Now check the real ranges

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java Tue Aug 18 19:49:28 2009
@@ -111,7 +111,7 @@
     /**
      * Test textPieces based extraction
      */
-    public void testExtractFromTextPieces() throws Exception {
+    public void testExtractFromTextPieces() {
     	String text = extractor.getTextFromPieces();
     	assertEquals(p_text1_block, text);
     }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java Tue Aug 18 19:49:28 2009
@@ -28,11 +28,11 @@
  */
 public final class TestWordExtractorBugs extends TestCase {
 	private String dirname;
-    protected void setUp() throws Exception {
+	protected void setUp() {
 		dirname = System.getProperty("HWPF.testdata.path");
-    }
+	}
 
-    public void testProblemMetadata() throws Exception {
+	public void testProblemMetadata() throws Exception {
 		String filename = dirname + "/ProblemExtracting.doc";
 		WordExtractor extractor =
 			new WordExtractor(new FileInputStream(filename));
@@ -41,6 +41,5 @@
 		extractor.getText();
 		extractor.getParagraphText();
 		extractor.getTextFromPieces();
-    }
-
+	}
 }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug46610.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug46610.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug46610.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug46610.java Tue Aug 18 19:49:28 2009
@@ -29,7 +29,7 @@
 public class TestBug46610 extends TestCase {
   private String dirname;
 
-  protected void setUp() throws Exception {
+  protected void setUp() {
     dirname = System.getProperty("HWPF.testdata.path");
   }
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestHeaderStories.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestHeaderStories.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestHeaderStories.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestHeaderStories.java Tue Aug 18 19:49:28 2009
@@ -25,8 +25,7 @@
 import org.apache.poi.hwpf.HWPFDocument;
 
 /**
- * Tests for the handling of header stories into
- *  headers, footers etc
+ * Tests for the handling of header stories into headers, footers etc
  */
 public final class TestHeaderStories extends TestCase {
 	private HWPFDocument none;
@@ -38,71 +37,60 @@
 	private HWPFDocument unicode;
 	private HWPFDocument withFields;
 
-    protected void setUp() throws Exception {
+	protected void setUp() throws Exception {
 		String dirname = System.getProperty("HWPF.testdata.path");
 
-		none = new HWPFDocument(
-				new FileInputStream(new File(dirname, "NoHeadFoot.doc"))
-		);
-		header = new HWPFDocument(
-				new FileInputStream(new File(dirname, "ThreeColHead.doc"))
-		);
-		footer = new HWPFDocument(
-				new FileInputStream(new File(dirname, "ThreeColFoot.doc"))
-		);
-		headerFooter = new HWPFDocument(
-				new FileInputStream(new File(dirname, "SimpleHeadThreeColFoot.doc"))
-		);
-		oddEven = new HWPFDocument(
-				new FileInputStream(new File(dirname, "PageSpecificHeadFoot.doc"))
-		);
-		diffFirst = new HWPFDocument(
-				new FileInputStream(new File(dirname, "DiffFirstPageHeadFoot.doc"))
-		);
+		none = new HWPFDocument(new FileInputStream(new File(dirname, "NoHeadFoot.doc")));
+		header = new HWPFDocument(new FileInputStream(new File(dirname, "ThreeColHead.doc")));
+		footer = new HWPFDocument(new FileInputStream(new File(dirname, "ThreeColFoot.doc")));
+		headerFooter = new HWPFDocument(new FileInputStream(new File(dirname,
+				"SimpleHeadThreeColFoot.doc")));
+		oddEven = new HWPFDocument(new FileInputStream(
+				new File(dirname, "PageSpecificHeadFoot.doc")));
+		diffFirst = new HWPFDocument(new FileInputStream(new File(dirname,
+				"DiffFirstPageHeadFoot.doc")));
 		unicode = new HWPFDocument(
-				new FileInputStream(new File(dirname, "HeaderFooterUnicode.doc"))
-		);
+				new FileInputStream(new File(dirname, "HeaderFooterUnicode.doc")));
 		withFields = new HWPFDocument(
-				new FileInputStream(new File(dirname, "HeaderWithMacros.doc"))
-		);
-    }
-
-    public void testNone() throws Exception {
-    	HeaderStories hs = new HeaderStories(none);
-
-    	assertNull(hs.getPlcfHdd());
-    	assertEquals(0, hs.getRange().text().length());
-    }
-
-    public void testHeader() throws Exception {
-    	HeaderStories hs = new HeaderStories(header);
-
-    	assertEquals(60, hs.getRange().text().length());
-
-    	// Should have the usual 6 separaters
-    	// Then all 6 of the different header/footer kinds
-    	// Finally a terminater
-    	assertEquals(13, hs.getPlcfHdd().length());
-
-    	assertEquals(215, hs.getRange().getStartOffset());
-
-    	assertEquals(0, hs.getPlcfHdd().getProperty(0).getStart());
-    	assertEquals(3, hs.getPlcfHdd().getProperty(1).getStart());
-    	assertEquals(6, hs.getPlcfHdd().getProperty(2).getStart());
-    	assertEquals(6, hs.getPlcfHdd().getProperty(3).getStart());
-    	assertEquals(9, hs.getPlcfHdd().getProperty(4).getStart());
-    	assertEquals(12, hs.getPlcfHdd().getProperty(5).getStart());
-
-    	assertEquals(12, hs.getPlcfHdd().getProperty(6).getStart());
-    	assertEquals(12, hs.getPlcfHdd().getProperty(7).getStart());
-    	assertEquals(59, hs.getPlcfHdd().getProperty(8).getStart());
-    	assertEquals(59, hs.getPlcfHdd().getProperty(9).getStart());
-    	assertEquals(59, hs.getPlcfHdd().getProperty(10).getStart());
-    	assertEquals(59, hs.getPlcfHdd().getProperty(11).getStart());
+				new FileInputStream(new File(dirname, "HeaderWithMacros.doc")));
+	}
 
-    	assertEquals(59, hs.getPlcfHdd().getProperty(12).getStart());
+	public void testNone() {
+		HeaderStories hs = new HeaderStories(none);
 
-    	assertEquals("\u0003\r\r", hs.getFootnoteSeparator());
+		assertNull(hs.getPlcfHdd());
+		assertEquals(0, hs.getRange().text().length());
+	}
+
+	public void testHeader() {
+		HeaderStories hs = new HeaderStories(header);
+
+		assertEquals(60, hs.getRange().text().length());
+
+		// Should have the usual 6 separaters
+		// Then all 6 of the different header/footer kinds
+		// Finally a terminater
+		assertEquals(13, hs.getPlcfHdd().length());
+
+		assertEquals(215, hs.getRange().getStartOffset());
+
+		assertEquals(0, hs.getPlcfHdd().getProperty(0).getStart());
+		assertEquals(3, hs.getPlcfHdd().getProperty(1).getStart());
+		assertEquals(6, hs.getPlcfHdd().getProperty(2).getStart());
+		assertEquals(6, hs.getPlcfHdd().getProperty(3).getStart());
+		assertEquals(9, hs.getPlcfHdd().getProperty(4).getStart());
+		assertEquals(12, hs.getPlcfHdd().getProperty(5).getStart());
+
+		assertEquals(12, hs.getPlcfHdd().getProperty(6).getStart());
+		assertEquals(12, hs.getPlcfHdd().getProperty(7).getStart());
+		assertEquals(59, hs.getPlcfHdd().getProperty(8).getStart());
+		assertEquals(59, hs.getPlcfHdd().getProperty(9).getStart());
+		assertEquals(59, hs.getPlcfHdd().getProperty(10).getStart());
+		assertEquals(59, hs.getPlcfHdd().getProperty(11).getStart());
+
+		assertEquals(59, hs.getPlcfHdd().getProperty(12).getStart());
+
+		assertEquals("\u0003\r\r", hs.getFootnoteSeparator());
 		assertEquals("\u0004\r\r", hs.getFootnoteContSeparator());
 		assertEquals("", hs.getFootnoteContNote());
 		assertEquals("\u0003\r\r", hs.getEndnoteSeparator());
@@ -113,63 +101,65 @@
 		assertEquals("", hs.getEvenHeader());
 		assertEquals("First header column!\tMid header Right header!\r\r", hs.getOddHeader());
 
-
 		assertEquals("", hs.getFirstFooter());
 		assertEquals("", hs.getEvenFooter());
 		assertEquals("", hs.getOddFooter());
-    }
+	}
 
-    public void testFooter() throws Exception {
-    	HeaderStories hs = new HeaderStories(footer);
+	public void testFooter() {
+		HeaderStories hs = new HeaderStories(footer);
 
 		assertEquals("", hs.getFirstHeader());
 		assertEquals("", hs.getEvenHeader());
 		assertEquals("", hs.getOddHeader()); // Was \r\r but gets emptied
 
-
 		assertEquals("", hs.getFirstFooter());
 		assertEquals("", hs.getEvenFooter());
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getOddFooter());
-    }
+	}
 
-    public void testHeaderFooter() throws Exception {
-    	HeaderStories hs = new HeaderStories(headerFooter);
+	public void testHeaderFooter() {
+		HeaderStories hs = new HeaderStories(headerFooter);
 
 		assertEquals("", hs.getFirstHeader());
 		assertEquals("", hs.getEvenHeader());
 		assertEquals("I am some simple header text here\r\r\r", hs.getOddHeader());
 
-
 		assertEquals("", hs.getFirstFooter());
 		assertEquals("", hs.getEvenFooter());
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getOddFooter());
-    }
+	}
 
-    public void testOddEven() throws Exception {
-    	HeaderStories hs = new HeaderStories(oddEven);
+	public void testOddEven() {
+		HeaderStories hs = new HeaderStories(oddEven);
 
 		assertEquals("", hs.getFirstHeader());
-		assertEquals("[This is an Even Page, with a Header]\u0007August 20, 2008\u0007\u0007\r\r", hs.getEvenHeader());
-		assertEquals("August 20, 2008\u0007[ODD Page Header text]\u0007\u0007\r\r", hs.getOddHeader());
-
+		assertEquals("[This is an Even Page, with a Header]\u0007August 20, 2008\u0007\u0007\r\r",
+				hs.getEvenHeader());
+		assertEquals("August 20, 2008\u0007[ODD Page Header text]\u0007\u0007\r\r", hs
+				.getOddHeader());
 
 		assertEquals("", hs.getFirstFooter());
-		assertEquals("\u0007Page \u0013 PAGE  \\* MERGEFORMAT \u00142\u0015\u0007\u0007\u0007\u0007\u0007\u0007\u0007This is a simple footer on the second page\r\r", hs.getEvenFooter());
+		assertEquals(
+				"\u0007Page \u0013 PAGE  \\* MERGEFORMAT \u00142\u0015\u0007\u0007\u0007\u0007\u0007\u0007\u0007This is a simple footer on the second page\r\r",
+				hs.getEvenFooter());
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getOddFooter());
 
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getFooter(1));
-		assertEquals("\u0007Page \u0013 PAGE  \\* MERGEFORMAT \u00142\u0015\u0007\u0007\u0007\u0007\u0007\u0007\u0007This is a simple footer on the second page\r\r", hs.getFooter(2));
+		assertEquals(
+				"\u0007Page \u0013 PAGE  \\* MERGEFORMAT \u00142\u0015\u0007\u0007\u0007\u0007\u0007\u0007\u0007This is a simple footer on the second page\r\r",
+				hs.getFooter(2));
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getFooter(3));
-    }
+	}
 
-    public void testFirst() throws Exception {
-    	HeaderStories hs = new HeaderStories(diffFirst);
+	public void testFirst() {
+		HeaderStories hs = new HeaderStories(diffFirst);
 
-		assertEquals("I am the header on the first page, and I\u2019m nice and simple\r\r", hs.getFirstHeader());
+		assertEquals("I am the header on the first page, and I\u2019m nice and simple\r\r", hs
+				.getFirstHeader());
 		assertEquals("", hs.getEvenHeader());
 		assertEquals("First header column!\tMid header Right header!\r\r", hs.getOddHeader());
 
-
 		assertEquals("The footer of the first page\r\r", hs.getFirstFooter());
 		assertEquals("", hs.getEvenFooter());
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getOddFooter());
@@ -177,29 +167,31 @@
 		assertEquals("The footer of the first page\r\r", hs.getFooter(1));
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getFooter(2));
 		assertEquals("Footer Left\tFooter Middle Footer Right\r\r", hs.getFooter(3));
-    }
+	}
 
-    public void testUnicode() throws Exception {
-    	HeaderStories hs = new HeaderStories(unicode);
+	public void testUnicode() {
+		HeaderStories hs = new HeaderStories(unicode);
 
 		assertEquals("", hs.getFirstHeader());
 		assertEquals("", hs.getEvenHeader());
-		assertEquals("This is a simple header, with a \u20ac euro symbol in it.\r\r\r", hs.getOddHeader());
-
+		assertEquals("This is a simple header, with a \u20ac euro symbol in it.\r\r\r", hs
+				.getOddHeader());
 
 		assertEquals("", hs.getFirstFooter());
 		assertEquals("", hs.getEvenFooter());
 		assertEquals("The footer, with Moli\u00e8re, has Unicode in it.\r\r", hs.getOddFooter());
-    }
+	}
 
-    public void testWithFields() throws Exception {
-    	HeaderStories hs = new HeaderStories(withFields);
-    	assertFalse(hs.areFieldsStripped());
-
-    	assertEquals("HEADER GOES HERE. 8/12/2008 \u0013 AUTHOR   \\* MERGEFORMAT \u0014Eric Roch\u0015\r\r\r", hs.getOddHeader());
-
-    	// Now turn on stripping
-    	hs.setAreFieldsStripped(true);
-    	assertEquals("HEADER GOES HERE. 8/12/2008 Eric Roch\r\r\r", hs.getOddHeader());
-    }
+	public void testWithFields() {
+		HeaderStories hs = new HeaderStories(withFields);
+		assertFalse(hs.areFieldsStripped());
+
+		assertEquals(
+				"HEADER GOES HERE. 8/12/2008 \u0013 AUTHOR   \\* MERGEFORMAT \u0014Eric Roch\u0015\r\r\r",
+				hs.getOddHeader());
+
+		// Now turn on stripping
+		hs.setAreFieldsStripped(true);
+		assertEquals("HEADER GOES HERE. 8/12/2008 Eric Roch\r\r\r", hs.getOddHeader());
+	}
 }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRange.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRange.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRange.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRange.java Tue Aug 18 19:49:28 2009
@@ -24,7 +24,7 @@
  *  text replacement or textual contents
  */
 public final class TestRange extends TestCase {
-	public void testFieldStripping() throws Exception {
+	public void testFieldStripping() {
 		String exp = "This is some text.";
 
 		String single = "This is some \u0013Blah!\u0015text.";

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java Tue Aug 18 19:49:28 2009
@@ -47,7 +47,7 @@
 
 	private String illustrativeDocFile;
 
-	protected void setUp() throws Exception {
+	protected void setUp() {
 
 		String dirname = System.getProperty("HWPF.testdata.path");
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java Tue Aug 18 19:49:28 2009
@@ -39,7 +39,7 @@
 
 	private String illustrativeDocFile;
 
-	protected void setUp() throws Exception {
+	protected void setUp() {
 
 		String dirname = System.getProperty("HWPF.testdata.path");
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeProperties.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeProperties.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeProperties.java Tue Aug 18 19:49:28 2009
@@ -79,7 +79,7 @@
 	}
 
 
-	public void testAsciiTextParagraphs() throws Exception {
+	public void testAsciiTextParagraphs() {
 		Range r = a.getRange();
 		assertEquals(
 				a_page_1 +
@@ -138,7 +138,7 @@
 		);
 	}
 
-	public void testAsciiStyling() throws Exception {
+	public void testAsciiStyling() {
 		Range r = a.getRange();
 
 		Paragraph p1 = r.getParagraph(0);
@@ -160,7 +160,7 @@
 	 * Tests the raw definitions of the paragraphs of
 	 *  a unicode document
 	 */
-	public void testUnicodeParagraphDefinitions() throws Exception {
+	public void testUnicodeParagraphDefinitions() {
 		Range r = u.getRange();
 		String[] p1_parts = u_page_1.split("\r");
 		String[] p2_parts = u_page_2.split("\r");
@@ -251,7 +251,7 @@
 	/**
 	 * Tests the paragraph text of a unicode document
 	 */
-	public void testUnicodeTextParagraphs() throws Exception {
+	public void testUnicodeTextParagraphs() {
 		Range r = u.getRange();
 		assertEquals(
 				u_page_1 +
@@ -281,7 +281,7 @@
 		assertEquals(page_break + "\r", r.getParagraph(10).text());
 		assertEquals(p2_parts[0] + "\r", r.getParagraph(11).text());
 	}
-	public void testUnicodeStyling() throws Exception {
+	public void testUnicodeStyling() {
 		Range r = u.getRange();
 		String[] p1_parts = u_page_1.split("\r");
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java Tue Aug 18 19:49:28 2009
@@ -42,7 +42,7 @@
 
 	private String illustrativeDocFile;
 
-	protected void setUp() throws Exception {
+	protected void setUp() {
 
 		String dirname = System.getProperty("HWPF.testdata.path");
 

Modified: poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java Tue Aug 18 19:49:28 2009
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -30,7 +29,7 @@
 /**
  * Tests that POIDocument correctly loads and saves the common
  *  (hspf) Document Properties.
- * 
+ *
  * This is part 1 of 2 of the tests - it only does the POIDocuments
  *  which are part of the Main (not scratchpad)
  *
@@ -45,26 +44,26 @@
 	 * Set things up, two spreadsheets for our testing
 	 */
 	public void setUp() {
-		
+
 		doc = HSSFTestDataSamples.openSampleWorkbook("DateFormats.xls");
 		doc2 = HSSFTestDataSamples.openSampleWorkbook("StringFormulas.xls");
 	}
-	
-	public void testReadProperties() throws Exception {
+
+	public void testReadProperties() {
 		// We should have both sets
 		assertNotNull(doc.getDocumentSummaryInformation());
 		assertNotNull(doc.getSummaryInformation());
-		
+
 		// Check they are as expected for the test doc
 		assertEquals("Administrator", doc.getSummaryInformation().getAuthor());
 		assertEquals(0, doc.getDocumentSummaryInformation().getByteCount());
 	}
-		
-	public void testReadProperties2() throws Exception {	
+
+	public void testReadProperties2() {
 		// Check again on the word one
 		assertNotNull(doc2.getDocumentSummaryInformation());
 		assertNotNull(doc2.getSummaryInformation());
-		
+
 		assertEquals("Avik Sengupta", doc2.getSummaryInformation().getAuthor());
 		assertEquals(null, doc2.getSummaryInformation().getKeywords());
 		assertEquals(0, doc2.getDocumentSummaryInformation().getByteCount());
@@ -75,7 +74,7 @@
 		POIFSFileSystem outFS = new POIFSFileSystem();
 		doc.readProperties();
 		doc.writeProperties(outFS);
-		
+
 		// Should now hold them
 		assertNotNull(
 				outFS.createDocumentInputStream("\005SummaryInformation")
@@ -87,21 +86,21 @@
 
 	public void testWriteReadProperties() throws Exception {
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		
+
 		// Write them out
 		POIFSFileSystem outFS = new POIFSFileSystem();
 		doc.readProperties();
 		doc.writeProperties(outFS);
 		outFS.writeFilesystem(baos);
-		
+
 		// Create a new version
 		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
 		POIFSFileSystem inFS = new POIFSFileSystem(bais);
-		
+
 		// Check they're still there
 		doc.filesystem = inFS;
 		doc.readProperties();
-		
+
 		// Delegate test
 		testReadProperties();
 	}

Modified: poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipWMFRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipWMFRecord.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipWMFRecord.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipWMFRecord.java Tue Aug 18 19:49:28 2009
@@ -21,13 +21,11 @@
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.HexRead;
 
-public class TestEscherBlipWMFRecord extends TestCase
-{
+public final class TestEscherBlipWMFRecord extends TestCase {
     private String dataStr;
     private byte[] data;
 
-    protected void setUp() throws Exception
-    {
+    protected void setUp() {
         dataStr = "2C 15 18 F0 34 00 00 00 01 01 01 01 01 01 01 01 " +
                         "01 01 01 01 01 01 01 01 06 00 00 00 03 00 00 00 " +
                         "01 00 00 00 04 00 00 00 02 00 00 00 0A 00 00 00 " +

Modified: poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBoolProperty.java Tue Aug 18 19:49:28 2009
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,17 +14,14 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
+
 package org.apache.poi.ddf;
 
 import junit.framework.TestCase;
 
-public class TestEscherBoolProperty extends TestCase
-{
-    public void testToString() throws Exception
-    {
+public final class TestEscherBoolProperty extends TestCase {
+    public void testToString() {
         EscherBoolProperty p = new EscherBoolProperty((short)1, 1);
         assertEquals("propNum: 1, RAW: 0x0001, propName: unknown, complex: false, blipId: false, value: 1 (0x00000001)", p.toString());
     }
-
 }

Modified: poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherChildAnchorRecord.java Tue Aug 18 19:49:28 2009
@@ -21,8 +21,7 @@
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.HexRead;
 
-public class TestEscherChildAnchorRecord extends TestCase
-{
+public final class TestEscherChildAnchorRecord extends TestCase {
     public void testSerialize() {
         EscherChildAnchorRecord r = createRecord();
 
@@ -38,8 +37,7 @@
                 "04, 00, 00, 00]", HexDump.toHex( data ) );
     }
 
-    public void testFillFields() throws Exception
-    {
+    public void testFillFields() {
         String hexData = "01 00 " +
                 "0F F0 " +
                 "10 00 00 00 " +
@@ -73,8 +71,7 @@
         assertEquals( expected, createRecord().toString() );
     }
 
-    private static EscherChildAnchorRecord createRecord()
-    {
+    private static EscherChildAnchorRecord createRecord() {
         EscherChildAnchorRecord r = new EscherChildAnchorRecord();
         r.setRecordId( EscherChildAnchorRecord.RECORD_ID );
         r.setOptions( (short) 0x0001 );

Modified: poi/trunk/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hpsf/extractor/TestHPSFPropertiesExtractor.java Tue Aug 18 19:49:28 2009
@@ -14,41 +14,42 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
+
 package org.apache.poi.hpsf.extractor;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
+
+import junit.framework.TestCase;
 
 import org.apache.poi.hssf.extractor.ExcelExtractor;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 
-import junit.framework.TestCase;
-
-public class TestHPSFPropertiesExtractor extends TestCase {
+public final class TestHPSFPropertiesExtractor extends TestCase {
 	private String dir;
-	
-    protected void setUp() throws Exception {
-    	dir = System.getProperty("HPSF.testdata.path");
-    	assertNotNull("HPSF.testdata.path not set", dir);
+
+	protected void setUp() {
+		dir = System.getProperty("HPSF.testdata.path");
+		assertNotNull("HPSF.testdata.path not set", dir);
 	}
-    
+
 	public void testNormalProperties() throws Exception {
-		POIFSFileSystem fs = new POIFSFileSystem(
-				new FileInputStream(new File(dir, "TestMickey.doc"))
-		);
+		POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(
+				new File(dir, "TestMickey.doc")));
 		HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
 		ext.getText();
-		
+
 		// Check each bit in turn
 		String sinfText = ext.getSummaryInformationText();
 		String dinfText = ext.getDocumentSummaryInformationText();
-		
+
 		assertTrue(sinfText.indexOf("TEMPLATE = Normal") > -1);
 		assertTrue(sinfText.indexOf("SUBJECT = sample subject") > -1);
 		assertTrue(dinfText.indexOf("MANAGER = sample manager") > -1);
 		assertTrue(dinfText.indexOf("COMPANY = sample company") > -1);
-		
+
 		// Now overall
 		String text = ext.getText();
 		assertTrue(text.indexOf("TEMPLATE = Normal") > -1);
@@ -56,22 +57,22 @@
 		assertTrue(text.indexOf("MANAGER = sample manager") > -1);
 		assertTrue(text.indexOf("COMPANY = sample company") > -1);
 	}
+
 	public void testNormalUnicodeProperties() throws Exception {
-		POIFSFileSystem fs = new POIFSFileSystem(
-				new FileInputStream(new File(dir, "TestUnicode.xls"))
-		);
+		POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(new File(dir,
+				"TestUnicode.xls")));
 		HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
 		ext.getText();
-		
+
 		// Check each bit in turn
 		String sinfText = ext.getSummaryInformationText();
 		String dinfText = ext.getDocumentSummaryInformationText();
-		
+
 		assertTrue(sinfText.indexOf("AUTHOR = marshall") > -1);
 		assertTrue(sinfText.indexOf("TITLE = Titel: \u00c4h") > -1);
 		assertTrue(dinfText.indexOf("COMPANY = Schreiner") > -1);
 		assertTrue(dinfText.indexOf("SCALE = false") > -1);
-		
+
 		// Now overall
 		String text = ext.getText();
 		assertTrue(text.indexOf("AUTHOR = marshall") > -1);
@@ -79,37 +80,41 @@
 		assertTrue(text.indexOf("COMPANY = Schreiner") > -1);
 		assertTrue(text.indexOf("SCALE = false") > -1);
 	}
+
 	public void testCustomProperties() throws Exception {
-		POIFSFileSystem fs = new POIFSFileSystem(
-				new FileInputStream(new File(dir, "TestMickey.doc"))
-		);
+		POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(
+				new File(dir, "TestMickey.doc")));
 		HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
 
 		// Custom properties are part of the document info stream
 		String dinfText = ext.getDocumentSummaryInformationText();
 		assertTrue(dinfText.indexOf("Client = sample client") > -1);
 		assertTrue(dinfText.indexOf("Division = sample division") > -1);
-		
+
 		String text = ext.getText();
 		assertTrue(text.indexOf("Client = sample client") > -1);
 		assertTrue(text.indexOf("Division = sample division") > -1);
 	}
-    
-    public void testConstructors() throws Exception {
-		POIFSFileSystem fs = new POIFSFileSystem(
-				new FileInputStream(new File(dir, "TestUnicode.xls"))
-		);
-		HSSFWorkbook wb = new HSSFWorkbook(fs);
+
+	public void testConstructors() {
+		POIFSFileSystem fs;
+		HSSFWorkbook wb;
+		try {
+			fs = new POIFSFileSystem(new FileInputStream(new File(dir, "TestUnicode.xls")));
+			wb = new HSSFWorkbook(fs);
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
 		ExcelExtractor excelExt = new ExcelExtractor(wb);
-		
+
 		String fsText = (new HPSFPropertiesExtractor(fs)).getText();
 		String hwText = (new HPSFPropertiesExtractor(wb)).getText();
 		String eeText = (new HPSFPropertiesExtractor(excelExt)).getText();
-		
+
 		assertEquals(fsText, hwText);
 		assertEquals(fsText, eeText);
-		
+
 		assertTrue(fsText.indexOf("AUTHOR = marshall") > -1);
 		assertTrue(fsText.indexOf("TITLE = Titel: \u00c4h") > -1);
-    }
+	}
 }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager.java Tue Aug 18 19:49:28 2009
@@ -14,16 +14,15 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
+
 package org.apache.poi.hssf.model;
 
 import junit.framework.TestCase;
 import org.apache.poi.ddf.EscherDggRecord;
 import org.apache.poi.ddf.EscherDgRecord;
 
-public class TestDrawingManager extends TestCase
-{
-    public void testFindFreeSPIDBlock() throws Exception
-    {
+public final class TestDrawingManager extends TestCase {
+    public void testFindFreeSPIDBlock() {
         EscherDggRecord dgg = new EscherDggRecord();
         DrawingManager dm = new DrawingManager( dgg );
         dgg.setShapeIdMax( 1024 );
@@ -34,8 +33,7 @@
         assertEquals( 2048, dm.findFreeSPIDBlock() );
     }
 
-    public void testFindNewDrawingGroupId() throws Exception
-    {
+    public void testFindNewDrawingGroupId() {
         EscherDggRecord dgg = new EscherDggRecord();
         dgg.setDrawingsSaved( 1 );
         dgg.setFileIdClusters( new EscherDggRecord.FileIdCluster[]{
@@ -48,8 +46,7 @@
         assertEquals( 3, dm.findNewDrawingGroupId() );
     }
 
-    public void testDrawingGroupExists() throws Exception
-    {
+    public void testDrawingGroupExists() {
         EscherDggRecord dgg = new EscherDggRecord();
         dgg.setDrawingsSaved( 1 );
         dgg.setFileIdClusters( new EscherDggRecord.FileIdCluster[]{
@@ -60,8 +57,7 @@
         assertFalse( dm.drawingGroupExists( (short) 3 ) );
     }
 
-    public void testCreateDgRecord() throws Exception
-    {
+    public void testCreateDgRecord() {
         EscherDggRecord dgg = new EscherDggRecord();
         dgg.setDrawingsSaved( 0 );
         dgg.setFileIdClusters( new EscherDggRecord.FileIdCluster[]{} );
@@ -76,8 +72,7 @@
         assertEquals( 0, dm.getDgg().getFileIdClusters()[0].getNumShapeIdsUsed() );
     }
 
-    public void testAllocateShapeId() throws Exception
-    {
+    public void testAllocateShapeId() {
         EscherDggRecord dgg = new EscherDggRecord();
         dgg.setDrawingsSaved( 0 );
         dgg.setFileIdClusters( new EscherDggRecord.FileIdCluster[]{} );
@@ -93,5 +88,4 @@
         assertEquals( 1024, dg.getLastMSOSPID() );
         assertEquals( 1, dg.getNumShapes() );
     }
-
 }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/model/TestDrawingManager2.java Tue Aug 18 19:49:28 2009
@@ -1,40 +1,37 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
 package org.apache.poi.hssf.model;
 
 import junit.framework.TestCase;
 import org.apache.poi.ddf.EscherDggRecord;
 import org.apache.poi.ddf.EscherDgRecord;
 
-public class TestDrawingManager2 extends TestCase
-{
+public final class TestDrawingManager2 extends TestCase {
     private DrawingManager2 drawingManager2;
     private EscherDggRecord dgg;
 
-    protected void setUp() throws Exception
-    {
-        super.setUp();
+    protected void setUp() {
         dgg = new EscherDggRecord();
         dgg.setFileIdClusters( new EscherDggRecord.FileIdCluster[0] );
         drawingManager2 = new DrawingManager2( dgg );
     }
 
-    public void testCreateDgRecord() throws Exception
-    {
+    public void testCreateDgRecord() {
         EscherDgRecord dgRecord1 = drawingManager2.createDgRecord();
         assertEquals( 1, dgRecord1.getDrawingGroupId() );
         assertEquals( -1, dgRecord1.getLastMSOSPID() );
@@ -49,8 +46,7 @@
         assertEquals( 0, dgg.getNumShapesSaved() );
     }
 
-    public void testAllocateShapeId() throws Exception
-    {
+    public void testAllocateShapeId() {
         EscherDgRecord dgRecord1 = drawingManager2.createDgRecord();
         EscherDgRecord dgRecord2 = drawingManager2.createDgRecord();
 
@@ -79,4 +75,4 @@
         assertEquals( 4, dgg.getNumIdClusters() );
         assertEquals( 1026, dgg.getNumShapesSaved() );
     }
-}
\ No newline at end of file
+}

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/model/TestFormulaParserIf.java Tue Aug 18 19:49:28 2009
@@ -41,11 +41,11 @@
 	private static Ptg[] parseFormula(String formula) {
 		return TestFormulaParser.parseFormula(formula);
 	}
-	
-	private static Ptg[] confirmTokenClasses(String formula, Class[] expectedClasses) {
+
+	private static Ptg[] confirmTokenClasses(String formula, Class<?>[] expectedClasses) {
 		return TestFormulaParser.confirmTokenClasses(formula, expectedClasses);
 	}
-	
+
 	private static void confirmAttrData(Ptg[] ptgs, int i, int expectedData) {
 		Ptg ptg = ptgs[i];
 		if (!(ptg instanceof AttrPtg)) {
@@ -54,10 +54,10 @@
 		AttrPtg attrPtg = (AttrPtg) ptg;
 		assertEquals(expectedData, attrPtg.getData());
 	}
-	
+
 	public void testSimpleIf() {
-		
-		Class[] expClss;
+
+		Class<?>[] expClss;
 
 		expClss = new Class[] {
 				RefPtg.class,
@@ -77,8 +77,8 @@
 	}
 
 	public void testSimpleIfNoFalseParam() {
-		
-		Class[] expClss;
+
+		Class<?>[] expClss;
 
 		expClss = new Class[] {
 				RefPtg.class,
@@ -95,8 +95,8 @@
 	}
 
 	public void testIfWithLargeParams() {
-		
-		Class[] expClss;
+
+		Class<?>[] expClss;
 
 		expClss = new Class[] {
 				RefPtg.class,
@@ -110,11 +110,11 @@
 				AddPtg.class,
 				FuncPtg.class,
 				AttrPtg.class, // tAttrSkip
-				
+
 				RefPtg.class,
 				RefPtg.class,
 				FuncPtg.class,
-				
+
 				AttrPtg.class, // tAttrSkip
 				FuncVarPtg.class,
 		};
@@ -125,10 +125,10 @@
 		confirmAttrData(ptgs, 9, 20);
 		confirmAttrData(ptgs, 13, 3);
 	}
-	
+
 	public void testNestedIf() {
-		
-		Class[] expClss;
+
+		Class<?>[] expClss;
 
 		expClss = new Class[] {
 
@@ -164,7 +164,7 @@
 		confirmAttrData(ptgs, 15, 3);
 		confirmAttrData(ptgs, 17, 3);
 	}
-	
+
 	public void testEmbeddedIf() {
 		Ptg[] ptgs = parseFormula("IF(3>=1,\"*\",IF(4<>1,\"first\",\"second\"))");
 		assertEquals(17, ptgs.length);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java?rev=805552&r1=805551&r2=805552&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/model/TestWorkbook.java Tue Aug 18 19:49:28 2009
@@ -28,37 +28,37 @@
  * @author Glen Stampoultzis (glens at apache.org)
  */
 public final class TestWorkbook extends TestCase {
-	public void testFontStuff() throws Exception {
+	public void testFontStuff() {
 		Workbook wb = (new HW()).getWorkbook();
-		
+
 		assertEquals(4, wb.getNumberOfFontRecords());
 		assertEquals(68, wb.getRecords().size());
-		
+
 		FontRecord f1 = wb.getFontRecordAt(0);
 		FontRecord f4 = wb.getFontRecordAt(3);
-		
+
 		assertEquals(0, wb.getFontIndex(f1));
 		assertEquals(3, wb.getFontIndex(f4));
-		
+
 		assertEquals(f1, wb.getFontRecordAt(0));
 		assertEquals(f4, wb.getFontRecordAt(3));
-		
+
 		// There is no 4! new ones go in at 5
-		
+
 		FontRecord n = wb.createNewFont();
 		assertEquals(69, wb.getRecords().size());
 		assertEquals(5, wb.getNumberOfFontRecords());
 		assertEquals(5, wb.getFontIndex(n));
 		assertEquals(n, wb.getFontRecordAt(5));
-		
+
 		// And another
 		FontRecord n6 = wb.createNewFont();
 		assertEquals(70, wb.getRecords().size());
 		assertEquals(6, wb.getNumberOfFontRecords());
 		assertEquals(6, wb.getFontIndex(n6));
 		assertEquals(n6, wb.getFontRecordAt(6));
-		
-		
+
+
 		// Now remove the one formerly at 5
 		assertEquals(70, wb.getRecords().size());
 		wb.removeFontRecord(n);
@@ -68,13 +68,13 @@
 		assertEquals(5, wb.getNumberOfFontRecords());
 		assertEquals(5, wb.getFontIndex(n6));
 		assertEquals(n6, wb.getFontRecordAt(5));
-		
+
 		// Check that the earlier ones are unchanged
 		assertEquals(0, wb.getFontIndex(f1));
 		assertEquals(3, wb.getFontIndex(f4));
 		assertEquals(f1, wb.getFontRecordAt(0));
 		assertEquals(f4, wb.getFontRecordAt(3));
-		
+
 		// Finally, add another one
 		FontRecord n7 = wb.createNewFont();
 		assertEquals(70, wb.getRecords().size());
@@ -82,13 +82,13 @@
 		assertEquals(6, wb.getFontIndex(n7));
 		assertEquals(n7, wb.getFontRecordAt(6));
 	}
-	
-	private class HW extends HSSFWorkbook {
-		private HW() {
+
+	private static final class HW extends HSSFWorkbook {
+		public HW() {
 			super();
 		}
 		protected Workbook getWorkbook() {
 			return super.getWorkbook();
 		}
 	}
-}
\ No newline at end of file
+}



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


Mime
View raw message