poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1711581 - /poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
Date Sat, 31 Oct 2015 09:29:32 GMT
Author: onealj
Date: Sat Oct 31 09:29:32 2015
New Revision: 1711581

URL: http://svn.apache.org/viewvc?rev=1711581&view=rev
Log:
replace deprecated usage of o.a.p.ss.util.Region with o.a.p.ss.util.CellRangeAddress; add
documentation to tests that exist strictly to test deprecated methods, and move SuppressWarnings-deprecation
down to just those functions

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java?rev=1711581&r1=1711580&r2=1711581&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java Sat Oct 31 09:29:32
2015
@@ -34,7 +34,6 @@ import org.apache.poi.ss.usermodel.Name;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.ss.util.Region;
 import org.apache.poi.util.TempFile;
 
 import junit.framework.TestCase;
@@ -46,7 +45,6 @@ import junit.framework.TestCase;
  * @author Greg Merrill
  * @author Siggi Cherem
  */
-@SuppressWarnings("deprecation")
 public final class TestWorkbook extends TestCase {
     private static final String LAST_NAME_KEY        = "lastName";
     private static final String FIRST_NAME_KEY       = "firstName";
@@ -538,7 +536,13 @@ public final class TestWorkbook extends
 
     /**
      * Generate a file to visually/programmatically verify repeating rows and cols made it
+     * 
+     * Test setRepeatingRowsAndColumns with alternating columns -0 and 1.
+     * 
+     * This test intentionally tests the deprecated
+     * {@link HSSFWorkbook#setRepeatingRowsAndColumns(int, int, int, int, int)} function
      */
+    @SuppressWarnings("deprecation")
     public void testRepeatingColsRows() throws IOException
     {
         HSSFWorkbook workbook = new HSSFWorkbook();
@@ -563,6 +567,13 @@ public final class TestWorkbook extends
         workbook.close();
     }
 
+    /**
+     * Test setRepeatingRowsAndColumns when startRow and startColumn are -1.
+     * 
+     * This test intentionally tests the deprecated
+     * {@link HSSFWorkbook#setRepeatingRowsAndColumns(int, int, int, int, int)} function
+     */
+    @SuppressWarnings("deprecation")
     public void testRepeatingColsRowsMinusOne() throws IOException
     {
         HSSFWorkbook workbook = new HSSFWorkbook();
@@ -603,8 +614,8 @@ public final class TestWorkbook extends
                 c.setCellValue(new HSSFRichTextString("TEST"));
             }
         }
-        s.addMergedRegion(new Region(0, (short)0, 10, (short)10));
-        s.addMergedRegion(new Region(30, (short)5, 40, (short)15));
+        s.addMergedRegion(new CellRangeAddress(0, 10, 0, 10));
+        s.addMergedRegion(new CellRangeAddress(30, 40, 5, 15));
         sanityChecker.checkHSSFWorkbook(wb);
         wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
 



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


Mime
View raw message